File manager - Edit - /home/autoph/public_html/tasks/resources.tar
Back
views/ltms/ltms_view.php 0000644 00000311561 15025010632 0011403 0 ustar 00 <?php include('cfg/db.php'); include_once("api/controllers/utility.php"); // include('app/security/security.php'); if (!isset($_SESSION['user']['id'])) { header('location:signin.php'); } $utility = new Utility(); $granted_company_ids = $utility->isNotEmpty($_SESSION['user']['company_permissions_implode']) ? $_SESSION['user']['company_permissions_implode'] : '-1'; if (!(isset($global_action_permissions['12']['1']) && in_array("1", $global_action_permissions['12']['1']))) { header('location:signin.php'); } $dealer_id = $_SESSION['user']['dealer']; $utility = new Utility(); $granted_company_ids = $utility->isNotEmpty($_SESSION['user']['company_permissions_implode']) ? $_SESSION['user']['company_permissions_implode'] : '-1'; $employee_id = $_SESSION['user']['employee_id']; // if (!isset($_REQUEST['q']) && !$is_admin) { // header('location:signin.php'); // } $ref_num_header ='';// ($is_admin ? '' : $_REQUEST['q']); if (isset($global_action_permissions['22']['55']) && in_array("4", $global_action_permissions['11']['55'])) { $has_force_edit_permission = 1; } else { $has_force_edit_permission = 0; } ?> <!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']; ?> | LTMS</title> <!-- <script src="dist/js/filter.js"></script> --> <!-- 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"> <!-- Default style --> <link rel="stylesheet" href="dist/css/default.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"> <link href="dist/img/<?php echo $variable['logo']; ?>" rel="icon" /> <!-- Ekko Lightbox --> <link rel="stylesheet" href="plugins/ekko-lightbox/ekko-lightbox.css"> <!-- SweetAlert2 --> <link rel="stylesheet" href="plugins/sweetalert2/sweetalert2.min.css"> <!-- Toastr --> <link rel="stylesheet" href="plugins/toastr/toastr.min.css"> <!-- STARTMULTI --> <link rel="stylesheet" href="dist/css/bootstrap-multiselect.css" type="text/css"> <style> #customer-modal-tab .nav-link.active, .nav-item.active { color: rgb(0 123 255); border-bottom: 1px solid rgb(0 123 255) !important; } .custom-badge { padding: .30em .4em; position: absolute; top: 9px; font-weight: 500; line-height: 0.6; } #children-list-table .bootstrap-datetimepicker-widget { position: relative !important; /* height: 200px; */ top: 0px !important; } .fixed-table-width { table-layout: fixed; width: 100px; } .fixed-table-width td { /* border: 1px solid green; */ overflow: hidden; } /* Chrome, Safari, Edge, Opera */ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } /* Firefox */ input[type=number] { -moz-appearance: textfield; } .no-border-card { box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, 0); } .big-letter { text-transform: uppercase; } /* .nav-link.active { font-weight: bold; } */ .badge { font-size: 85%; } table.fixed { table-layout: fixed; } table.fixed td { overflow: hidden; } .hidden { display: none; } .btnRemove { display: visible; } table { cursor: pointer; } table th { cursor: default; } .form-div { margin-top: 100px; border: 1px solid #e0e0e0; } #profileDisplay { display: block; height: 160px; width: 160px; margin: 0px auto; border-radius: 50%; } .blue-color { color: blue; } .tab1 { tab-size: 4; } .img-placeholder { width: 160px; color: white; height: 160px; background: none; 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; } 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: 16px; font-weight: bold; color: blue; } .lbl { font-size: 90%; font-weight: normal !important; } .input { font-size: 90%; font-weight: normal !important; background-color: white !important; } .lbl-forms { font-size: 90%; font-weight: bold; } .lbl-forms-sm { font-size: 90%; height: 28px !important; } .input-forms { font-size: 95%; font-weight: normal !important; background-color: white !important; } .span-labels { font-size: 90%; font-style: italic; } .span-values { font-size: 90%; } table { font-size: 90%; } .list-group-item { padding: .25rem .50rem; } .edit-customer { height: 70%; } #customer-table.loading tbody { position: relative; } #sales-table.loading tbody { position: relative; } #customer-table.loading tbody:after { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #fff; /* background-color: rgba(0, 0, 0, 0.1); */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARUAAAAjCAYAAAC6up7mAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAfxUlEQVR4Xu1cCVhTV/Z/T9BgLEGtODpCLVtrREsAS8QloDaoFdSKtUOsDrj8xeqIy+AKtR1caW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CZgqYKWCmgJkCZgqYKfDIUuD/AbpaKcEM9/FgAAAAAElFTkSuQmCC); background-position: center; background-repeat: no-repeat; background-size: 277px 35px; font-weight: bold; content: ""; } .carousel-control-prev-icon { background-color: #007bff; /* Blue background for the previous arrow */ border-radius: 50%; /* Make the arrow circular */ } .carousel-control-next-icon { background-color: #28a745; /* Green background for the next arrow */ border-radius: 50%; /* Make the arrow circular */ } /* Optional: Change color on hover */ .carousel-control-prev:hover .carousel-control-prev-icon { background-color: #0056b3; /* Darker blue on hover */ } .carousel-control-next:hover .carousel-control-next-icon { background-color: #218838; /* Darker green on hover */ } </style> </head> <body class="hold-transition sidebar-mini text-sm layout-fixed"> <!-- body class="hold-transition sidebar-mini text-sm" oncopy = 'return false' oncut = 'return false' onselectstart = 'return false' > --> <div class="wrapper"> <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'); ?> <!-- Content Wrapper. Contains page content --> <div id="upper" class="content-wrapper"> <!-- START --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md mt-3" > <div id="table" class="card card-primary"> <div class="card-header"> <h3 class="card-title" ><a href="#"><i class="fa fa-backward" aria-hidden="true" onclick="goBack();" style="text-decoration:none;"> Back </i></a> | Customer SALES & LTMS</h3> </div> <div class="card"> <div class="card-body"> <div class="row"> <!-- Customer Table --> <div id="customer-list" class="col-md-6 col-lg-6 col-sm-12 customer-list"> <div class="card shadow-sm mb-4"> <div class="card-header bg-primary text-white text-center"> <h5 class="mb-0">LTMS Upload</h5> </div> <div class="card-body p-0"> <div class="container-fluid"> <!-- First row: Company, Dealer, Filter button --> <div class="row align-items-center p-1"> <div class="col-md-5"> <div class="d-flex align-items-center"> </div> </div> <div class="col-md-6"> <?php if (isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])) { ?> <div class="mr-3 d-flex align-items-center"> <label for="cs_status" class="form-label mr-2 mb-0">Status</label> <select id="cs_status" class="form-control"> <option value=""> ALL</option> <option value="1">W/ CS NUMBER</option> <option value="2">W/O CS NUMBER</option> </select> </div> <?php } ?> </div> <div class="col-md-1 text-right"> <?php if (isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])) { ?> <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#filterModal" title="Filter"> <i class="fa fa-filter" aria-hidden="true"></i> </button> <?php } ?> </div> </div> </div> <?php /* <div class="d-flex justify-content-between align-items-center p-2"> <!-- Export buttons next to the search box --> <div class="export-buttons ml-auto"> <label></label> <select id="cs_status" class="form-control"> <option value="1">W/ CS NUMBER</option> <option value="0">W/O CS NUMBER</option> </select> <?php if(isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])){ ?> <div class="btn-group"> <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#filterModal" title="Filter"> <i class="fa fa-filter" aria-hidden="true"></i> </button> </div> <?php } ?> <!-- Modal --> <div class="modal fade" id="filterModal" tabindex="-1" role="dialog" aria-labelledby="filterModalLabel" aria-hidden="true" data-backdrop="static"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="filterModalLabel">Report</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <!-- <div class="form-group"> <input type="button" class="btn btn-primary btn-sm form-control" name="btnCustomerListNoFilter" id="btnCustomerListNoFilter" value="No Filter"> </div> --> <div class="form-group"> <label for="filter-start-date">Start Date:</label> <input type="date" value="<?=date('Y-m-d')?>" id="date_from_ltms" class="form-control datepicker" id="filter-start-date" name="filter-start-date" placeholder="Select start date"> </div> <div class="form-group"> <label for="filter-end-date">End Date:</label> <input type="date" value="<?=date('Y-m-d')?>" id="date_to_ltms" class="form-control datepicker" id="filter-end-date" name="filter-end-date" placeholder="Select end date"> </div> <!-- Progress Bar --> <div class="progress my-3"> <div id="data-fetch-progress" class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div> </div> <!-- Export to Excel Button --> <button id="export-customer-excel" class="btn btn-sm btn-success"> <i class="fas fa-file-excel"></i> Excel </button> <!-- Export to PDF Button --> <button id="export-customer-pdf" class="btn btn-sm btn-danger"> <i class="fas fa-file-pdf"></i> PDF </button> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" id="btn-close-modal" data-dismiss="modal">Close</button> <button type="button" id="generate-btn" class="btn btn-primary" id="apply-filters">generate report</button> </div> </div> </div> </div> <!-- END MODAL FILTER --> </div> </div> */?> <div class="d-flex justify-content-between align-items-center p-2"> <!-- Export buttons next to the search box, floated to the right --> <div class="d-flex align-items-center ml-auto"> <?php /* if (isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])) { ?> <div class="btn-group"> <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#filterModal" title="Filter"> <i class="fa fa-filter" aria-hidden="true"></i> </button> </div> <?php } */?> </div> <!-- Modal --> <div class="modal fade" id="filterModal" tabindex="-1" role="dialog" aria-labelledby="filterModalLabel" aria-hidden="true" data-backdrop="static"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="filterModalLabel">Report</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="form-group"> <label for="cs_status" class="form-label mr-2 mb-0">Status</label> <select id="cs_number_status" class="form-control"> <option value=""> </option> <option value="1">W/ CS NUMBER</option> <option value="2">W/O CS NUMBER</option> </select> </div> <div class="form-group"> <label for="filter-start-date">Start Date:</label> <input type="date" value="<?=date('Y-m-d')?>" id="date_from_ltms" class="form-control datepicker" name="filter-start-date" placeholder="Select start date"> </div> <div class="form-group"> <label for="filter-end-date">End Date:</label> <input type="date" value="<?=date('Y-m-d')?>" id="date_to_ltms" class="form-control datepicker" name="filter-end-date" placeholder="Select end date"> </div> <!-- Progress Bar --> <div class="progress my-3"> <div id="data-fetch-progress" class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div> </div> <!-- Export to Excel Button --> <button id="export-customer-excel" class="btn btn-sm btn-success"> <i class="fas fa-file-excel"></i> Excel </button> <!-- Export to PDF Button --> <button id="export-customer-pdf" class="btn btn-sm btn-danger"> <i class="fas fa-file-pdf"></i> PDF </button> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" id="btn-close-modal" data-dismiss="modal">Close</button> <button type="button" id="generate-btn" class="btn btn-primary">Generate Report</button> </div> </div> </div> </div> </div> <!-- Table Content --> <table id="customer-table" class="table table-bordered table-hover table-sm mb-0" data-query-params="queryParams" data-search="true" data-pagination="true"> <thead class="thead-light"> <tr> <th data-field="reference_code" style="text-align: center;">Ref. Code</th> <th data-field="customer_name" style="text-align: center;">Name</th> <th data-field="cs_number">CS Number</th> <th data-field="date_uploaded" style="text-align: center;">Date uploaded</th> <th data-field="file" style="text-align: center;">File</th> <th data-field="action_tag" style="text-align: center;">Action</th> </tr> </thead> <tbody> <!-- Dynamic Content --> </tbody> </table> </div> <div class="card-footer text-center"> <nav aria-label="Customer Page Navigation"> <ul class="pagination justify-content-center m-0" id="customer-grid-data-paging"> <!-- Pagination Links --> </ul> </nav> </div> </div> </div> <!-- Sales Table --> <div class="col-md-6 col-lg-6 col-sm-12 sales-table"> <div class="card shadow-sm mb-4"> <div class="card-header bg-success text-white text-center"> <h5 class="mb-0">Sales</h5> </div> <div class="card-body p-0"> <div class="container-fluid"> <!-- First row: Company, Dealer, Filter button --> <div class="row align-items-center p-1"> <div class="col-md-5"> <div class="d-flex align-items-center"> <label for="company_sales" class="mr-2 my-2">Company:</label> <select class="form-control form-control-sm company_sales" id="company_sales"> <?php $where_company =" AND id IN(".$granted_company_ids.") "; if(isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])){ $where_company =''; ?> <option value="">Select Company</option> <?php } ?> <?php $company_id_array =[]; // if no access to report generation $company_query = $db->connect()->query("SELECT id, code, name FROM source_company WHERE status = 1 $where_company ORDER BY name"); if ($company_query->num_rows > 0) { foreach ($company_query as $company) { $company_id_array[] = $company['id']; ?> <option value="<?= $company['id'] ?>"><?= $company['code'].' - '.substr($company['name'], 0, 20) ?>..</option> <?php } } ?> </select> </div> </div> <div class="col-md-5"> <div class="d-flex align-items-center"> <label for="dealer_sales" class="mr-2 my-2">Dealer:</label> <?php if(isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])){ ?> <select class="form-control form-control-sm dealer_sales" id="dealer_sales"> <option value="">Select Dealer</option> </select> <?php } else { ?> <select class="form-control form-control-sm dealer_sales" id="dealer_sales"> <option value="">Select Dealer</option> <?php $dealer_query = $db->connect()->query("SELECT scd.company_id,scd.dealer_id,sc.code as comp_code,sd.id as did,sd.code,sd.name,sd.status FROM source_company_dealer AS scd JOIN source_dealer as sd ON scd.dealer_id = sd.id JOIN source_company as sc on scd.company_id = sc.id WHERE scd.company_id IN(".implode(',',$company_id_array).") GROUP BY sd.id ORDER BY sd.name"); if ($dealer_query->num_rows > 0) { foreach ($dealer_query as $dealer) { ?> <option value="<?= $dealer['did'] ?>"><?= $dealer['comp_code'].' - '. $dealer['code'].' - '.substr($dealer['name'], 0, 20) ?>..</option> <?php } } ?> </select> <?php }//end else ?> </div> </div> <div class="col-md-2 text-right"> <?php if(isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])){ ?> <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#filterModalSales" title="Filter"> <i class="fa fa-filter" aria-hidden="true"></i> </button> <?php } ?> </div> </div> <!-- Second row: Date range and LTMS status --> <div class="row align-items-center p-1"> <div class="col-md-4"> <div class="form-group"> <label for="from-date" class="mr-2">From:</label> <input type="date" value="" id="from-date" class="form-control form-control-sm"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="to-date" class="mr-2">To:</label> <input type="date" id="to-date" class="form-control form-control-sm"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="ltms-filter" class="mr-2">LTMS Status:</label> <select id="ltms-filter" class="form-control form-control-sm"> <option value="">All</option> <option value="1">Uploaded</option> <option value="0">No LTMS</option> </select> </div> </div> </div> </div> <!-- Modal --> <div class="modal fade" id="filterModalSales" tabindex="-1" role="dialog" aria-labelledby="filterModalLabel" aria-hidden="true" data-backdrop="static"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="filterModalLabel">Report Generation</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="d-flex align-items-center mb-3"> <label for="company_sales" class="mr-2 my-2">Company:</label> <select class="form-control form-control-sm company_sales" id="company_sales_report"> <?php $where_company =" AND id IN(".$granted_company_ids.") "; if(isset($global_action_permissions['12']['2']) && in_array("1", $global_action_permissions['12']['2'])){ $where_company =''; // if(in_array($employee_role_id,[1,41,42,126,183,132,150,181])){ ?> <option value="">Select Company</option> <?php } ?> <?php $company_query = $db->connect()->query("SELECT id, code, name FROM source_company WHERE status = 1 $where_company ORDER BY name"); if ($company_query->num_rows > 0) { foreach ($company_query as $company) { ?> <option value="<?= $company['id'] ?>"><?= $company['code'].' - '.substr($company['name'], 0, 20) ?>..</option> <?php } } ?> </select> </div> <div class="d-flex align-items-center mb-3"> <label for="ltms-filter" class="mr-2">Dealer:</label> <select class="form-control form-control-sm dealer_sales" id="dealer_sales_report"> <option value="">Select Dealer</option> </select> </div> <div class="d-flex align-items-center mb-3"> <label for="ltms-filter" class="mr-2">LTMS Status:</label> <select id="ltms-filter-sales" class="form-control form-control-sm"> <option value="">All</option> <option value="1">Uploaded</option> <option value="0">No LTMS</option> </select> </div> <div class="form-group"> <label for="filter-start-date">Start Date:</label> <input type="date" value="<?=date('Y-m-d')?>" id="date_from_ltms_sales" class="form-control datepicker" id="filter-start-date" name="filter-start-date" placeholder="Select start date"> </div> <div class="form-group"> <label for="filter-end-date">End Date:</label> <input type="date" value="<?=date('Y-m-d')?>" id="date_to_ltms_sales" class="form-control datepicker" id="filter-end-date" name="filter-end-date" placeholder="Select end date"> </div> <!-- Progress Bar --> <div class="progress my-3"> <div id="data-fetch-progress-sales" class="progress-bar bg-success" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div> </div> <!-- Export to Excel Button --> <button id="export-sales-excel" class="btn btn-sm btn-success"> <i class="fas fa-file-excel"></i> Excel </button> <!-- Export to PDF Button --> <button id="export-sales-pdf" class="btn btn-sm btn-danger"> <i class="fas fa-file-pdf"></i> PDF </button> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" id="btn-close-modal-sales" data-dismiss="modal">Close</button> <button type="button" id="generate-btn-sales" class="btn btn-primary" id="apply-filters">generate report</button> </div> </div> </div> </div> <!-- END MODAL FILTER --> </div> </div> <table id="sales-table" class="table table-bordered table-hover table-sm mb-0" data-query-params="queryParamsSales" data-search="true" data-pagination="true"> <!-- <table id="sales-table" data-search="true" data-custom-search="customSearch" data-buttons="buttonsFunction" data-url="" class="table table-bordered table-hover table-sm mb-0" data-query-params="queryParamsSales" data-search="true" data-pagination="true"> --> <thead class="thead-light"> <tr> <th data-field="company_dealer" data-sortable="false" style="text-align: center;">Dealer</th> <th data-field="sales_customer_name" data-sortable="false" style="text-align: center;">Name</th> <th data-field="mobile_phone_1" data-sortable="false" style="text-align: center;">Mobile</th> <th data-field="cs_number" style="text-align: center;">CS Number</th> <th data-field="activity_date" style="text-align: center;">Date Released</th> <th data-field="has_tag_ltms" style="text-align: center;">LTMS Status</th> </tr> </thead> <tbody> <!-- Dynamic Content --> </tbody> </table> </div> <div class="card-footer text-center"> <nav aria-label="Sales Page Navigation"> <ul class="pagination justify-content-center m-0" id="sales-grid-data-paging"> <!-- Pagination Links --> </ul> </nav> </div> </div> </div> </div> <!-- END ROW --> <!-- Modal to view the image --> <?php /*<div class="modal fade" id="imageModal" tabindex="-1" aria-labelledby="imageModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="imageModalLabel">Image Preview</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body text-center" style=" max-height: 80vh;overflow-y:auto;"> <!-- Add the img-responsive class for Bootstrap 3 --> <img id="modalImage" src="" alt="Image" class="img-responsive" style="max-width: 100%; height: auto;"> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div> */?> <!-- Modal to view the image --> <div class="modal fade" id="imageModal" tabindex="-1" aria-labelledby="imageModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="imageModalLabel">Image Preview</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body text-center" style="max-height: 80vh; overflow-y:auto;"> <div id="carouselImages" class="carousel slide"> <div class="carousel-inner" id="carouselItems"> <!-- Carousel items will be injected here --> </div> <a class="carousel-control-prev" href="#carouselImages" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselImages" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div> <!--END Modal to view the image --> <?php //CUSTOMER MODAL ?> <div class="modal fade" id="customerModal" tabindex="-1" aria-labelledby="customerModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog"> <!-- Use modal-sm for a smaller modal --> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="customerModalLabel">Select Customer</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form> <div class="form-group"> <div class="alert alert-warning mt-2" role="alert"> <i class="fa fa-exclamation-triangle me-2"></i> <strong>Note: </strong>Please ensure that you attach the customer-uploaded file to the appropriate customer to avoid incorrectly tagging LTMS data. </div> <label for="customer-id" class="font-weight-bold">Choose a customer:</label> <select class="form-control" id="customer-id"> <option value="">Select Customer</option> <?php $queryC = $db->connect()->query("SELECT DISTINCT c.id AS customer_id, IF(c.type = 1, CONCAT(c.first_name, ' ', c.middle_name, ' ', c.last_name), c.corporation_name) AS customer_name FROM sales AS s LEFT JOIN vehicle AS v ON s.vehicle_id = v.id LEFT JOIN customer AS c ON v.customer_record_id = c.id LEFT JOIN customer_ltms cl ON c.id = cl.customer_id WHERE s.activity_date >= '2024-09-01' AND cl.customer_id IS NULL ORDER BY c.first_name"); if ($queryC->num_rows > 0) { foreach ($queryC as $cusRow) { ?> <option value="<?= $cusRow['customer_id'] ?>"><?= $cusRow['customer_name'] ?></option> <?php } } ?> </select> </div> </form> </div> <div class="modal-footer"> <button type="button" id="btn-customer-tag" class="btn btn-primary btn-block text-white"><i class="fas fa-tag"></i> Tag</button> <!-- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> --> </div> </div> </div> </div> <?php //END CUSTOMER MODAL ?> </div> <!-- card-body --> </div> <!-- card --> </div> <!--card-card-primary--> </div> <!--container-fluid--> </div> <!--row--> </div> <!--container-fluid--> </section> <!-- END --> </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> <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> <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 --> <!-- jQuery Cookie--> <script src="plugins/jquery-cookie/jquery.cookie.js"></script> <!-- Ekko Lightbox --> <script src="plugins/ekko-lightbox/ekko-lightbox.min.js"></script> <!-- SweetAlert2 --> <script src="plugins/sweetalert2/sweetalert2.min.js"></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> <script src="dist/js/jquery.balloon.min.js"></script> <!-- <script src="dist/js/customer_update/dealer_assigned_user_form.js"></script> --> <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> --> <script src="plugins/datatables/jquery.dataTables.min.js"></script> <script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script> <script> //GLOBALS WITH PHP var customer_force_edit = <?php echo $has_force_edit_permission; ?>; // const ref_header = '<?=$ref_num_header?>' const skey ='<?= base64_encode('ZmtDl9SkyB')?>' </script> <script src="dist/js/ltms/ltms.js"></script> <script src="dist/js/ltms/report_sales_ltms.js"></script> <!-- <script src="dist/js/ltms/sales_customer.js"></script> --> <!-- SheetJS for Excel --> <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script> <!-- jsPDF for PDF --> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> --> <script src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.14/jspdf.plugin.autotable.min.js"></script> --> <script type="text/javascript"> // ExPORT DATA INSIDE TABLE // document.getElementById('export-customer-excel').addEventListener('click', function () { // var table = document.getElementById("customer-table"); // var wb = XLSX.utils.table_to_book(table, {sheet: "Sheet 1"}); // // Export as Excel file // XLSX.writeFile(wb, 'customer_data.xlsx'); // }); $(document).on('change', '#company_sales', function() { const companyId = $("#company_sales").val(); if (companyId) { $.ajax({ url: 'app/table/bt_sales_ltms_list.php', type: "POST", dataType: 'json', data: { apiKey: skey, cid: companyId }, beforeSend: function() { // You can show a loader if needed // $('#loader-main').show(); }, success: function(result) { // Clear current dealer options $('#dealer_sales').empty(); // Check if there are dealers in the result if (result.length > 0) { $('#dealer_sales').append('<option value="">Select Dealer</option>'); // Default option // Append each dealer to the dropdown $.each(result, function(index, dealer) { $('#dealer_sales').append( `<option value="${dealer.dealer_id}">${dealer.dealer_code} - ${dealer.dealer_name}</option>` ); }); } else { $('#dealer_sales').append('<option value="">No Dealers Available</option>'); } }, error: function(xhr, status, error) { // Handle any errors here console.error("Error fetching dealers:", error); } }); } else { // Reset the dealer dropdown if no company is selected $('#dealer_sales').empty().append('<option value="">Select Dealer</option>'); } }); $(document).on('change', '#company_sales_report', function() { const companyId = $("#company_sales_report").val(); if (companyId) { $.ajax({ url: 'app/table/bt_sales_ltms_list.php', type: "POST", dataType: 'json', data: { apiKey: skey, cid: companyId }, beforeSend: function() { // You can show a loader if needed // $('#loader-main').show(); }, success: function(result) { // Clear current dealer options $('#dealer_sales_report').empty(); // Check if there are dealers in the result if (result.length > 0) { $('#dealer_sales_report').append('<option value="">Select Dealer</option>'); // Default option // Append each dealer to the dropdown $.each(result, function(index, dealer) { $('#dealer_sales_report').append( `<option value="${dealer.dealer_id}">${dealer.dealer_code} - ${dealer.dealer_name}</option>` ); }); } else { $('#dealer_sales_report').append('<option value="">No Dealers Available</option>'); } }, error: function(xhr, status, error) { // Handle any errors here console.error("Error fetching dealers:", error); } }); } else { // Reset the dealer dropdown if no company is selected $('#dealer_sales_report').empty().append('<option value="">Select Dealer</option>'); } }); $(document).on('click', '.view-images', function(e) { e.preventDefault(); // Get the image URLs from the data attribute var imageUrls = $(this).data('image-urls').split(','); var customerFullname = $(this).data('fullname'); // Clear the existing carousel items $('#carouselItems').empty(); // Populate the carousel items imageUrls.forEach(function(url, index) { var activeClass = index === 0 ? 'active' : ''; // Set the first item as active $('#carouselItems').append(` <div class="carousel-item ${activeClass}"> <img src="${url}" class="d-block w-100" alt="Image ${index + 1}" style="object-fit: contain; max-height: 70vh;"> </div> `); }); $('#imageModalLabel').text(customerFullname); $('#imageModal').modal('show'); }); $(document).on('click', '.tag-files', function(e) { e.preventDefault(); // Get the customer name for the confirmation message const customerName = $(this).data('name'); // Show the modal $('#customerModal').modal('show'); // Set up the click event for the tag button in the modal $("#btn-customer-tag").off('click').on('click', function() { const selectedCustomerId = $("#customer-id").val(); // Check if a customer is selected if (!selectedCustomerId) { Swal.fire('Warning!', 'Please select a customer to tag.', 'warning'); return; } // Display SweetAlert confirmation Swal.fire({ title: 'Are you sure?', text: `Do you want to tag the files for ${customerName}?`, icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, tag them!' }).then((result) => { if (result.isConfirmed) { // If confirmed, proceed with the AJAX request $.ajax({ url: "api/ltms_report/ltms_tag_files.php", type: "post", dataType: "json", data: { apiKey: "230802398022323", customer_id: selectedCustomerId, // Use the selected customer ID customer_name: customerName // The customer name from the button }, success: function(response) { if (response.status === 1) { Swal.fire('Success!', response.message, 'success'); } else { Swal.fire('Error!', response.message, 'error'); } $('#customerModal').modal('hide'); }, error: function() { Swal.fire('Error!', 'Something went wrong!', 'error'); } }); } }); }); }); // $(document).ready(function() { // // Apply filters // $('#apply-filters').on('click', function() { // var selectedDealer = $('#filter-dealer').val(); // var selectedSC = $('#filter-sc').val(); // var selectedMonth = $('#filter-month').val(); // var selectedYear = $('#filter-year').val(); // $('#filterModal').modal('hide'); // Close the modal after applying filters // }); // }); let data_set = []; // Global data set let totalDataCount = 0; // Total number of records to fetch // Function to disable buttons function disableButtons() { $('#generate-btn').prop('disabled', true); $('#btn-close-modal').prop('disabled', true); $('#export-customer-excel').prop('disabled', true); $('#export-customer-pdf').prop('disabled', true); } // Function to enable buttons function enableButtons() { $('#generate-btn').prop('disabled', false); $('#btn-close-modal').prop('disabled', false); $('#export-customer-excel').prop('disabled', false); $('#export-customer-pdf').prop('disabled', false); } // Function to fetch data in batches async function fetchData(offset) { try { const response = await $.ajax({ url: "api/ltms_report/ltms_report.php", type: "post", dataType: "json", data: { apiKey: "22221111190383", date_from: $("#date_from_ltms").val(), date_to: $("#date_to_ltms").val(), cs_number : $("#cs_number_status").val(), offset: offset, limit: 50 // Limit for each request } }); if (response.results.length === 0) { alert("No data found for the selected date range and filters."); enableButtons(); // Enable buttons after alert return; // Exit early if no data is found } // Update total data count if it's the first request if (offset === 0) { totalDataCount = response.total_data; // Total data from the first response } // Merge the new results into the data set data_set = data_set.concat(response.results); // Calculate progress percentage const progressPercentage = Math.min((data_set.length / totalDataCount) * 100, 100); $('#data-fetch-progress').css('width', progressPercentage + '%').attr('aria-valuenow', progressPercentage).text(Math.round(progressPercentage) + '%'); // Check if more data exists if (response.results.length === 50) { // Fetch the next batch await fetchData(offset + 50); } else { // All data has been loaded console.log(data_set.length); enableButtons(); // Enable buttons after data fetch } } catch (error) { console.error("Error fetching data:", error); enableButtons(); // Enable buttons in case of an error } } // Event handler for the generate button $("#generate-btn").on('click', function() { data_set = []; // Reset dataset disableButtons(); // Disable buttons during data fetch fetchData(0); // Start fetching data from offset 0 }); // PDF Export Code document.getElementById('export-customer-pdf').addEventListener('click', function () { // Check if data_set has data console.log("Data Set Length:", data_set.length); // Log the length of the dataset if (data_set.length === 0) { alert("No data available to export."); return; } // Load jsPDF from the window object var { jsPDF } = window.jspdf; var doc = new jsPDF("p", "mm", "a4"); // A4 size in millimeters // Add Title to PDF centered doc.setFontSize(16); // Bigger font for title const title = "Customer LTMS Data"; const titleWidth = doc.getStringUnitWidth(title) * doc.internal.getFontSize() / doc.internal.scaleFactor; const xTitle = (doc.internal.pageSize.getWidth() - titleWidth) / 2; doc.text(title, xTitle, 15); // Centered title // Define column headers const headers = ["Customer Name", "CS Number", "Date Uploaded"]; const xPos = 10; // X position for the first column let yPos = 25; // Initial vertical position in PDF after title // Set a solid color for the header // doc.setFillColor(96, 117, 250); // RGB color for header // doc.rect(0, 20, doc.internal.pageSize.getWidth(), 10, 'F'); // Fill header rectangle with reduced height // Set font for headers doc.setFontSize(12); doc.setFont("helvetica", "bold"); const headerCellWidths = [100, 30, 50]; // Define column widths headers.forEach((header, index) => { const headerX = xPos + headerCellWidths.slice(0, index).reduce((a, b) => a + b, 0); // Calculate X position based on previous headers' widths doc.text(header, headerX + 2, yPos); // Add headers with padding }); // Reset font for the body doc.setFont("helvetica", "normal"); doc.setFontSize(12); // Set font size for body text yPos += 10; // Move down after headers // Loop through data_set and add rows to PDF data_set.forEach((item) => { const rowText = [ item.fullname || "", // Use empty string if undefined item.cs_number || "", // Use empty string if undefined formatDate(item.created_at) || "" // Use empty string if undefined ]; // Add border for each cell and write the text const customerNameWidth = headerCellWidths[0]; // Width for Customer Name const fileWidth = headerCellWidths[1]; // Width for File column const dateWidth = headerCellWidths[2]; // Width for Date Uploaded column // Add Customer Name doc.rect(xPos, yPos - 8, customerNameWidth, 10); // Border for Customer Name doc.text(item.fullname || "", xPos + 2, yPos); // Add a little padding // Add File const fileX = xPos + customerNameWidth; // X position for File doc.rect(fileX, yPos - 8, fileWidth, 10); // Border for File doc.text(item.cs_number || "", fileX + 2, yPos); // Add a little padding // Add Date Uploaded const dateX = fileX + fileWidth; // X position for Date Uploaded doc.rect(dateX, yPos - 8, dateWidth, 10); // Border for Date Uploaded doc.text(item.created_at || "", dateX + 2, yPos); // Add a little padding yPos += 10; // Move to the next row position // Check if the page is full if (yPos > doc.internal.pageSize.getHeight() - 20) { doc.addPage(); // Add new page yPos = 10; // Reset Y position // Only add Title and Header on the first page if (doc.internal.getNumberOfPages() === 1) { // Add Title to new page centered doc.text(title, xTitle, 15); // Centered title // Fill header rectangle for new page doc.rect(0, 20, doc.internal.pageSize.getWidth(), 10, 'F'); // Fill header rectangle doc.setFont("helvetica", "bold"); headers.forEach((header, index) => { const headerX = xPos + headerCellWidths.slice(0, index).reduce((a, b) => a + b, 0); doc.text(header, headerX + 2, yPos); // Add headers with padding }); yPos += 10; // Move down after headers } } }); // Add page number at the bottom of each page const totalPages = doc.internal.getNumberOfPages(); for (let i = 1; i <= totalPages; i++) { doc.setPage(i); doc.setFontSize(10); doc.text(`Page ${i} of ${totalPages}`, doc.internal.pageSize.getWidth() - 30, doc.internal.pageSize.getHeight() - 10); // Position for page number } // Stream the PDF instead of downloading var pdfOutput = doc.output('datauristring'); window.open(pdfOutput); // Open the PDF in a new tab }); document.getElementById('export-customer-excel').addEventListener('click', function () { // Check if data_set has data if (data_set.length === 0) { alert("No data available to export."); return; } // Log data_set for debugging console.log(data_set); // Convert data_set to a format suitable for Excel const formattedData = data_set.map(item => ({ 'Customer Name': item.fullname, // Ensure the property names are correct 'CS Number': item.cs_number, // Ensure the property names are correct 'Date Uploaded': item.created_at, // Ensure the property names are correct // Add more fields as necessary })); // Log the formatted data to verify the structure before export console.log(formattedData); // Create a new workbook const wb = XLSX.utils.book_new(); // Convert the formatted data to a worksheet const ws = XLSX.utils.json_to_sheet(formattedData); // Append the worksheet to the workbook XLSX.utils.book_append_sheet(wb, ws, 'Customer LTMS Data'); // Export as Excel file XLSX.writeFile(wb, 'customer_data.xlsx'); }); function formatDate(date) { const formattedDate = date.toLocaleString('en-US', { year: 'numeric', month: 'long', // Full month name (e.g., "October") day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: true // Enables AM/PM }); return formattedDate; } </script> </body> </html>