File: /var/www/content-sp/work-sp/nqb_master_wise_questions.php
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
include_once('nqb_master_section.php');
$SP_MASTER_STRUCTURE = 'csp_sp_master_structure';
$SP_EDITORS = 'csp_editors';
$SP_QUESTION = 'csp_sp_question';
$SP_MASTER_CATEGORY = 'csp_sp_master_category';
$SP_MEDIUM = 'csp_sp_medium';
$SP_QUESTION_MEDIUM_WISE = 'csp_sp_question_medium_wise';
$SP_QUES_HISTORY = 'csp_sp_question_history';
$curDate = date('Y-m-d H:i:s');
$getQnQuery = "select q.master_id, q.medium_id, count(q.question_id) as qcnt, m.master_name, md.medium_name from $SP_QUESTION as q LEFT JOIN $SP_MASTER_CATEGORY as m ON m.master_id=q.master_id LEFT JOIN $SP_MEDIUM as md ON md.medium_id=q.medium_id group by q.master_id, q.medium_id order by q.master_id";
$getQnData = $conn->query($getQnQuery);
$allMaster = $conn->query("SELECT c.master_name,c.master_id,c.source FROM $SP_MASTER_CATEGORY as c order by c.master_name");
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title" style="width: 100%;">Master Wise Questions</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="medium_table" class="display table" style="width: 100%; cellspacing: 0;">
<thead>
<tr>
<th>S.No</th>
<th>MasterId</th>
<th>MasterName</th>
<th>Medium</th>
<th>Questions</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
while ($ms = $getQnData->fetch_assoc()) { ?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $ms['master_id']; ?></td>
<td><?php echo $ms['master_name']; ?>
<i style="cursor:pointer;font-size:15px;" data-toggle="modal" data-target=".bs-example-modal-lg2" class="fa fa-info-circle" onclick="questionSubWise('<?php echo $ms['master_id']; ?>', '<?php echo $ms['medium_id']; ?>')" title="View Subject Wise Count"></i>
</td>
<td><?php echo $ms['medium_name']; ?></td>
<td><?php echo $ms['qcnt']; ?></td>
</tr>
<?php $i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-------master question subject wise---------->
<div class="modal fade bs-example-modal-lg2" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg2">
<div class="modal-content">
<div class="modal-header" style="padding: 5px 10px 0px 0px; height: 20px;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body" id="modal_body1">
</div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" />
<script src="assets/plugins/jquery/jquery-2.1.3.min.js"></script>
<script src="assets/plugins/jquery-ui/jquery-ui.min.js"></script>
<link href="assets/plugins/datatables/css/jquery.datatables.min.css" rel="stylesheet">
<link href="assets/plugins/datatables/css/responsive.datatables.min.css" rel="stylesheet">
<script src="assets/plugins/datatables/js/jquery.datatables.min.js"></script>
<script src="assets/plugins/datatables/js/jquery.datatables.js"></script>
<script src="assets/plugins/datatables/js/datatables.responsive.min.js"></script>
<script type="text/javascript">
var jq = jQuery.noConflict();
jq(document).ready(function() {
jq('#medium_table').dataTable({
"processing": true,
"serverSide": false,
"responsive": true,
"bPaginate": true,
"iDisplayLength": 100,
"lengthMenu": [
[50, 100, 300, 500, 1000],
[50, 100, 300, 1000, "All"]
],
});
});
function questionSubWise(masterId, mediumId) {
var site = "nqb_master_wise_questions_subject_wise.php?masterId=" + masterId+"&mediumId=" + mediumId;
jQuery.ajax({
url: site,
type: 'POST',
data: 'html',
success: function(data) {
document.getElementById("modal_body1").innerHTML = data;
}
});
}
</script>
</div><!-- Main Wrapper -->
<div class="page-footer">
<p class="no-s">Graposs Connect ©</p>
</div>
</div><!-- Page Inner -->
<style>
.table-hover th,
td {
font-size: 13px;
}
.redClass {
background-color: #ff6d6d !important;
}
.orangeClass {
background-color: #ff7607 !important;
}
.modal-backdrop.in {
opacity: 0.9 !important;
z-index: 9 !important;
}
.ta {
background: #6873f9;
color: #fff;
font-weight: bold;
}
.tb {
background: #f9b868;
color: #fff;
font-weight: bold;
}
</style>
<?php
include_once('footer.php');
?>