ok

Mini Shell

Direktori : /home2/selectio/www/tnpsctestbatch.com/
Upload File :
Current File : /home2/selectio/www/tnpsctestbatch.com/mock-result-content.php

<?php 
$htmldata="";

$htmldata.='<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">';
include "config/config.php";
ini_set('memory_limit', '-1');
session_start();


    $uid="";
    $right = ''; 
    $style = ''; 
    $icons = ''; 
    $color =''; 
    $i = 0; 
        
    $sql_mock_test = $pdo->prepare("SELECT * FROM tbl_mock_test WHERE mock_test_type=".$_GET['exam_id']);
	$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'];
	    $uname = $_SESSION['user_exam']['name'];
	}
	
	$exam_type = $_GET['exam_id'] ;
	

	
	 if($mock_total>0){
	     
	$htmldata.='<table style="width: 100%;">
	<tr>
	    <td> <img src="https://tnpsctestbatch.com/icons/logo/logo.png" alt="" > </td>
	</tr>'; 
	
	foreach ($mock_result as $mock_result_datas){ 


    
    $final_sql = $pdo->prepare("SELECT * FROM tbl_mock_test_result WHERE user_id=$uid AND date = '$date' AND type = $exam_type AND question_id =?");
	$final_sql->execute(array($mock_result_datas['id']));
	$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 = '<img src="https://tnpsctestbatch.com/icons/check.png" alt="" >';
            }else{
                $color = 'style="color:green;"';
                $icons = '<img src="https://tnpsctestbatch.com/icons/no.png" alt="" >';
            }
        }else{
            $color = 'style="color:blue;"';
            $icons = '<i class="bi bi-skip-end" style="color: blue;font-size: larger;font-weight: 900;"></i>B';
        }
                               
            $htmldata.='<tr> 
                            <td>'.$mock_result_datas['question'].' '.$icons.' </td>    
                        </tr>
                        <tr>
                    	    <td style=""> '.$mock_result_datas['option_a'].'</td>
                        </tr>
                        <tr>
                    	    <td style=""> '.$mock_result_datas['option_b'].'</td>
                        </tr>
                        <tr>
                    	    <td style=""> '.$mock_result_datas['option_c'].'</td>
                        </tr>
                        <tr>
                    	    <td style=""> '.$mock_result_datas['option_d'].'</td>
                        </tr>';
	} 
	$htmldata.='</table>';
	
$download_name = "TNPSC TEST BATCH ".$uname;
 }else { $htmldata='<center>No Record Found</center>';}
 
 
?>

Zerion Mini Shell 1.0