Location: PHPKode > projects > Social Networking Site > Social_Networking/GetResult.php
<?php
session_start();
if(!$_SESSION["id"]==session_id())
header('location:index.html');
if(!isset($_SESSION['id']))
header('location:index.html');
$dig=$_POST["code"];
$seat=$_POST["roll"];
$gd="honours";
$con=odbc_connect('Result','','');
if(!$con)
echo "not connected to database";
else
{
$qry="select * from Result where id='" . $dig . "' and roll=" . $seat;
$rs=odbc_exec($con,$qry);
if(!$rs)
echo "no result found";
else
{
	if(odbc_fetch_row($rs))
	{
		$java=odbc_result($rs,4);
		$network=odbc_result($rs,5);
		$webtech=odbc_result($rs,6);
		$stats=odbc_result($rs,7);
		$se=odbc_result($rs,8);
		$prac1=odbc_result($rs,9);
		$prac2=odbc_result($rs,10);
		$prac3=odbc_result($rs,11);
		$uname=odbc_result($rs,1);
		$tot=$java+$network+$webtech+$stats+$se+$prac1+$prac2+$prac3;
		
		$perc=$tot*100/800;

		if($perc>=90)
			$gd="Honours";
		else if($perc>=80)
			$gd="A+";
		else if($perc>=70)
			$gd="Distinction";
		else if($perc>=60)
			$gd="First Class";
		else if($perc>=50)
			$gd="Second Class";
		else if($perc>=40)
			$gd="Pass Class";
	echo "<html><head><title>BCA RESULT</title></head><body>";
	echo "<table border=2 bgcolor='lightblue' height=600 width=600><tr>";
	echo "<td><b><font color='maroon' size=4>Name of Student:-</td><td>" . $uname . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Java Programming:-</td><td>" . $java . "<tr>";
	echo "<td><b><font color='maroon' size=4>Networks:-</td><td>" . $network . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Webtech:-</td><td>" . $webtech . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Statistics:-</td><td>" . $stats . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Software Engineering:-</td><td>" . $se . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Practical 1:-</td><td>" . $prac1 . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Practical 2:-</td><td>" . $prac2 . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Practical 3:-</td><td>" . $prac3 . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Total Marks:-</td><td>" . $tot . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Percentage:-</td><td>" . $perc . "</td><tr>";
	echo "<td><b><font color='maroon' size=4>Grade:-</td><td>" . $gd . "</td><tr>";
	echo "</table></b>";
	echo "</body></html>";	
	}
	else
	{
		echo "no records found";
	}
}
}
?>

  



	
Return current item: Social Networking Site