

							<?php session_start(); 
							
include 'dbc.php';
$userid=$_SESSION["userid"];


$class_name=$_POST["class_name"];
$sess1=$_POST["sess1"];
$camp=$_POST["camp"];
?>
<table border="0" width=100% align="center">
  
  <tr>
    <td>&nbsp;</td>
   
  </tr>
</table>
<?php
$result = mysql_query("SELECT * FROM admission WHERE class_name='$class_name' and camp='$camp' and user_id='$userid' order by std_rollno");
//$test = mysql_fetch_array($result);
while($test=mysql_fetch_array($result))
{
$total = 0;
   $trecord=0;
   $totalmark = 0;
   $trecordmark=0;
   
   $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> Campus </th>";
echo "<td> $camp </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>";
 
echo "<table border=1 width=100% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<td>";
$sql2 = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Assessment 01' and sess1='$sess1' and camp='$camp' and user_id='$userid'";
   $std_ledger12=mysql_query($sql2) or die("Error : " . mysql_error());
echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Subject Name </th>";
while($row2 = mysql_fetch_array($std_ledger12))
  {
   echo "<tr>";
  echo "<td>" .$row2['subid'] . ":" .$row2['sub_name'] . "</td>";
  echo "</tr>";
  } 
   echo "<tr>";
  echo "<td> Total </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> Per % </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$sql3 = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Assessment 01' and sess1='$sess1' and camp='$camp' and user_id='$userid' ORDER BY subid";
   $std_ledger13=mysql_query($sql3) or die("Error : " . mysql_error());
echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Assessment 01 </th>";
while($row3 = mysql_fetch_array($std_ledger13))
  {
   echo "<tr>";
  echo "<td>" .$row3['subid'] . ":" .$row3['sub_name'] . ":" .$row3['obt_mark'] . " / " . $row3['total_mark'] . "</td>";
  echo "</tr>";
   $total = $row3['obt_mark'];
   $trecord=$trecord + $total;
   $totalmark = $row3['total_mark'];
   $trecordmark=$trecordmark + $totalmark;	
  } 
  if ($trecordmark < 1)
  {
  $trecordmark=1;
  $trecord=1;
   $totalper=$trecord / $trecordmark *100;
  }
  {
  $totalper=$trecord / $trecordmark *100;
  $totalper=round($totalper,2);
  }
  echo "<tr>";
  echo "<td> $trecord / $trecordmark </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> $totalper </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$sql = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Assessment 02' and sess1='$sess1' and camp='$camp' and user_id='$userid' ORDER BY subid";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());
echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Assessment 02 </th>";
while($row = mysql_fetch_array($std_ledger1))
  {

   echo "<tr>";
  echo "<td>" .$row['sub_name'] . ":" .$row['obt_mark'] . " / " . $row['total_mark'] . "</td>";
  echo "</tr>";
 $total1 = $row['obt_mark'];
   $trecord1=$trecord1 + $total1;
   $totalmark1 = $row['total_mark'];
   $trecordmark1=$trecordmark1 + $totalmark1;	
  } 
  if ($trecordmark1 < 1)
  {
  $trecordmark1=1;
  $trecord1=1;
   $totalper1=$trecord1 / $trecordmark1 *100;
  }
  {
  $totalper1=$trecord1 / $trecordmark1 *100;
  $totalper1=round($totalper1,2);
  }
  echo "<tr>";
  echo "<td> $trecord1 / $trecordmark1 </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> $totalper1 </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$sql = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Mid Term Exams' and sess1='$sess1' and camp='$camp' and user_id='$userid' ORDER BY subid";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());
echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Mid Term Exams </th>";
while($row = mysql_fetch_array($std_ledger1))
  {
   echo "<tr>";
  echo "<td>" .$row['subid'] . ":" .$row['sub_name'] . ":" .$row['obt_mark'] . " / " . $row['total_mark'] . "</td>";
  echo "</tr>";
 $total2 = $row['obt_mark'];
   $trecord2=$trecord2 + $total2;
   $totalmark2 = $row['total_mark'];
   $trecordmark2=$trecordmark2 + $totalmark2;	
  } 
   if ($trecordmark2 < 1)
  {
  $trecordmark2=1;
  $trecord2=1;
   $totalper2=$trecord2 / $trecordmark2 *100;
  }
  {
  $totalper2=$trecord2 / $trecordmark2 *100;
  $totalper2=round($totalper2,2);
  }
  echo "<tr>";
  echo "<td> $trecord2 / $trecordmark2 </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> $totalper2 </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$sql = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Assessment 03' and sess1='$sess1' and camp='$camp' and user_id='$userid' ORDER BY subid";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());
echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Assessment 03 </th>";

while($row = mysql_fetch_array($std_ledger1))
  {
   echo "<tr>";
  echo "<td>" .$row['sub_name'] . ":" .$row['obt_mark'] . " / " . $row['total_mark'] . "</td>";
  echo "</tr>";
  $total3 = $row['obt_mark'];
   $trecord3=$trecord3 + $total3;
   $totalmark3 = $row['total_mark'];
   $trecordmark3=$trecordmark3 + $totalmark3;	
  } 
  if ($trecordmark3 < 1)
  {
  $trecordmark3=1;
  $trecord3=1;
   $totalper3=$trecord3 / $trecordmark3 *100;
  }
  {
  $totalper3=$trecord3 / $trecordmark3 *100;
  $totalper3=round($totalper3,2);
  }
  echo "<tr>";
  echo "<td> $trecord3 / $trecordmark3 </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> $totalper3 </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$sql = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Assessment 04' and sess1='$sess1' and camp='$camp' and user_id='$userid' ORDER BY subid";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());
echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Assessment 04 </th>";
while($row = mysql_fetch_array($std_ledger1))
  {
   echo "<tr>";
  echo "<td>" .$row['sub_name'] . ":" .$row['obt_mark'] . " / " . $row['total_mark'] . "</td>";
  echo "</tr>";
  $total4 = $row['obt_mark'];
   $trecord4=$trecord4 + $total4;
   $totalmark4 = $row['total_mark'];
   $trecordmark4=$trecordmark4 + $totalmark4;	
  } 
   if ($trecordmark4 < 1)
  {
  $trecordmark4=1;
  $trecord4=1;
   $totalper4=$trecord4 / $trecordmark4 *100;
  }
  {
  $totalper4=$trecord4 / $trecordmark4 *100;
  $totalper4=round($totalper4,2);
  }
  echo "<tr>";
  echo "<td> $trecord4 / $trecordmark4 </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> $totalper4 </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$sql = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name' and exame_term='Final Term Exams' and sess1='$sess1' and camp='$camp' and user_id='$userid' ORDER BY subid";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());
   echo "<table border=1>";
echo "<tr>";
echo "<th bgcolor=yellow> Final Term Exams </th>";

while($row = mysql_fetch_array($std_ledger1))
  {
   echo "<tr>";
  echo "<td>" .$row['sub_name'] . ":" .$row['obt_mark'] . " / " . $row['total_mark'] . "</td>";
  echo "</tr>";
 $total5 = $row['obt_mark'];
   $trecord5=$trecord5 + $total5;
   $totalmark5 = $row['total_mark'];
   $trecordmark5=$trecordmark5 + $totalmark5;	
  } 
  if ($trecordmark5 < 1)
  {
  $trecordmark5=1;
  $trecord5=1;
   $totalper5=$trecord5 / $trecordmark5 *100;
   $totalper5=round($totalper5,2);
  }
  {
  $totalper5=$trecord5 / $trecordmark5 *100;

	$totalper5=round($totalper5,2);
  }
  echo "<tr>";
  echo "<td> $trecord5 / $trecordmark5 </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td> $totalper5 </td>";
  echo "</tr>";
echo "</tr>";
echo "</table>";
echo "</td>";


 echo "</tr>";
 
 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>
