ok

Mini Shell

Direktori : /home2/selectio/public_html/tnpsctestbatch.com/
Upload File :
Current File : /home2/selectio/public_html/tnpsctestbatch.com/content.php

<?php 
  ob_start();
	session_start();
include "config/config.php";


    $uid="";
    $right = ''; 
    $style = ''; 
    $icons = ''; 
    $color =''; 
    $i = 0; 
        
    $sql_mock_test = $pdo->prepare("SELECT * FROM tbl_mock_test WHERE mock_test_type=2");
	$sql_mock_test->execute();
	$mock_result = $sql_mock_test->fetchAll(PDO::FETCH_ASSOC);
	$mock_total = $sql_mock_test->rowCount();
	$date = date('Y-m-d');
	
	if(isset($_SESSION['user_exam'])){
	    $uid = $_SESSION['user_exam']['id'];
	}
	
	$exam_type = 2;
	
	 $htmldata='';
	 $htmldata.='<table style="width: 100%;">'; 
	 if($mock_total>0){
	
	foreach ($mock_result as $mock_result_datas){ $i ++;
    
    $final_sql = $pdo->prepare("SELECT * FROM tbl_mock_test_result WHERE user_id=$uid AND date = '$date' AND type = $exam_type AND question_id =".$mock_result_datas['id']);
	$final_sql->execute();
	$final_result = $final_sql->fetchAll(PDO::FETCH_ASSOC);
	$final_total = $final_sql->rowCount();
		                                
		 if($final_total>0){
		                                    
            if($final_result[0]['select_option']==$mock_result_datas['correct_answer']){
               
                $color = 'style="color:red;"';
                $icons = '<i class="bi bi-check-lg" style="color: red;font-size: larger;font-weight: 900;"></i>';
            }else{
              
                $color = 'style="color:green;"';
                $icons = '<i class="bi bi-x" style="color: green;font-size: larger;font-weight: 900;"></i>';
            }
            
        }else{
            $color = 'style="color:blue;"';
            $icons = '<i class="bi bi-skip-end" style="color: blue;font-size: larger;font-weight: 900;"></i>';
        }
        
       
            $htmldata.='<tr style="color: silver">
                	<th style="text-align: left;"> '.$mock_result_datas['option_a'].' </th>
                	<th style="text-align: right;">'.$mock_result_datas['option_b'].'</th>
                </tr>
            </table>';
		                    
	}
    echo  $htmldata;    	

 }else { $htmldata='<center>No Record Found</center>';}
?>

Zerion Mini Shell 1.0