<?php 
session_start(); 

							
							
include 'dbc.php';
$userid=$_SESSION["userid"];
$id =$_REQUEST['id'];
$class_name=$_POST["class_name"];
$sess1=$_POST["sess1"];
$todate=$_POST["todate"];
$mnth=date("m");

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

$result = mysql_query("SELECT * FROM admission WHERE class_name  = '$class_name' and user_id='$userid' order by std_rollno");


//$test = mysql_fetch_array($result);
while($test=mysql_fetch_array($result))
{

  
 
   

				$std_name=$test['std_name'] ;
				$std_rollno=$test['std_rollno'] ;
				$father_name=$test['father_name'] ;
				$camp=$test['allied_code'] ;
				
				$cell_1=$test['cell_1'] ;
				echo "<h1 align=center>$userid </h1>";
				  echo "<h2 align=center>Student Attendance Progress Report</h2>";
				
				  echo "<table border=1 width=100% align=center bgcolor=#FFCC33>";
echo "<tr>";
echo "<th> Student Name </th>";
echo "<td> $std_name </td>";
echo "<th> Student Roll # </th>";
echo "<td> $std_rollno </td>";

echo "</tr>";
 echo "<tr>";
 echo "<th> Father Name </th>";
echo "<td> $father_name </td>";
echo "<th> Class Name </th>";
echo "<td> $class_name </td>";
echo "</tr>";
 echo "<tr>";
echo "<th> Cell# </th>";
echo "<td> $cell_1 </td>";
  
  
   echo "</tr>";
  

echo "<tr>";
echo "<th> Month </th>";
echo "<th> Total Days </th>";
echo "<th> Absent Days </th>";
echo "<th> Percentage (%) </th>";

echo "</tr>";
$p=0;
$l=0;
$a=0;
 $sql3p = "select * from atten where std_rollno='$std_rollno' and class_name='$class_name' and user_id='$userid' order by id";
   $std_ledger13p=mysql_query($sql3p) or die("Error : " . mysql_error());

while($row3p = mysql_fetch_array($std_ledger13p))
  {
$month_name=$row3p['month_name'] ;
$total_mark=$row3p['total_mark'] ;
$obt_mark=$row3p['obt_mark'] ;
$per=$row3p['per'] ;
    $per=round($per,0);

  echo "<tr>";
echo "<td> $month_name </td>";
echo "<td> $total_mark </td>";
echo "<td> $obt_mark </td>";
echo "<td> $per . % </td>";
 echo "</tr>";
  } 



 echo "</table>";
 }
 

?>

	<table width="69%" border="0" align="center">
  <tr>
    <td width="51%">&nbsp;</td>
    <td width="49%">&nbsp;</td>
  </tr>
 
</table>
