<?php
session_start();
include 'dbc.php';
$userid=$_SESSION["userid"];
$sql = "select * from atten where user_id='$userid'";
$admission=mysql_query($sql) or die("Error : " . mysql_error());
    
while($app=mysql_fetch_array($admission))
{
  
   $id=$app["id"];
   $total_mark=$app["total_mark"];
   $obt_mark=$app["obt_mark"];
   
   $per=$obt_mark / $total_mark * 100;
if ($obt_mark >= $pass_mark)
{
$status="Pass";
}
else
{
$status="Fail";
}
	$query = "UPDATE atten SET per='$per', status='$status' WHERE id='$id'";
mysql_query($query) or die ("Error in query: $query");
	

	 }
	echo "Result Make Sucessfully";
?>
<a href="attendance_Report.php">Back</a>