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

$userid=$_SESSION["userid"];
$class_name=$_POST["class_name"];
$sub_name=$_POST["sub_name"];
$dt=$_POST["dt"];
echo "<h4 align=center>$userid </h4>";
echo "<table border=1 width=1000 align=center bgcolor=white>";
echo "<tr>";
echo "<td width=100>"  . "Class" . "</td>" ;
  echo "<td width=100>"  . $class_name . "</td>" ;
  echo "<td width=100>"  . "Subject" . "</td>" ;
  echo "<td width=100>"  . $sub_name . "</td>" ;
  
  echo "</tr>";
  
  echo "<tr>";
echo "<td width=100>"  . "Roll No" . "</td>" ;
  echo "<td width=100>"  . "-------------------" . "</td>" ;
  echo "<td width=100>"  . "Student Name" . "</td>" ;
  echo "<td width=100>"  . "---------------------------" . "</td>" ;
  
  echo "</tr>";
  echo "</table>";

$result = mysql_query("SELECT * FROM add_paper where sub_name='$sub_name' and class_name='$class_name' and date='$dt' and user_id='$userid' order by p_type");
$sno=1;
//$issueslip=mysql_query($result) or die("Error : " . mysql_error());
while($ppp=mysql_fetch_array($result))

{

echo "<table border=1 width=1000 align=center bgcolor=white>";
echo "<tr>";
  echo "<td width=100>"  . $sno . "</td>" ;
  echo "<td>"  .$ppp["question"] . "</td>" ;  
  echo "<td width=100>"  .$ppp["p_type"] . "</td>" ;
  echo "<tr>";
  echo "<td>"  ."". "</td>" ;  
echo "<td>"  .$ppp["optionn"] . "</td>" ;  
 echo "</tr>";

  
   
echo "</table>";
$sno=$sno + 1;
}
echo "<table border=1 width=1000 align=center bgcolor=white>";

  
  echo "<tr>";
echo "<td width=100>"  . "Princple Sign" . "</td>" ;
  echo "<td width=100>"  . "---------------------------" . "</td>" ;
  echo "<td width=100>"  . "Teacher Sign" . "</td>" ;
  echo "<td width=100>"  . "---------------------------" . "</td>" ;
  
  echo "</tr>";
  echo "</table>";
?>

