Preview: cbt_result_detail.php
                Size: 2.29 KB
              
              
                
              
            
            /home/jambtst2015/public_html/giraffeng.com/cbt_result_detail.php
            <?php ob_start();
session_start();
include("header.php"); 
	
	if($_SESSION["uid"]=="")
	{
		header('location:login.php');
    exit();
		
	}	?>
<link type="text/css" rel="stylesheet" href="css/sb-admin.css">
<style>
td{border:1px solid;}
</style>
<section class="header_back_inner"></section>
<input type="hidden" id="cbt_id" value="<?= $cbt_id?>">
	<div align="center" class="inner-mid-section">
	 <div class="container">
	<h2 class="demoHeaders"><span>Result Details</span></h2>
	<?php 
		 $user_id=$_SESSION['uid'];
		$cbt_id=$_GET['cbt'];
		$results=mysql_query("SELECT s1.subject as subject1, s2.subject as subject2, s3.subject as subject3, s4.subject as subject4, cbt.*  from `cbt_results` cbt join `exam_subject_master` s1 on cbt.sub1=s1.id join `exam_subject_master` s2 on cbt.sub2=s2.id join `exam_subject_master` s3 on cbt.sub3=s3.id join `exam_subject_master` s4 on cbt.sub4=s4.id where `cbt`.`u_id`=".$user_id." ORDER BY cbt.date DESC");
		echo '<table cellpadding="2" cellspacing=2" border="1" class="table reasult-table"><tr>';
		echo '<th>Exam Date</th><th>Subject1</th><th>result</th>		<th>Subject2</th><th>result</th>		<th>Subject3</th><th>result</th>		<th>Subject4</th><th>result</th>				<th>Total Mark</th></tr>';
		
		
		
?>
		
		<?php
		 while($result = mysql_fetch_array($results)){
			 $p1=round($result["res1"]/$result["noq1"]*100,2);
			 $p2=round($result["res2"]/$result["noq2"]*100,2);
			 $p3=round($result["res3"]/$result["noq3"]*100,2);
			 $p4=round($result["res4"]/$result["noq4"]*100,2);
			 $cbt_id = $result['id'];
			 //$tot=round(($p1+p2+$p3+$p4)/4,2);
			 $tot=($p1+$p2+$p3+$p4);
			echo '<tr><td>'.date('d-m-Y', strtotime($result["date"])).'  '.date('h:m A', strtotime($result["date"])).'</td>			<td class="subject-row">'.$result["subject1"].'</td>			<td>'.$p1.'%</td>			<td class="subject-row">'.$result["subject2"].'</td>			<td>'.$p2.'%</td>			<td class="subject-row">'.$result["subject3"].'</td>			<td>'.$p3.'%</td>			<td class="subject-row">'.$result["subject4"].'</td>			<td>'.$p4.'%</td>			<td align="center">'.$tot.'   <a href="report_cbt.php?cbt_id='.$cbt_id.'" class="go-back">view</a></td>			</tr>'; 
		} 
		
	?>
	</table>
    <br/>
    <a href="user-account.php" class="go-back">Back</a>
    
	</div>     
	<div class="clear"></div>
	
    </div>
	<?php include("footer.php"); ?>
	
	
	
                                          Directory Contents
Dirs: 17 × Files: 104