<?php 
session_start();
//mysql_connect("localhost","root","vertrigo") or die("Error Connecting Server");
//mysql_select_db("sm") or die("Error Opening Database");
include 'dbc.php';


$today=date("Y-m-d");
echo "<h1 align=center> Select Student Data Report </h1>";
echo '<table width="100%" border=1>';
echo '<tr>';
echo "<th bgcolor=yellow> Id </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Student Roll # </th>";
echo "<th bgcolor=yellow> Father Name </th>";
echo "<th bgcolor=yellow> Class  </th>";
echo "<th bgcolor=yellow> Subject  </th>";
echo "<th bgcolor=yellow> Total Marks </th>";
echo "<th bgcolor=yellow> Pass Marks </th>";
echo "<th bgcolor=yellow> Obt Marks</th>";
echo "<th bgcolor=yellow>Per %</th>";
echo "<th bgcolor=yellow> Status</th>";

echo '</tr>';
if($_POST['delete']) // from button name="delete"
	{
		$checkbox = $_POST['checkbox']; //from name="checkbox[]"
		$countCheck = count($_POST['checkbox']);
		
		for($i=0;$i<$countCheck;$i++)
		{
			$del_id  = $checkbox[$i];
			$userid=$_SESSION["userid"];
			$today=date("Y-m-d");
			
							
						$sql = "select * from 1st_term where id='$del_id' and user_id='$userid'";
   $result=mysql_query($sql) or die("Error : " . mysql_error());
$a = 0;
 

 
echo "<form name='form_update' method='post' action='add_obt.php'>\n";
while ($students = mysql_fetch_array($result)) {
	echo '<tr>';
	echo "<td>{$students['id']}<input type='hidden' name='id[$i]' value='{$students['id']}' /></td>";
	echo "<td>{$students['std_name']}</td>";
	echo "<td>{$students['std_rollno']}</td>";
	echo "<td>{$students['father_name']}</td>";
	echo "<td>{$students['class_name']}</td>";
	echo "<td>{$students['sub_name']}</td>";
	echo "<td>{$students['total_mark']}</td>";
	echo "<td>{$students['pass_mark']}</td>";
	echo "<td>{$students['obt_mark']}</td>";
	echo "<td>{$students['per']}</td>";
	echo "<td>{$students['status']}</td>";
	echo "<td><input type='text' size='20' name='obt_mark[$i]' value='{$students['obt_mark']}' /></td>";
	echo '</tr>';
	++$a;
}

		}
		echo '<tr>';
echo "<td><input type='submit' value='submit' /></td>";
echo '</tr>';
echo "</form>";
echo '</table>';	
	}
?>






