File: /var/www/content-sp/work-sp/nqb_individual_assignee_report.php
<?php
include_once('nqb_report_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';
$edData = $conn->query("select e.editor_id,e.editor_login,e.contact_name,e.official_email from $SP_EDITORS as e where e.editor_status='1' and e.team_id='3' order by e.contact_name asc");
if (isset($_POST["submit"]) || $_REQUEST["usrss"]) {
unset($_SESSION["EDTID"]);
$usrss = $_REQUEST["usrss"];
if ($usrss != 0) {
$_SESSION["EDTID"] = $usrss;
}
}
if (isset($_SESSION["EDTID"])) {
$edtId = $_SESSION["EDTID"];
$getData = $conn->query("select e.* from $SP_EDITORS as e where e.editor_id=" . $edtId);
$usr = $getData->fetch_assoc();
}
?>
<link href="assets/plugins/select2/css/select2.min.css" rel="stylesheet">
<script src="assets/plugins/select2/js/select2.min.js"></script>
<script type="text/javascript">
var jq = jQuery.noConflict();
jq(document).ready(function() {
jq('.editors-dropdown').select2();
});
</script>
<div class="row">
<div class="col-md-12">
<div class="panel panel-white">
<div class="panel-body">
<div class="search bg-light">
<form method="POST" data-default="150">
<div class="input-group">
<label class="slabel">Select User</label>
<select name="usrss" id="usrss" class="sselect editors-dropdown">
<option value="0">--user--</option>
<?php while ($ed = $edData->fetch_assoc()) { ?>
<option value="<?php echo $ed['editor_id']; ?>" <?php if (isset($_SESSION['EDTID'])) if ($ed['editor_id'] == $_SESSION["EDTID"]) echo "selected"; ?>><?php echo $ed['editor_id'] . "|" . $ed['editor_login'] . " | " . $ed['contact_name'] . " | " . $ed['official_email']; ?></option>
<?php } ?>
</select>
<span class="input-group-btn">
<button class="btn btn-success" type="submit" name="submit"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php if (isset($_SESSION["EDTID"])) {
# data related to add by selected editor
$questionAdd = "SELECT sq.add_date,count(sq.question_id) as totalAdd FROM $SP_QUESTION as sq where sq.add_by='$edtId' group by cast(sq.add_date as date) order by sq.add_date desc limit 30";
$mData = $conn->query($questionAdd);
$ifAddData = mysqli_num_rows($mData);
# data related to add by selected editor in secondary medium
$questionAddSec = "SELECT sqm.add_date,count(sqm.question_id) as totalAdd FROM $SP_QUESTION_MEDIUM_WISE as sqm where sqm.add_by='$edtId' group by cast(sqm.add_date as date) order by sqm.add_date desc limit 30";
$mDataS = $conn->query($questionAddSec);
$ifAddDataS = mysqli_num_rows($mDataS);
# data related to proofread by selected editor
$questionPfr = "SELECT sq.last_proofread_date,count(sq.question_id) as totalpf FROM $SP_QUESTION as sq where sq.last_proofread_by='$edtId' group by cast(sq.last_proofread_date as date) order by sq.last_proofread_date desc limit 30";
$mDataPf = $conn->query($questionPfr);
$ifPfData = mysqli_num_rows($mDataPf);
# data related to proofread by selected editor in secondary medium
$questionPfrS = "SELECT sqm.last_proofread_date,count(sqm.question_id) as totalpf FROM $SP_QUESTION_MEDIUM_WISE as sqm where sqm.last_proofread_by='$edtId' group by cast(sqm.last_proofread_date as date) order by sqm.last_proofread_date desc limit 30";
$mDataPfS = $conn->query($questionPfrS);
$ifPfSData = mysqli_num_rows($mDataPfS);
// echo $conn->error;
?>
<div class="row">
<?php if ($ifAddData > 0) { ?>
<!---Primry Add Report---->
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">Add Report Primary</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="add_d" class="display table" style="width: 100%;">
<thead>
<tr>
<th>Sno.</th>
<th>Date</th>
<th>Total Question</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach ($mData as $m) {
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo date('d M Y', strtotime($m['add_date'])); ?></td>
<td>
<a target="_blank" href="nqb_combine_questions_view.php?uid=<?php echo $edtId; ?>&date=<?php echo date('Y-m-d', strtotime($m['add_date'])); ?>&t_type=primary">
<?php echo $m['totalAdd']; ?></a>
</td>
</tr>
<?php $i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!---Primry Add Report END---->
<?php } ?>
<?php if ($ifAddDataS > 0) { ?>
<!---Secondary Add Report---->
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">Add Report Secondary</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="add_s_d" class="display table" style="width: 100%;">
<thead>
<tr>
<th>Sno.</th>
<th>Date</th>
<th>Total Question</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach ($mDataS as $m) {
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo date('d M Y', strtotime($m['add_date'])); ?></td>
<td>
<a target="_blank" href="nqb_combine_questions_view.php?uid=<?php echo $edtId; ?>&date=<?php echo date('Y-m-d', strtotime($m['add_date'])); ?>&t_type=secondary">
<?php echo $m['totalAdd']; ?></a>
</td>
</tr>
<?php $i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!---Secondary Add Report END---->
<?php } ?>
</div>
<div class="row">
<?php if ($ifPfData > 0) { ?>
<!---Primry Proofread Report---->
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">Proofread Primary</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="pf_d" class="display table" style="width: 100%;">
<thead>
<tr>
<th>Sno.</th>
<th>Date</th>
<th>Total Question</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach ($mDataPf as $m) {
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo date('d M Y', strtotime($m['last_proofread_date'])); ?></td>
<td><a target='_blank' href="nqb_combine_proofread_view.php?uid=<?php echo $edtId; ?>&date=<?php echo date('Y-m-d', strtotime($m['last_proofread_date'])); ?>&t_type=primary">
<?php echo $m['totalpf'] ?></a></td>
</tr>
<?php $i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
<!---Primry Proofread Report END---->
<?php if ($ifPfData > 0) { ?>
<!---Primry Proofread Report Secondary---->
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">Proofread Secondary</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="pfs_d" class="display table" style="width: 100%;">
<thead>
<tr>
<th>Sno.</th>
<th>Date</th>
<th>Total Question</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach ($mDataPfS as $m) {
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo date('d M Y', strtotime($m['last_proofread_date'])); ?></td>
<td><a target='_blank' href="nqb_combine_proofread_view.php?uid=<?php echo $edtId; ?>&date=<?php echo date('Y-m-d', strtotime($m['last_proofread_date'])); ?>&t_type=secondary">
<?php echo $m['totalpf'] ?></a></td>
</tr>
<?php $i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!---Primry Proofread Report Secondary END---->
<?php } ?>
</div>
<?php } ?>
<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">
jQuery.noConflict();
jQuery(function($) {
$('#add_d').dataTable({
"bPaginate": true,
bFilter: true,
"responsive": true,
"iDisplayLength": 100
});
$('#add_s_d').dataTable({
"bPaginate": true,
bFilter: true,
"responsive": true,
"iDisplayLength": 100
});
$('#pf_d').dataTable({
"bPaginate": true,
bFilter: true,
"responsive": true,
"iDisplayLength": 100
});
$('#pfs_d').dataTable({
"bPaginate": true,
bFilter: true,
"responsive": true,
"iDisplayLength": 100
});
});
</script>
<style>
.table-hover th,
td {
font-size: 13px;
padding: 9px !important;
}
.slabel {
margin-left: 20%;
font-size: 14px;
font-weight: bold;
}
.sselect {
margin: 5px 5px 5px 10px;
width: 40%;
height: 30px;
}
.plscls {
font-size: 16px;
color: #12afcb;
cursor: pointer;
}
.mincls {
font-size: 16px;
color: #ec1937;
cursor: pointer;
}
.lodcls {
height: 25px;
display: block;
background: #018aa0;
margin: -20px 0px 0px -5px;
}
</style>
<?php
include_once('footer.php');
?>