HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/content-sp/work-sp/nqb_questions_proofread_report_translated.php
<?php
include_once('nqb_report_section.php');
// error_reporting(0);
// error_reporting(E_ALL);
// ini_set('display_errors', 'On');

//check edit permissions
$fileName = 'nqb_questions_add_report';
if (in_array($fileName, $pageArray)) {

    $adminId = $editor_id;
    $curDate = date('Y-m-d');

    $SP_MEDIUM = 'csp_sp_medium';
    $SP_EDITORS = 'csp_editors';
    $SP_QUES_HISTORY = 'csp_sp_question_history';

    //editors
    $editors = $conn->query("SELECT editor_id,contact_name FROM $SP_EDITORS where team_id='3' and editor_status='1' order by contact_name");

    /***remove filter */
    if (isset($_REQUEST['remove_filter'])) {
        unset($_SESSION['preadT_subQuery']);
    }

    /**search */
    if(isset($_REQUEST['search_data'])) {
        $es_editor = $_REQUEST['es_editor'];
        $es_ondate = $_REQUEST['es_ondate'];
        $es_fromdate = $_REQUEST['es_fromdate'];
        $es_todate = $_REQUEST['es_todate'];
        $subQuery = '';
        if($es_editor != '') {
            $subQuery .= "and h.action_by='$es_editor' ";
        }
        if($es_ondate !='') {
            $q_date = date('Y-m-d',strtotime($es_ondate));
            $subQuery .= "and date(h.action_date)='$q_date'";
        }
        if($es_fromdate !='' && $es_todate !='') {
            $fromDate = date('Y-m-d',strtotime($es_fromdate));
            $toDate = date('Y-m-d',strtotime($es_todate));
            $subQuery .= "and (date(h.action_date) BETWEEN '$fromDate' AND '$toDate')";
        }
        $_SESSION['preadT_subQuery'] = $subQuery;
    }

    if (!empty($_SESSION['preadT_subQuery'])) {
        $mergeFilter = $_SESSION['preadT_subQuery'];
    } else {
        $mergeFilter = "and date(h.action_date)='$curDate'";
    }

    $getAddData = "SELECT h.question_id,h.action_date,m.medium_name,ed.contact_name FROM $SP_QUES_HISTORY as h LEFT JOIN $SP_MEDIUM as m on m.medium_id=h.medium_id LEFT JOIN $SP_EDITORS as ed on ed.editor_id=h.action_by WHERE h.action IN(3,4) and h.ref_id IS NOT NULL $mergeFilter group by h.question_id,h.medium_id order by h.id";
    $getWorkData = $conn->query($getAddData);
?>
    <style>
        .form-group select {
            height: 34px;
        }

        .modal-backdrop {
            z-index: 999 !important;
        }

        .radio_ans {
            top: -2px;
            left: 11px;
            height: 15px !important;
            width: 25px !important;
            background-color: #eee !important;
            border-radius: 50%;
            position: relative !important;
            opacity: 1 !important;
        }

        select.form-control {
            width: 15em !important;
        }

        table.dataTable {
            font-size: 13px;
        }

        .delWork {
            color: red;
            font-size: 15px;
            cursor: pointer;
            margin-left: 4px;
        }

        .tddd {
            cursor: pointer;
        }
    </style>
    <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>
    <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('#assign_table').dataTable({
                "bPaginate": true,
                bFilter: true,
                "responsive": true,
                "iDisplayLength": 100,
            });
            jq("#date").datepicker({
                changeMonth: true,
                changeYear: true,
                dateFormat : 'dd-mm-yy'
            });
            jq("#todate").datepicker({
                changeMonth: true,
                changeYear: true,
                dateFormat : 'dd-mm-yy'
            });
            jq("#fromdate").datepicker({
                changeMonth: true,
                changeYear: true,
                dateFormat : 'dd-mm-yy'
            });
            jq('.editors-dropdown').select2();
        });
    </script>
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-info">
                <div class="panel-heading clearfix">
                    <h4 class="panel-title">Search Filter</h4>
                </div>
                <div class="spacer"></div>
                <div class="panel-body">
                    <form class="form-horizontal" method="post" onSubmit="return validateForm();">
                        <div class="form-group">
                            <label for="editor" class="col-sm-2">Select Editor</label>
                            <div class="col-sm-10">
                                <select name="es_editor" class="form-control editors-dropdown" id="editor">
                                    <option value="">--Editors--</option>
                                    <?php while ($ms = $editors->fetch_assoc()) { ?>
                                        <option value="<?php echo $ms['editor_id']; ?>" <?php if(@$es_editor == $ms['editor_id']) { echo "selected"; } ?>><?php echo $ms['editor_id'] . '|' . $ms['contact_name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>

                        </div>
                        <div class="form-group">
                            <label for="date" class="col-sm-2">On Date</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="es_ondate" id="date" value="<?php echo @$es_ondate ?>" placeholder="On Date">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="date" class="col-sm-2">From/To Date</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="es_fromdate" id="fromdate" value="<?php echo @$es_fromdate ?>" placeholder="From Date">
                            </div>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="es_todate" id="todate" value="<?php echo @$es_todate ?>" placeholder="To Date">
                            </div>
                        </div>
                        <div class="form-group">
                            <input type="submit" class="btn btn-primary" value="Search" name="search_data">
                        </div>
                    </form>
                    <form class="form-horizontal" method="post">
                        <div class="form-group">
                            <input type="submit" class="btn btn-danger" value="Reset Filter" name="remove_filter">
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-md-12">
            <div class="panel panel-info">
                <div class="panel-heading clearfix">
                    <h4 class="panel-title">Questions ProofRead Data (Translated)</h4>
                </div>
                <div class="spacer"></div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <table id="assign_table" class="display table" style="width: 100%; cellspacing: 0;">
                            <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Ques Id</th>
                                    <th>Medium</th>
                                    <th>Proofread By</th>
                                    <th>Proofread Date</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $i = 1;
                                while ($gwd = $getWorkData->fetch_assoc()) {

                                ?>
                                    <tr>
                                        <td><?php echo $i; ?></td>
                                        <td><?php echo $gwd['question_id']; ?></td>
                                        <td><?php echo $gwd['medium_name']; ?></td>
                                        <td><?php echo $gwd['contact_name']; ?></td>
                                        <td><?php echo $gwd['action_date']; ?></td>
                                    </tr>
                                <?php $i++; } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="page-footer">
        <p class="no-s">Graposs Connect &#169;</p>
        </div>
    </div>
    <?php
} else {
    echo "<script type='text/javascript'>alert('You dont have access to view this report');</script>";
    echo "<script type='text/javascript'>location.href='/work-sp';</script>";
}
include_once('footer.php');
    ?>