

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

$std_rollno=$_POST["std_rollno"];
$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))
{

   
   $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'] ;
				$camp=$test['camp'] ;
				 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 Name </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>";
 

$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=#00FF00 colspan=4> Assessment 1 </th>";
echo "<th bgcolor=yellow colspan=3> Mid Term </th>";
echo "<th bgcolor=yellow colspan=3> Total Marks </th>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=yellow> Subject Name </th>";
echo "<th bgcolor=#00FF00> Total Marks </th>";
echo "<th bgcolor=#00FF00> Obtained Marks </th>";
echo "<th bgcolor=#00FF00> Percentage </th>";

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


   $trecord3=0;
   $trecordmark3=0;
   $trecord4=0;
   $trecordmark4=0;
    $trecord5=0;
   $trecordmark5=0;
    $trecord=0;
   $trecordmark=0;
while($row1 = mysql_fetch_array($std_ledger11))
  {
   $subjname = $row1['subname'];
   echo "<tr>";
  echo "<td>" .$row1['id'] . ":" .$row1['subname'] . "</td>";
  
  $total3 = 0;
   $totalmark3 = 0;
   $totalper3=0;
  $sql3 = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name'  and sub_name='$subjname' and exame_term='Assessment 01' 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'];
   
  } 
  
  if ($totalmark3 < 1)
  {
  $totalmark3=0;
  $total3=0;
   $totalper3=0;
  }
  {
  $totalper3=$total3 / $totalmark3 *100;
  $totalper3=round($totalper3,2);
  }
 
  echo "<td bgcolor=#00FF00> $totalmark3 </td>";
   
   echo "<td bgcolor=#00FF00> $total3 </td>";
  echo "<td bgcolor=#00FF00> $totalper3 </td>";
  
  
 $total4 = 0;
   $totalmark4 = 0;
   $totalper4=0;
  $sql4 = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name'  and sub_name='$subjname' and exame_term='Mid Term' and sess1='$sess1' and user_id='$userid'";
   $std_ledger14=mysql_query($sql4) or die("Error : " . mysql_error());

while($row4 = mysql_fetch_array($std_ledger14))
  {
   $total4 = $row4['obt_mark'];
   $totalmark4 = $row4['total_mark'];
   
  } 
  
  if ($totalmark4 < 1)
  {
  $totalmark4=0;
  $total4=0;
   $totalper4=0;
  }
  {
  $totalper4=$total4 / $totalmark4 *100;
  $totalper4=round($totalper4,2);
  }
 
  echo "<td><h3> $totalmark4 </h3></td>";
  
   echo "<td><h3> $total4 </h3></td>";
  echo "<td><h3> $totalper4 </h3></td>";
  
  
  
 /* $total = 0;
   $totalmark = 0;
  $sql = "select * from 1st_term where std_rollno='$std_rollno' and class_name='$class_name'  and sub_name='$subjname' and sess1='$sess1' and user_id='$userid'";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());

while($row = mysql_fetch_array($std_ledger1))
  {
   $total = $row['obt_mark'];
   $totalmark = $row['total_mark'];
   
  } 
  
  if ($totalmark < 1)
  {
  $totalmark=0;
  $total=0;
   $totalper=0;
  }
  {
  $totalper=$total / $totalmark *100;
  $totalper=round($totalper,2);
  }*/
 $totalmark=$totalmark4 + $totalmark3;
  $total=$total4 + $total3;
  if ($totalmark < 1)
  {
  $totalmark=0;
  $total=0;
   $totalper=0;
  }
  {
  $totalper=$total / $totalmark *100;
  $totalper=round($totalper,2);
  }
  
  echo "<td><h3> $totalmark</h3> </td>";
   echo "<td><h3> $total </h3></td>";
  echo "<td><h3> $totalper </h3></td>";
  
  echo "</tr>";
   $trecord=$trecord + $total;
 $trecordmark=$trecordmark + $totalmark;
   $trecord3=$trecord3 + $total3;
 $trecordmark3=$trecordmark3 + $totalmark3;
  $trecord4=$trecord4 + $total4;
 $trecordmark4=$trecordmark4 + $totalmark4;
 $trecord5=$trecord5 + $total5;
 $trecordmark5=$trecordmark5 + $totalmark5;
 
 } 
 if ($trecordmark3 < 1)
  {
  $trecordmark3=0;
  $trecord3=0;
   $totalper33=0;
  }
  {
  $totalper33=$trecord3 / $trecordmark3 *100;
  $totalper33=round($totalper33,2);
  }
   if ($trecordmark4 < 1)
  {
  $trecordmark4=0;
  $trecord4=0;
   $totalper44=0;
  }
  {
  $totalper44=$trecord4 / $trecordmark4 *100;
  $totalper44=round($totalper44,2);
  }
  if ($trecordmark < 1)
  {
  $trecordmark=0;
  $trecord=0;
   $totalper55=0;
  }
  {
  $totalper55=$trecord / $trecordmark *100;
  $totalper55=round($totalper55,2);
  }
 

 echo "<tr>";
  echo "<th bgcolor=#FFCC33> Total </th>";
   echo "<td bgcolor=#00FF00> $trecordmark3 </td>";
   echo "<td bgcolor=#00FF00> $trecord3 </td>";
  echo "<td bgcolor=#00FF00> $totalper33 </td>";
  echo "<td bgcolor=#FFCC33><h3> $trecordmark4 </h3></td>";
   echo "<td bgcolor=#FFCC33><h3> $trecord4</h3> </td>";
  echo "<td bgcolor=#FFCC33><h3> $totalper44 </h3></td>";
  echo "<td bgcolor=#FFCC33> $trecordmark </td>";
   echo "<td bgcolor=#FFCC33> $trecord </td>";
  echo "<td bgcolor=#FFCC33> $totalper55 </td>";
  
   echo "</tr>";
   $trecordmark3=0;
   $trecord3=0;
   $totalper33=0;
   $trecordmark4=0;
   $trecord4=0;
   $totalper44=0;
   $trecordmark5=0;
   $trecord5=0;
   $totalper55=0;
   $trecordmark=0;
   $trecord=0;
   $totalper=0;
    $totalmark=0;
  $total=0;
   $totalper=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>
