<?php
session_start();
include 'dbc.php';

$userid=$_SESSION["userid"];
$class_name=$_POST["class_name"];
$today=$_POST["today"];
$status=$_POST["status"];
$mnth=date("m");

$month_num =$mnth; 
  $month_name = date("F", mktime(0, 0, 0, $month_num, 10)); 
$yr=date("Y");
$my=$month_name . $yr;


$sql = "select * from admission where class_name='$class_name' and user_id='$userid'";
$admission=mysql_query($sql) or die("Error : " . mysql_error());
    
while($ppp=mysql_fetch_array($admission))
{
$rollno=$ppp["std_rollno"];
$stdname=$ppp["std_name"];
$fname=$ppp["father_name"];
$cell_1=$ppp["cell_1"];
$allied_code=$ppp["allied_code"];
	$sql3 = "Insert into atten (id,date,class_name,std_rollno,std_name,father_name,cell_1,pass_mark,total_mark,obt_mark,user_id,sess1,camp) values (null,'$today','$class_name','$rollno','$stdname','$fname','$cell_1','$month_name','$yr','$status','$userid','$my','$allied_code')";
mysql_query($sql3) or die("Error : " . mysql_error());
	


	 }
	echo "Days Genrate Sucessfully";
?>
<a href="attendance_entry.php">Back</a>