File: /var/www/content-sp/work-sp/nqb_questions_proof_read.php
<?php
include_once('nqb_master_section.php');
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
$SP_EDITORS = 'csp_editors';
$SP_QUESTION = 'csp_sp_question';
$SP_QUESTION_MEDIUM_WISE = 'csp_sp_question_medium_wise';
$SP_MEDIUM = 'csp_sp_medium';
$fileName = str_replace('.php', '', basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['QUERY_STRING']));
// $fileName = 'ssc_to_bank_current_affairs';
//check master permissions
if (in_array($fileName, $pageArray)) {
$es_ondate = date('Y-m-d');
$subQuery = " and date(sq.last_proofread_date)='$es_ondate'";
$subQuery1 = " and date(sqm.last_proofread_date)='$es_ondate'";
/**search */
if (isset($_REQUEST['submit'])) {
$es_ondate = $_REQUEST['es_ondate'];
if ($es_ondate != '') {
$q_date = date('Y-m-d', strtotime($es_ondate));
$subQuery = " and date(sq.last_proofread_date)='$q_date'";
$subQuery1 = " and date(sqm.last_proofread_date)='$q_date'";
}
}
# data related to proofread by selected editor
$questionPfr = "SELECT sq.last_proofread_date, e.editor_id, sq.last_proofread_by, e.contact_name, m.medium_name, count(sq.question_id) as totalpf FROM $SP_QUESTION as sq LEFT JOIN $SP_EDITORS as e ON e.editor_id=sq.last_proofread_by LEFT JOIN $SP_MEDIUM as m on m.medium_id=sq.medium_id where sq.question_id!='' $subQuery group by cast(sq.last_proofread_date as date), sq.last_proofread_by, sq.medium_id order by count(sq.question_id) desc";
$mDataPf = $conn->query($questionPfr);
$ifPfData = mysqli_num_rows($mDataPf);
//echo "<br>";
# data related to proofread by selected editor in secondary medium
$questionPfrS = "SELECT sqm.last_proofread_date, e.editor_id, sqm.last_proofread_by, e.contact_name, m.medium_name, count(sqm.question_id) as totalspf FROM $SP_QUESTION_MEDIUM_WISE as sqm LEFT JOIN $SP_EDITORS as e ON e.editor_id=sqm.last_proofread_by LEFT JOIN $SP_MEDIUM as m on m.medium_id=sqm.medium_id where sqm.question_id!='' $subQuery1 group by cast(sqm.last_proofread_date as date), sqm.last_proofread_by, sqm.medium_id order by count(sqm.question_id) desc";
$mDataPfS = $conn->query($questionPfrS);
$ifPfSData = mysqli_num_rows($mDataPfS);
?>
<style>
.table {
font-size: 13px;
}
.hrhead {
font-weight: bold;
color: #2196F3;
text-align: center;
}
</style>
<div class="row">
<div class="col-md-12">
<div class="panel panel-white">
<div class="panel-heading clearfix">
<h4 class="panel-title">Select Date</font>
</h4>
</div>
<div class="panel-body">
<form class="form-inline" method="post">
<div class="form-group">
<label for="date" class="col-sm-4">On Date</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="es_ondate" id="date" placeholder="On Date" value="<?php echo @$es_ondate; ?>" autocomplete="off">
</div>
</div>
<input class="btn btn-info" type="submit" value="Search" name="submit" />
</form>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">Primary Proof Read Questions
<i class="fa fa-info-circle" title="Informations"></i>
</h4>
</div>
<table class="table table-hover">
<tr>
<th>#</th>
<th>Name</th>
<th>Medium</th>
<th>Question Count</th>
</tr>
<?php
$i = 1;
while ($pf = $mDataPf->fetch_assoc()) { ?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $pf['contact_name']; ?></td>
<td><?php echo $pf['medium_name']; ?></td>
<td><a target='_blank' href="nqb_combine_proofread_view.php?uid=<?php echo $pf['editor_id']; ?>&date=<?php echo date('Y-m-d', strtotime($pf['last_proofread_date'])); ?>&t_type=primary"><?php echo $pf['totalpf']; ?></a></td>
</tr>
<?php $i++;
} ?>
</table>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">Secondary Proof Read Questions
<i class="fa fa-info-circle" title="Informations"></i>
</h4>
</div>
<table class="table table-hover">
<tr>
<th>#</th>
<th>Name</th>
<th>Medium</th>
<th>Question Count</th>
</tr>
<?php
$j = 1;
while ($spf = $mDataPfS->fetch_assoc()) { ?>
<tr>
<td><?php echo $j; ?></td>
<td><?php echo $spf['contact_name']; ?></td>
<td><?php echo $spf['medium_name']; ?></td>
<td><a target='_blank' href="nqb_combine_proofread_view.php?uid=<?php echo $spf['editor_id']; ?>&date=<?php echo date('Y-m-d', strtotime($spf['last_proofread_date'])); ?>&t_type=secondary"><?php echo $spf['totalspf']; ?></a></td>
</tr>
<?php $j++;
} ?>
</table>
</div>
</div>
</div>
</div><!-- Main Wrapper -->
<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>
<script type="text/javascript">
var jq = jQuery.noConflict();
jq(document).ready(function() {
jq("#date").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
});
</script>
<div class="page-footer">
<p class="no-s">Graposs Connect ©</p>
</div>
</div><!-- Page Inner -->
<?php
include_once('footer.php');
} else {
echo "<script>alert('You dont have access for transfer');</script>";
echo "<script type='text/javascript'>location.href='/work-sp';</script>";
}
?>