File: /var/www/content-sp/work-sp/nqb_pyp_question_status_popup.php
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
include_once('header.php');
$SP_MEDIUM = 'csp_sp_medium';
$SP_MASTER_CATEGORY = 'csp_sp_master_category';
$SP_MASTER_STRUCTURE = 'csp_sp_master_structure';
$SP_QUESTION = 'csp_sp_question';
$SP_QUESTION_MEDIUM_WISE = 'csp_sp_question_medium_wise';
$tpcId = $_REQUEST['tpcId'];
$m = $_REQUEST['m'];
$mType = $_REQUEST['mType'];
$getMediums = $conn->query("SELECT medium_id, medium_name from $SP_MEDIUM where medium_id IN(1,2) order by medium_id");
$getMediums1 = $conn->query("SELECT medium_id, medium_name from $SP_MEDIUM where medium_id IN(1,2) order by medium_id");
$getTpcName = $conn->query("SELECT category_name from $SP_MASTER_STRUCTURE where sub_id='$tpcId'");
$getTpcres = $getTpcName->fetch_assoc();
$topicName = $getTpcres['category_name'];
$getPrimaryQuery = "SELECT q.previous_exam_name,count(q.question_id) as qcnt, count(case when q.status='4' then 1 end) as prfqcnt from $SP_QUESTION as q where (q.subject_id='$tpcId' or q.topic_id='$tpcId' or q.sub_topic_id='$tpcId') and q.previous_exam_name IS NOT NULL and q.previous_exam_name!='' group by q.previous_exam_name ";
$getPrimaryData = $conn->query($getPrimaryQuery);
$spaceArray = array(" & ","+");
$replaceArray = array(" and ","plus");
?>
<div class="page-inner">
<div class="page-title">
<h3>New Question Bank</h3>
<div class="page-breadcrumb">
<ol class="breadcrumb">
<li><a href="dashboard">Home</a></li>
<li class="active">Add Questions</li>
</ol>
</div>
</div>
<div id="main-wrapper">
<div class="row">
<div class="col-md-12">
<div class="panel panel-white">
<div class="panel-heading clearfix">
<h4 class="panel-title" style="width:100%;">Question Status -> <?php echo $topicName; ?></h4>
</div>
<font style="font-size: 12px; color: #0050ef;">[ <i class="fa fa-arrows-h"></i> ] Indicates no of proof read questions</font>
<div class="panel-body">
<div class="form-group">
<h4 class="panel-title" style="width:100%;">All Question Data</h4>
</div>
<div class="form-group">
<table class="table table-hover">
<tr>
<th>#</th>
<th>PYP</th>
<th>Count</th>
</tr>
<?php
$i = 1;
$totalP = 0;
$totalPprf = 0;
$level = 0;
while ($gpd = $getPrimaryData->fetch_assoc()) {
$totalP = $totalP + $gpd['qcnt'];
$totalPprf = $totalPprf + $gpd['prfqcnt'];
$level = $gpd['level_name'];
$prevExam = $gpd['previous_exam_name'];
$examName = str_replace($spaceArray, $replaceArray, $gpd['previous_exam_name']);
$shift = str_replace($spaceArray, $replaceArray, $gpd['exam_shift']);
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $gpd['previous_exam_name']; ?></td>
<td>
<a href="nqb_pyp_previousyear_ques_view?viewIn=HI<?php echo '&exam=' . $examName.'&tpcId='.$tpcId; ?>" target="_blank" title="View questions">
<?php echo $gpd['qcnt']; ?> <i class="fa fa-arrows-h"></i> <?php echo $gpd['prfqcnt']; ?>
</a>
</td>
</tr>
<?php $i++; } ?>
<tr>
<th colspan="3">Total</th>
<th colspan="2"><?php echo $totalP; ?> <i class="fa fa-arrows-h"></i> <?php echo $totalPprf; ?></th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="page-footer">
<p class="no-s">Graposs Connect ©</p>
</div>
</div><!-- Page Inner -->
<?php
include_once('footer.php');
?>