File manager - Edit - /home/autoph/public_html/connectv1/txtblast_on_going.php
Back
<?php include('cfg/db.php'); // include('api/controllers/utility.php'); if(!isset($_SESSION['user']['id'])){ header('location:signin.php'); } // $utility = new Utility(); $granted_company_ids = $utility_class->isNotEmpty($_SESSION['user']['company_permissions_implode']) ? $_SESSION['user']['company_permissions_implode'] : '-1' ; if(!(isset($global_action_permissions['6']['35']) && in_array("1", $global_action_permissions['6']['35']))){ header('location:signin.php'); } //$report_type = "0"; if(isset($_GET['q'])){ $json_params = $db -> base64_url_decode( $db -> escape(trim($_GET['q'])) ); $request_params = json_decode($json_params,true); $params_request_id = $request_params['request_id']; $params_employee_id = $request_params['employee_id']; $params_generate_by_employee_id = $request_params['generate_by_employee_id']; $current_user_employee_id = $_SESSION['user']['id']; // echo "SELECT count(id) FROM report_status WHERE `report_id` = '$report_id' AND `employee_id` = '$current_user_employee_id'"; $q_count = $db -> select("SELECT count(id) FROM request_status WHERE `request_id` = '$params_request_id' AND `employee_id` = '$params_generate_by_employee_id'"); // echo "<script>alert('$params_report_id')</script>"; // echo "SELECT count(id) FROM report_status WHERE `report_id` = '$params_report_id' AND `employee_id` = '$params_generate_by_employee_id'";exit; if($q_count == '0'){ // echo "<script>alert('sada')</script>"; header('location:sms_service_on_going.php'); } } $text_balance = "API not loaded"; // $url = 'https://www.itexmo.com/php_api/apicode_info.php?apicode=PR-AUTOH172111_IE74I'; // $response = (file_get_contents($url)); //Converting in json string // $arr = array(); // $arr = json_decode($response, true); // $text_balance = $arr['Result ']['MessagesLeft']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php echo $variable['site_name']; ?> | SMS Service On Going</title> <!-- Google Font: Source Sans Pro --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"> <!-- Font Awesome --> <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css"> <!-- Theme style --> <link rel="stylesheet" href="dist/css/adminlte.min.css"> <!-- overlayScrollbars --> <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css"> <link href="plugins/bootstrap-table/css/bootstrap-table.min.css" rel="stylesheet"> <!-- daterange picker --> <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css"> <!-- iCheck for checkboxes and radio inputs --> <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css"> <!-- Bootstrap Color Picker --> <link rel="stylesheet" href="plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css"> <!-- Tempusdominus Bootstrap 4 --> <link rel="stylesheet" href="plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css"> <!-- Select2 --> <link rel="stylesheet" href="plugins/select2/css/select2.min.css"> <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css"> <!-- Bootstrap4 Duallistbox --> <link rel="stylesheet" href="plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.css"> <!-- BS Stepper --> <link rel="stylesheet" href="plugins/bs-stepper/css/bs-stepper.min.css"> <!-- dropzonejs --> <link rel="stylesheet" href="plugins/dropzone/min/dropzone.min.css"> <!-- Theme style --> <link rel="stylesheet" href="dist/css/adminlte.min.css"> <!-- overlayScrollbars --> <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css"> <!-- Toastr --> <link rel="stylesheet" href="plugins/toastr/toastr.min.css"> <link href="dist/img/<?php echo $variable['logo']; ?>" rel="icon" /> <style> .form-div { margin-top: 100px; border: 1px solid #e0e0e0; } .overlay { background-color: transparent !important; } #tool{ text-align: left; } #profileDisplay { display: block; height: 160px; width: 160px; margin: 0px auto; border-radius: 50%; } .img-placeholder { width: 160px; color: white; height: 160px; background: black; opacity: .7; border-radius: 50%; z-index: 2; position: absolute; left: 50%; transform: translateX(-50%); display: none; } .img-placeholder h4 { margin-top: 40%; color: white; } .img-div:hover .img-placeholder { display: block; cursor: pointer; } table { cursor: pointer; } table th { cursor: default; } .input-group-append { display: none; } #customer-report select { -webkit-appearance: none; -moz-appearance: none; text-indent: 1px; text-overflow: ''; } #approver-list { pointer-events: none; } #report-date, #report-status, #control-number, #report-type { border-width: 0px; border: none; /* height:20px; */ } #report-status, #report-type { font-weight: bold; } .required-symbol { display: none; } fieldset{ margin-left: 2px; margin-right: 2px; padding-top: 0.35em; padding-bottom: 0.625em; padding-left: 0.75em; padding-right: 0.75em; border: 1px solid gray; border-radius: 3%; } legend{ font-size: 100%; font-weight: bold; color: blue; } .color-palette { height: 35px; line-height: 35px; text-align: right; padding-right: .75rem; } .color-palette.disabled { text-align: center; padding-right: 0; display: block; } .color-palette-set { margin-bottom: 15px; } .color-palette span { display: none; font-size: 12px; } .color-palette:hover span { display: block; } .color-palette.disabled span { display: block; text-align: left; padding-left: .75rem; } .color-palette-box h4 { position: absolute; left: 1.25rem; margin-top: .75rem; color: rgba(255, 255, 255, 0.8); font-size: 12px; display: block; z-index: 7; } </style> </head> <body class="hold-transition sidebar-mini text-sm layout-fixed"> <div class="wrapper"> <!-- Preloader --> <div class="preloader flex-column justify-content-center align-items-center" hidden> <img class="animation__shake" src="dist/img/<?php echo $variable['logo']; ?>" alt="<?php echo $variable['logo']; ?>" height="60" width="60"> </div> <!-- INCLUDE HEADER --> <?php include('include/header.php'); ?> <?php include('include/sidebar.php'); ?> <div class="content-wrapper"> <section class="content-header"> <div class="container-fluid"> <div class="row mb-0"> </div> </div> </section> <section id="on-going-section" class="content"> <div class="container-fluid"> <div class="card card-primary" id="report-list-main"> <div class="card-header"> <h3 class="card-title">SMS Service On Going</h3> </div> <!-- INSERT TABLE HERE --> <div class="card card-default color-palette-box"> <div class="card-body"> <div class="d-flex justify-content-between"> <div class="row"> <div class="border rounded" hidden> <h6><span class="col-sm-2 col-form-label font-weight-bold">SMS Text Balance: <span id="span-balance"></span></span></h6> </div> <input type="button" id="action-button" class="btn btn-primary btn-sm mr-1" value="Action"></input> </div> <div class="row"> <!-- <div class="mr-1"> <span class="align-left col-form-label font-weight-bold">Filter</span> </div> <div class="col-sm-6"> <select name="filter-data-request" id="filter-data-request" class="form-control-sm"> <option value="-1">All Status</option> <option value="0">Pending</option> <option value="1">Approved</option> <option value="2">Declined</option> </select> </div> --> </div> </div> <div id="sms-service-request-list"> <table id="request-status-table" class="table table-sm" data-toggle="table" data-url="" data-pagination="true" data-search="true" data-show-refresh="false" data-show-toggle="false" data-show-columns="false" data-show-columns-toggle-all="false" data-show-export="false" data-side-pagination="server" data-page-list="[10, 25, 50, 100, all]" data-minimum-count-columns="2" data-show-pagination-switch="false" data-pagination="true" data-query-params="queryParams" data-click-to-select="true"> <thead> <tr> <th data-field="id">Request ID</th> <th data-field="control_number">Control Number</th> <th data-field="name">Requested By</th> <th data-field="description">Description</th> <th data-field="date">Date Requested</th> <th data-field="status">Status</th> </tr> </thead> </table> </div> <!--report-list--> </div> <!--card-body--> </div> <!--card--> </div> <!--card card-primary--> <!-- Start Customer Report Information --> <div class="card card-primary" id="customer-report" style="display:none;"> <div class="card-header"> <h3 class="card-title"><button class="btn btn-tool" title="Go to Customer employee list" type="button" onclick="back()"><i class="fas fa-arrow-alt-circle-left fa-2x"></i></button> <span>Requested Information</span></h3> </div><!-- /.card-header --> <div class="overlay" name="loader" style="display:;"> <div class="fas fa-2x fa-sync-alt fa-spin "> </div> <strong><span class="ml-2" id="loading-message"> Fetching data, please wait...</span></strong> </div> <div class="card-body"> <!-- <div class="row"> <div class="col-sm-2">Report ID:</div> <div class="col-sm-2"><?php echo $request_id; ?></div> </div> <div class="row"> <div class="col-sm-2">Control No.:</div> <div class="col-sm-2"><?php echo '0923827323232427824'; ?></div> </div> <div class="row mt-0 mb-0"> <label class="col-sm-3 mt-0 mb-0" style="color:blue;">Control No.:</label> <label class="mt-0 mb-0">0923827323232427824</label> </div>--> <div class="row"> <div class="col-sm-2 mt-0 mb-0"> <label class="mt-0 mb-0" style="color:blue;">Control No.:</label></div> <div class="col-sm-6"><span id="control-number"></span></div> </div> <div class="row"> <div class="col-sm-2"> <label class="mt-0 mb-0" style="color:blue;">Request Date & Time:</label></div> <div class="col-sm-6"><span id="request-date"></span></div> </div> <!-- <div class="form-group mb-1"> <strong><span style="color:blue;">Control No.: </span></strong><span id="control-number"></span> </div> <div class="form-group mb-1"> <strong><span style="color:blue;">Report Date & Time: </span></strong><span id="report-date"></span> </div> <div class="form-group mb-3"> <strong><span style="color:blue;">Status: </span></strong><span id="report-status"></span> </div> --> <?php include('include/components/sms_service/generate_request.php'); ?> <div class="mt-3"> <div class="card"> <div class="card-header"> <h3 class="card-title">Approver</h3> </div> <!-- /.card-header --> <div class="card-body p-0"> <table class="table table-bordered table-hover table-sm" id="approver-list"> <thead> <tr> <th style="width: 20%">Name</th> <th style="width: 5%">Status</th> <th style="width: 15%">Date</th> <th style="width: 60%">Notes</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> <!-- /.card-body --> </div> <div class="row mt-3"> <div class="col-12"> <div class="alert alert-info float-right" role="alert" id="error-alert" style="display:none;"> <span id="error-icon" class="icon fas fa-info"> </span> <span id="alert-message"> Please Select File.</span></a> </div> </div> <div class="col-12"> <form id="print-form"> <span onclick="back()" href="#" class="btn btn-secondary ">Back</span> <input type="hidden" name="request-id" id="request-id" readonly /> <!-- <a href="print-report.php" rel="noopener" target="_blank" class="btn btn-success float-right"><i class="fas fa-print"></i> Print Report</a> --> <!-- <input type="submit" name="submit" id="submit" value="Print Report" class="btn float-right"><i class="fas fa-print"></i> Print Report</input> --> <button type="submit" name="submit" id="submit" class="btn btn-success float-right"> <i class="fas fa-print"></i> View Request </button> </form> </div> </div> </div> <!-- ./card-body --> </div> <!-- ./card-primary --> <!-- End Customer Report Information --> </div><!-- /.container-fluid --> </section> <section id="sending-status-section" class="content" hidden> <div class="container-fluid"> <div class="card card-primary" id="report-list-main"> <div class="card-header"> <h3 class="card-title"><button class="btn btn-tool" title="Go back" type="button" onclick="goBack()"><i class="fas fa-arrow-alt-circle-left fa-2x"></i></button><span>SMS Service Sending Status</span></h3> </div> <!-- INSERT TABLE HERE --> <div class="card card-default color-palette-box"> <div class="card-body"> <div class="mr-1"> <h3><span class="align-middle col-form-label font-weight-bold">Total: <span id="span-total"></span></span></h3> </div> <div class="row"> <div class="col-sm-4 col-md-2"> <h4 class="text-center">ON GOING</h4> <div class="color-palette-set"> <div class="bg-primary color-palette"><span></span></div> <div class="bg-primary disabled color-palette"><span style="font-size: 20px; text-align: center; padding-left: 0px; font-style: bold;" id="span-pending">???</span></div> </div> </div> <div class="col-sm-4 col-md-2"> <h4 class="text-center">SENT</h4> <div class="color-palette-set"> <div class="bg-success color-palette"><span></span></div> <div class="bg-success disabled color-palette"><span style="font-size: 20px; text-align: center; padding-left: 0px; font-style: bold;" id="span-sent">???</span></div> </div> </div> <div class="col-sm-4 col-md-2"> <h4 class="text-center">NOT SENT</h4> <div class="color-palette-set"> <div class="bg-danger color-palette"><span></span></div> <div class="bg-danger disabled color-palette"><span style="font-size: 20px; text-align: center; padding-left: 0px; font-style: bold;" id="span-unsent">???</span></div> </div> </div> <div class="col-sm-6 col-md-4 mb-1 form-group dropdown-input"></div><!--hidden--> <div class="col-sm-6 col-md-2 mb-1 row"> <div class="col-sm-12 float-right"> <select name="filter-status" id="filter-status" class="form-control form-control-sm" style="width: 106%; margin-left: -8px;"> <option value="">All Status</option> <option value="-1">Pending</option> <option value="0">Sent</option> <!--change this to 0 in live, -2 in test--> <option value="1">Unsent</option> </select> </div> <!-- <div id="div-filter-date" class="col-sm-5 mb-1 float-right" style="height: 28px;"> <div class="edit-customer input-group date" data-target-input="nearest"> <input name="filter-date" id="filter-date" placeholder="Filter Date" data-inputmask-alias="datetime" data-inputmask-inputformat="mm/dd/yyyy" data-mask type="text" class="big-letter edit-customer lbl-forms-sm form-control form-control-sm datetimepicker-input" data-target="#filter-date"/> <div class="edit-customer input-group-append" data-target="#filter-date" data-toggle="datetimepicker"> <div id="calendar" class="input-group-text"><i class="fa fa-calendar"></i></div> </div> </div> </div> --> <!-- <div class="col-sm-2 mb-1 form-group dropdown-input"> <input type="submit" name="filter-button" id="filter-button" value="Filter" class="btn btn-secondary btn-sm"> </div> --> </div> </div> <div id="sms-service-sending-list"> <table id="request-sending-table" class="table table-sm" data-toggle="table" data-url="" data-pagination="true" data-search="true" data-show-refresh="false" data-show-toggle="false" data-show-columns="false" data-show-columns-toggle-all="false" data-show-export="false" data-side-pagination="server" data-page-list="[10, 25, 50, 100, all]" data-minimum-count-columns="2" data-show-pagination-switch="false" data-pagination="true" data-query-params="queryParamsSendingList" data-click-to-select="true"> <thead> <tr> <th data-field="cust_id">Customer ID</th> <th data-field="name">Customer</th> <th data-field="mobile_number">Number</th> <th data-field="status">Status</th> </tr> </thead> </table> </div> <br> <!-- <button type="submit" name="print" id="print" class="btn btn-success btn-sm float-right"> <i class="fas fa-print"></i>Print / Generate Report </button> <div> <i class="float-right tooltip-me mt-2 mr-2 mb-0 fas fa-question-circle" style="color:blue; cursor: help;" data-html="true" data-placement="left" id="tip-print" ></i> </div> --> <!--report-list--> </div> <!--card-body--> </div> <!--card--> </div> <!--card card-primary--> <!-- Start Customer Report Information --> <div class="card card-primary" id="customer-report" style="display:none;"> <div class="card-header"> <h3 class="card-title"><button class="btn btn-tool" title="Go to Customer employee list" type="button" onclick="back()"><i class="fas fa-arrow-alt-circle-left fa-2x"></i></button> <span>Requested Information</span></h3> </div><!-- /.card-header --> <div class="overlay" name="loader" style="display:;"> <div class="fas fa-2x fa-sync-alt fa-spin "> </div> <strong><span class="ml-2" id="loading-message"> Fetching data, please wait...</span></strong> </div> <div class="card-body"> <!-- <div class="row"> <div class="col-sm-2">Report ID:</div> <div class="col-sm-2"><?php echo $request_id; ?></div> </div> <div class="row"> <div class="col-sm-2">Control No.:</div> <div class="col-sm-2"><?php echo '0923827323232427824'; ?></div> </div> <div class="row mt-0 mb-0"> <label class="col-sm-3 mt-0 mb-0" style="color:blue;">Control No.:</label> <label class="mt-0 mb-0">0923827323232427824</label> </div>--> <div class="row"> <div class="col-sm-2 mt-0 mb-0"> <label class="mt-0 mb-0" style="color:blue;">Control No.:</label></div> <div class="col-sm-6"><span id="control-number"></span></div> </div> <div class="row"> <div class="col-sm-2"> <label class="mt-0 mb-0" style="color:blue;">Request Date & Time:</label></div> <div class="col-sm-6"><span id="request-date"></span></div> </div> <!-- <div class="form-group mb-1"> <strong><span style="color:blue;">Control No.: </span></strong><span id="control-number"></span> </div> <div class="form-group mb-1"> <strong><span style="color:blue;">Report Date & Time: </span></strong><span id="report-date"></span> </div> <div class="form-group mb-3"> <strong><span style="color:blue;">Status: </span></strong><span id="report-status"></span> </div> --> <?php include('include/components/sms_service/generate_request.php'); ?> <div class="mt-3"> <div class="card"> <div class="card-header"> <h3 class="card-title">Approver</h3> </div> <!-- /.card-header --> <div class="card-body p-0"> <table class="table table-bordered table-hover table-sm" id="approver-list"> <thead> <tr> <th style="width: 20%">Name</th> <th style="width: 5%">Status</th> <th style="width: 15%">Date</th> <th style="width: 60%">Notes</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> <!-- /.card-body --> </div> <div class="row mt-3"> <div class="col-12"> <div class="alert alert-info float-right" role="alert" id="error-alert" style="display:none;"> <span id="error-icon" class="icon fas fa-info"> </span> <span id="alert-message"> Please Select File.</span></a> </div> </div> <div class="col-12"> <form id="print-form"> <span onclick="back()" href="#" class="btn btn-secondary ">Back</span> <input type="hidden" name="request-id" id="request-id" readonly /> <!-- <a href="print-report.php" rel="noopener" target="_blank" class="btn btn-success float-right"><i class="fas fa-print"></i> Print Report</a> --> <!-- <input type="submit" name="submit" id="submit" value="Print Report" class="btn float-right"><i class="fas fa-print"></i> Print Report</input> --> <button type="submit" name="submit" id="submit" class="btn btn-success float-right"> <i class="fas fa-print"></i> View Request </button> </form> </div> </div> </div> <!-- ./card-body --> </div> <!-- ./card-primary --> <!-- End Customer Report Information --> </div><!-- /.container-fluid --> </section> </div> <!--/.content wrapper--> <?php include('include/footer.php'); ?> <aside class="control-sidebar control-sidebar-dark"> </aside> </div> <!-- ./wrapper --> <!-- jQuery --> <script src="plugins/jquery/jquery.min.js"></script> <!-- jQuery UI 1.11.4 --> <script src="plugins/jquery-ui/jquery-ui.min.js"></script> <script> $.widget.bridge('uibutton', $.ui.button) </script> <!-- overlayScrollbars --> <script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script> <!-- Bootstrap 4 --> <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Select2 --> <script src="plugins/select2/js/select2.full.min.js"></script> <!-- Bootstrap4 Duallistbox --> <script src="plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.min.js"></script> <!-- InputMask --> <script src="plugins/moment/moment.min.js"></script> <script src="plugins/inputmask/jquery.inputmask.min.js"></script> <!-- date-range-picker --> <script src="plugins/daterangepicker/daterangepicker.js"></script> <!-- bootstrap color picker --> <script src="plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script> <!-- Tempusdominus Bootstrap 4 --> <script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script> <!-- Bootstrap Switch --> <script src="plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script> <!-- BS-Stepper --> <script src="plugins/bs-stepper/js/bs-stepper.min.js"></script> <!-- dropzonejs --> <script src="plugins/dropzone/min/dropzone.min.js"></script> <!-- bs-custom-file-input --> <script src="plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script> <!-- AdminLTE App --> <script src="dist/js/adminlte.min.js"></script> <!-- jquery-validation --> <script src="plugins/jquery-validation/jquery.validate.min.js"></script> <script src="plugins/jquery-validation/additional-methods.min.js"></script> <!-- Navigation Highlight --> <script src="dist/js/main.js"></script> <!-- Page specific script --> <!-- Toastr --> <script src="plugins/toastr/toastr.min.js"></script> <script src="plugins/bootstrap-table/js/tableExport.min.js"></script> <script src="plugins/bootstrap-table/js/bootstrap-table.min.js"></script> <script src="plugins/bootstrap-table/js/bootstrap-table-en-US.js"></script> <script src="plugins/bootstrap-table/js/bootstrap-table-export.min.js"></script> <!--balloon--> <script src="dist/js/jquery.balloon.min.js"></script> <!--GLOBAL VARIABLES--> <script> var request_id = ""; var filter_status = ""; var clicked_status = -1; var total_balance = '<?php echo $text_balance;?>'; </script> <script> window.addEventListener("hashchange", function(e) { var type = window.location.hash.substr(1); // alert(type) switch (type) { case "request_data": break; default: requestList() } }); function requestList() { $('#request-list-main').fadeIn(); $('#customer-request').fadeOut(); refreshTableCustomer(); function refreshTableCustomer() { var $table = $('#request-status-table') $(function() { $table.bootstrapTable('refresh', { url: 'app/table/request_status.php' }); }) } } function back() { window.history.back(); } function goBack(){ $('#sending-status-section').attr('hidden', true); $('#on-going-section').attr('hidden', false); } function initToolTip(){ var bootstrapTooltip = $.fn.tooltip.noConflict(); $.fn.bstooltip = bootstrapTooltip; $('.tooltip-me').bstooltip(); } </script> <script> $('#filter-status').change(function(){ filter_status = $('#filter-status').val(); if(clicked_status != 3){ $('#print').attr('disabled', true); } else { if(filter_status == -1){ $('#print').attr('disabled', true); } else if($('#filter-status option:selected').text() == "Unsent"){ if(parseInt($('#span-unsent').text()) > 0){ $('#print').attr('disabled', false); } else { $('#print').attr('disabled', true); } } else { $('#print').attr('disabled', false); } } var $table = $('#request-sending-table') $(function() { $table.bootstrapTable('refresh', { url: 'app/table/sending_status.php' }); }) }); </script> <script> $('#print').on('click', function(){ var count = 0; if(filter_status == 0){ //change to 0 when in live, -2 when testing; sent count = $('#span-sent').text(); } else if(filter_status == -1){ //pending toastr.remove(); toastr.error("Request is closed. No pending status"); return; } else if(filter_status == 1){ //unsent count = $('#span-unsent').text(); } else if(filter_status == ""){ //All count = $('#span-total').text(); } $.ajax({ url: "print_sms_service_record.php", method: "POST", dataType: "json", //cache: false, data: { request_id: request_id, filter_status: filter_status, count: count }, success: function(result){ if(result.status != 1){ toastr.remove(); toastr.error(result.message); } else { toastr.remove(); toastr.success(result.message); window.open('pdf_sms_service.php?token=' + result.file + '&downloadable=1', '_blank', 'noreferrer'); } } }); }); </script> <script> $("#print-form").submit(function(event) { //do validatons event.preventDefault(); // var report_id = $("#report-id").val(); // alert(report_id);return; // window.open('print_report.php?q='+report_id, '_blank', 'noreferrer'); // return; //logic //if report employee_id not equal to user employee id //if report id not in user employee id $.ajax({ url: "print_request.php", data: new FormData(this), type: "POST", dataType: 'json', contentType: false, cache: false, processData: false, beforeSend: function() { toastr.remove(); toastr.info("Generating request, please wait..."); $('#submit').attr('disabled', true); }, success: function(result) { //console.log(result.status + " " + result.message); if (result.status != 1) { toastr.remove(); toastr.error(result.message); } else { //success toastr.remove(); toastr.success(result.message); window.open('pdf_sms_service.php?token=' + result.file, '_blank', 'noreferrer'); } $('#submit').attr('disabled', false); }, error: handleError }); }); function handleError(xhr, status, error) { toastr.remove(); toastr.error("Something went wrong, try again."); } </script> <script> function requestList() { $('#request-list-main').fadeIn(); $('#customer-request').fadeOut(); } </script> <script> $(document).ready(function() { // report-field initToolTip(); $('#span-balance').text(total_balance); $(".request-field").prop("disabled", true); $(".request-field").css("background-color", "white"); $('#tip-print').attr('data-original-title', "<div id='tool' class=''>- You can only print/generate report when Request is closed (no pending)<br>- Print result is based on status selected (except pending)<div>"); $('#filter-data-request').on('change', function(event) { filter_status = $('#filter-status').val(); refreshRequestTable(); }); $('#sending-status-section').attr('hidden', true); // refreshTableCustomer() old refreshRequestTable(); function refreshRequestTable() { var $table = $('#request-status-table') $(function() { $table.bootstrapTable('refresh', { url: 'app/table/request_status.php' }); }) } function refreshSendingTable() { // alert("hi"); var $table = $('#request-sending-table') $(function() { $table.bootstrapTable('refresh', { url: 'app/table/sending_status.php' }); }) } function statusFormatter(value, row, index) { if (row.status == 1) { return '<input id="' + row.employee_id + '" class="status" name="status" type="checkbox" checked>'; } else { return '<input id="' + row.employee_id + '" class="status" name="status" type="checkbox">'; } } function imageFormatter(value, row, index) { return '<a class="pic" href="#"><img width="50px" height="50px" class="user-image img-circle elevation-2" src="dist/img/' + value + '" /></a>'; } window.statusEvents = { 'click :checkbox': function(e, value, row, index) { var employee_id = row.employee_id; $.ajax({ url: "app/employee/status.php", method: "POST", data: { employee_id: employee_id }, success: function(data) { //alert(data); //window.location.reload(); } }); } }; }); </script> <script> function queryParams(params) { var filter_data = $("#filter-data-request").val(); return { search: params.search, offset: params.offset, limit: params.limit, filter_status: filter_status }; } function queryParamsSendingList(params) { var filter_data = $("#filter-data-request").val(); return { search: params.search, offset: params.offset, limit: params.limit, filter_data: request_id, filter_status: filter_status, type: 1 //table }; } </script> <?php if(isset($_GET['q'])){ ?> <script> $(document).ready(function() { var params_request_id = '<?php echo $params_request_id;?>'; var params_employee_id = '<?php echo $params_employee_id;?>'; var params_generate_by_employee_id = '<?php echo $params_generate_by_employee_id;?>'; $.ajax({ url: "app/sms_service/sms_service_information.php", method: "POST", dataType: 'json', data: { request_id: params_request_id, params_generate_by_employee_id: params_generate_by_employee_id, params_employee_id: params_employee_id }, beforeSend: function() { cleanFields(); }, success: function(result) { fetchRequestData(result); } }); }); function removeBtnClass() { $('#submit').removeClass("btn-warning"); $('#submit').removeClass("btn-danger"); $('#submit').removeClass("btn-success"); } function refreshNotification() { $.ajax({ url: "app/misc/refresh_notification.php", method: "POST", dataType: 'json', data: { type: 1 }, success: function(result) { // alert(result.count) $("#notification-count").text(result.count); $("#notification-count-sub").text(result.sub_count); $("#notification-content").html(result.data); } }); } </script> <?php } ?> <script> $('#request-status-table').on('click-cell.bs.table', function(field, value, row, $el) { //window.location.hash = 'request_data'; request_id = $el.id; clicked_status = $el.status_id; // refreshSendingTable(); var $table = $('#request-sending-table') $(function() { $table.bootstrapTable('refresh', { url: 'app/table/sending_status.php' }); }) $.ajax({ url: "app/table/sending_status.php", method: "GET", dataType: 'json', data: { request_id: request_id, type: 2 // get data for counting }, success: function(result) { if(result.request_status != 3){ $('#print').attr('disabled', true); } else { $('#print').attr('disabled', false); } $('#span-sent').text(result.count_sent); $('#span-pending').text(result.count_pending); $('#span-unsent').text(result.count_unsent); $('#span-total').text(result.count_total); } }); $('#sending-status-section').attr('hidden', false); $('#on-going-section').attr('hidden', true); }); function removeBtnClass() { $('#submit').removeClass("btn-warning"); $('#submit').removeClass("btn-danger"); $('#submit').removeClass("btn-success"); } function refreshNotification() { $.ajax({ url: "app/misc/refresh_notification.php", method: "POST", dataType: 'json', data: { type: 1 }, success: function(result) { // alert(result.count) $("#notification-count").text(result.count); $("#notification-count-sub").text(result.sub_count); $("#notification-content").html(result.data); } }); } function cleanFields() { $('#state').val('0').trigger('change'); $('#city').val('0').trigger('change'); $('#company').val('0').trigger('change'); $('#dealer').val('0').trigger('change'); $('#dms').val('0').trigger('change'); $('#type').val('0').trigger('change'); $('#filter-data').val('0').trigger('change'); $('#gender').val('0').trigger('change'); $('#brand').val('0').trigger('change'); $('#model').val('0').trigger('change'); $("#reg-from").val(''); $("#reg-to").val(''); $("#age-from").val(''); $("#age-to").val(''); $("#upload-from").val(''); $("#upload-to").val(''); $("#upload-by").val(''); $("#message-content").val(''); $("#request-date").text(''); $("#control-number").text(''); $("#request-status").text(''); $("#request-type").text(''); // $('#error-alert').fadeOut(); $('#report-list-main').fadeOut(); $('#customer-report').fadeIn(); } function fetchRequestData(result) { <?php //include('include/components/reports/report_field_mgmt.php'); ?> $("#request-id").val(result.id); $("#control-number").text(result.control_number); $("#request-date").text(result.request_date); $("#request-by-user").text(result.request_by_user); $("#employee-id").val(result.employee_id); if(result.customer_type == 0){ $('#customer-type').text("All"); } else if(result.customer_type == 1){ $('#customer-type').text("Individual"); } else if(result.type == 2){ $('#customer-type').text("Corporation"); } $('#filter-data').val(result.customer_data_type).trigger('change'); if(result.gender == ""){$('#gender').text("All");}else{$('#gender').text(result.gender)}; $("#date-range").text(result.activity_date_from + " to " + result.activity_date_to); $("#age-range").text(result.age_from + " to " + result.age_to); $("#upload-date-range").text(result.uploaded_date_from + " to " + result.uploaded_date_to); $("#order-by").text(result.order_by); if(result.is_downloadable == 0){$('#is-downloadable').text("Read only");}else{$('#is-downloadable').text("Downloadable");} if(result.sort_by == 1){ $('#sort-by').text("Lastname (Individual)"); } else if(result.sort_by == 2){ $('#sort-by').text("Firstname (Individual)"); } else if(result.sort_by == 3){ $('#sort-by').text("Name (Corporation)"); } else if(result.sort_by == 4){ $('#sort-by').text("Date created"); } else if(result.sort_by == 5){ $('#sort-by').text("Date uploaded"); } // $("#date-of-birth").val(result.date_of_birth); if(result.customer_category == "System Decided"){$('#customer-category').text("All");}else{$('#customer-category').text(result.customer_category);} $('#active-status').text(result.customer_status); // if (result.order_by == 'ASC') { // $("#rdo-asc").prop("checked", true); // } else if (result.order_by == 'DESC') { // $("#rdo-desc").prop("checked", true); // } // if (result.is_downloadable == '1') { // $("#rdo-dl-yes").prop("checked", true); // } else if (result.is_downloadable == '0') { // $("#rdo-dl-no").prop("checked", true); // } // alert(result.upload_by_employee_id); // $("#upload-by").val(result.upload_by_employee_id); $("#upload-by").text(result.upload_by_employee_id); $("#message-content").val(result.message_content); // $('#city').val(result.city_id).trigger('change'); // $('#company').val(result.company_id).trigger('change'); $("#company").text(result.company_id); $("#dealer").text(result.dealer_id); if(result.brand == ""){$('#brand').text("All");}else{$("#brand").text(result.brand);} $("#model").text(result.model_id); if(result.variant == ""){$('#variant').text("All");}else{$("#variant").text(result.variant);} if(result.insurance_company == ""){$('#insurance-company').text("All");}else{$('#insurance-company').text(result.insurance_company);} if(result.insurance_type == ""){$('#insurance-type').text("All");}else{$('#insurance-type').text(result.insurance_type);} if(result.finance_company == ""){$('#financing-company').text("All");}else{$('#financing-company').text(result.finance_company);} // selected_model_name = result.model_name; if(result.dms == ""){$('#dms').text("All");}else{$('#dms').text(result.dms);} if(result.state == ""){$('#state').text("All");}else{$('#state').text(result.state);} setTimeout(function() { if(result.city == ""){$('#city').text("All");}else{$('#city').text(result.city);} // alert(result.model_name) // $('#model').val(result.model_name).trigger('change'); }, 1000); $('#approver-list > tbody').html(''); $('#approver-list').find('tbody').append(result.approver_list); if (result.request_status == 3) { // $("#submit").val('Print Report'); $(':submit').css("display", "none"); $(':submit').css("cursor", "no-drop"); $(":submit").attr("disabled", true); $('#note-area').css("display", "none"); $('#success-alert').css("display", "none"); $('#request-status').css("color", "red"); $("#request-status").text('EXPIRED'); } else if (result.request_status == 2) { // $("#submit").val('Print Report'); $(':submit').css("display", "none"); $(':submit').css("cursor", "no-drop"); $(":submit").attr("disabled", true); $('#note-area').css("display", "none"); $('#success-alert').css("display", "none"); $('#request-status').css("color", "red"); $("#request-status").text('DECLINED'); } else if (result.request_status == 1) { // $("#submit").val('Print Report'); $(':submit').css("display", "none"); $(':submit').css("cursor", "no-drop"); $(":submit").attr("disabled", true); $('#note-area').css("display", "none"); $('#success-alert').css("display", "none"); $('#request-status').css("color", "green"); $("#request-status").text('APPROVED'); } else { // $("#submit").val('Print Report'); // $(':submit').css("display","none"); // $(':submit').css("cursor","no-drop"); // $(':submit').addClass("btn-warning"); // $(":submit").attr("disabled", true); if (result.current_user_status) { $(':submit').css("display", "none"); $(':submit').css("cursor", "no-drop"); $(":submit").attr("disabled", true); $('#note-area').css("display", "none"); $('#success-alert').css("display", "none"); } else { $(':submit').css("display", ""); $(':submit').css("cursor", "pointer"); $(":submit").attr("disabled", false); $('#note-area').css("display", ""); $('#success-alert').css("display", "none"); $('#request-status').css("color", "orange"); $("#request-status").text('PENDING'); } } //refreshNotification() $('.overlay').fadeOut(); } </script> <script> $(document).ready(function() { $('#state').on('change', function(event) { event.preventDefault(); var state_id = this.value; $.ajax({ url: "app/misc/get_city.php", method: "POST", data: { state_id: state_id }, cache: false, beforeSend: function() { $('#city').attr('disabled', true); }, success: function(data) { $("#city").html('<option value="0" selected>All</option>' + data); // $('#city').attr('disabled', false); } }) }); }); </script> <script> $(document).mouseup(function(e) { var container = $("#action-button"); // if the target of the click isn't the container nor a descendant of the container if (!container.is(e.target) && container.has(e.target).length === 0) { container.hideBalloon(); shown = !shown; } }); </script> <script> var shown = true; $(function() { $('#action-button').on("click", function() { shown ? $(this).hideBalloon() : $(this).showBalloon(); shown = !shown; }).showBalloon({ position: 'right', html: true, css: { color: 'black' }, contents: ` <div class=""> <div class="col-sm-4 p-1"> <input style="width: 120px !important;" type="button" id="new-request-button" onclick="newRequest()" class="btn btn-primary btn-sm" value="Create Request"></input> </div> <div class="col-sm-4 p-1"> <input style="width: 120px !important;" type="button" onclick="requestList()" id="request-list" class="btn btn-primary btn-sm" value="My Request List"></input> </div> </div> ` }); $('#action-button').hideBalloon(); shown = !shown; }); </script> <script> function initToolTip() { var bootstrapTooltip = $.fn.tooltip.noConflict(); $.fn.bstooltip = bootstrapTooltip; $('.tooltip-me').bstooltip(); } </script> <script> function newRequest() { window.location.href = "new_sms_service.php?create=1"; } function approvalPage() { window.location.href = "request_approval.php"; } function requestList() { window.location.href = "requested_sms_service.php"; } </script> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings