

							<?php session_start(); 
							
include 'dbc.php';
$userid=$_SESSION["userid"];
$exame_term=$_POST["exame_term"];
$std_rollno=$_POST["std_rollno"];
$class_name=$_POST["class_name"];
$sess1=$_POST["sess1"];
?>
<table border="0" width=100% align="center">
  
  <tr>
    <td>&nbsp;</td>
   
  </tr>
</table>
<?php
$result = mysql_query("SELECT * FROM 1st_term WHERE class_name  = '$class_name' and exame_term='$exame_term' and user_id='$userid' order by std_rollno");
//$test = mysql_fetch_array($result);
while($test=mysql_fetch_array($result))
{

   
   $total1 = 0;
   $trecord1=0;
   $totalmark1 = 0;
   $trecordmark1=0;
   
   $total2 = 0;
   $trecord2=0;
   $totalmark2 = 0;
   $trecordmark2=0;
   
   $total3 = 0;
   $trecord3=0;
   $totalmark3 = 0;
   $trecordmark3=0;
   
   $total4 = 0;
   $trecord4=0;
   $totalmark4 = 0;
   $trecordmark4=0;
   
   $total5 = 0;
   $trecord5=0;
   $totalmark5 = 0;
   $trecordmark5=0;
				$std_name=$test['std_name'] ;
				$std_rollno=$test['std_rollno'] ;
				$father_name=$test['father_name'] ;
				
				 echo "<h1 align=center>$userid </h1>";
				  echo "<h2 align=center>Student 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 "<th> Class Name </th>";
echo "<td> $class_name </td>";

echo "</tr>";
echo "<tr>";
echo "<th> Father Name </th>";
echo "<td> $father_name </td>";
echo "<th> Month Name </th>";
echo "<td> $month_name </td>";
echo "<th> Session </th>";
echo "<td> $sess1 </td>";

echo "</tr>";
echo "<tr>";
echo "<th colspan=6 align=center bgcolor=#FFFFFF> Marks Detail</th>";
echo "</tr>";
echo "</table>";
 

$sql1 = "select * from addsubject where user_id='$userid' order by id";
   $std_ledger11=mysql_query($sql1) or die("Error : " . mysql_error());
echo "<table border=1 width=100%>";
echo "<tr>";
echo "<th bgcolor=yellow colspan=4> $exame_term </th>";

echo "</tr>";
echo "<tr>";
echo "<th bgcolor=yellow> Subject Name </th>";
echo "<th bgcolor=yellow> Total Marks </th>";
echo "<th bgcolor=yellow> Obtained Marks </th>";
echo "<th bgcolor=yellow> Percentage </th>";


while($row1 = mysql_fetch_array($std_ledger11))
  {
   $subjname = $row1['subname'];
   echo "<tr>";
  echo "<td>" .$row1['id'] . ":" .$row1['subname'] . "</td>";
  
  $total3 = 0;
   $trecord3=0;
   $totalmark3 = 0;
   $trecordmark3=0;
    $passmark3=0;
	$passtrecordmark3=0;
  $sql3 = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name'  and sub_name='$subjname' and exame_term='$exame_term' and sess1='$sess1' and user_id='$userid'";
   $std_ledger13=mysql_query($sql3) or die("Error : " . mysql_error());

while($row3 = mysql_fetch_array($std_ledger13))
  {
   $total3 = $row3['obt_mark'];
   $totalmark3 = $row3['total_mark'];
   $passmark3 = $row3['pass_mark'];
  // $passtrecordmark3=$passtrecordmark3 + $passmark3;
   //$trecord3=$trecord3 + $total3;	
   //$trecordmark3=$trecordmark3 + $totalmark3;
  } 
  
  if ($totalmark3 < 1)
  {
  $totalmark3=0;
  $total3=0;
   $totalper3=0;
  }
  {
  $totalper3=$total3 / $totalmark3 *100;
  $totalper3=round($totalper3,2);
  }
 $trecord33=$trecord33 + $total3;
 $trecordmark33=$trecordmark33 + $totalmark3;
 
 if ($trecordmark33 < 1)
  {
  $trecordmark33=0;
  $trecord33=0;
   $totalper33=0;
  }
  {
  $totalper33=$trecord33 / $trecordmark33 *100;
  $totalper33=round($totalper33,2);
  }
  echo "<th bgcolor=yellow> $totalmark3 </th>";
   
   echo "<th bgcolor=yellow> $total3 </th>";
  echo "<th bgcolor=yellow> $totalper3 </th>";
  
  
  echo "</tr>";
 } 
  echo "<tr>";
  echo "<th bgcolor=yellow> Total </th>";
   echo "<th bgcolor=yellow> $trecordmark33 </th>";
   
   echo "<th bgcolor=yellow> $trecord33 </th>";
  echo "<th bgcolor=yellow> $totalper33 </th>";
   echo "</tr>";
 
 $trecordmark33=0;
 $trecord33=0;
 $totalper33=0;
echo "</table>";


 echo "<br>";
 echo "Remarks:-______________________________________________________________________________________________________________________";
 
 echo "<br>";
 echo "_____________________________________________________________________________________________________________________________";
 
 echo "<br>";
 echo"______________________________________________________________________________________________________________________________";
  echo "<br>";
  echo "<br>";
  echo "<br>";
 echo "Teacher Signature:___________________&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head Academics:___________________";
 }
?>

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