File manager - Edit - /home/autoph/public_html/connectv1/dist/js/sms_service/follow_up_report.js
Back
// global variables var start_date = ""; var end_date = ""; var company = ""; var dealer = ""; var type_status = 0; var action_status = 0; var mask = 1; var start = null; var end = null; var isMobile = window.matchMedia("only screen and (max-width: 760px)").matches; var shown = true; // tooltip var current_year = 0; // initializations $(function(){ $('#filter-date-from').datetimepicker({ format: 'L' }); }) $(function(){ $('#filter-date-to').datetimepicker({ format: 'L' }); }) $('#company').select2(); $('#dealer').select2(); $('#status').select2(); $('#action_status').select2(); $(function() { $('#tip-print').attr('data-original-title', "<div id='tool' class=''>- Print is available after all messages are sent/processed (no pending)<br>- Print result is based on status selected (except pending)<div>"); initToolTip(); current_year = new Date().getFullYear(); initTableBirthdayReport(); // if(generate_bg_report == 0){ $('#download-pdf-bg').attr('disabled', true); } else { $('#download-pdf-bg').attr('disabled', false); } }); function showGraphBG(start_date, end_date, company){ } function buttonsFunction() { return { grid_toggle_off: { 'icon': 'far fa-file-pdf', 'event': 'exportPdf', 'attributes': { 'id': 'download-pdf-bg', 'title': 'Download PDF', 'text': 'PDF' } } // , // excel_export: { // 'icon': 'fa-file-excel', // 'event': 'exportXlsx', // 'attributes': { // 'id': 'download-excel-bg', // 'title': 'Download XLSX (Excel)', // 'data-test': 'test123' // } // } } } function cb(start, end) { var startDate = start.format('YYYY-MM-DD'); passDate(start, end); //pass empty dates } function initToolTip(){ var bootstrapTooltip = $.fn.tooltip.noConflict(); $.fn.bstooltip = bootstrapTooltip; $('.tooltip-me').bstooltip(); } function initTableBirthdayReport() { var $table = $('#fup-record-table') $table.bootstrapTable('destroy').bootstrapTable({ onLoadSuccess: function(data){ // alert(data.total); return; $('#button-generate').attr('disabled', false); var row_total = data.total; $('#span-total').text(row_total); if(row_total == 0){ $('#download-pdf-fup').attr('disabled', true); } else { $('#download-pdf-fup').attr('disabled', false); } // else { // if(generate_bg_report == 0){ // $('#download-pdf-bg').attr('disabled', true); // } // else { // $('#download-pdf-bg').attr('disabled', false); // } // } } }) } function passDate(startDate, endDate) { var company = ($("#company-filter").val() == '') ? '0' : $("#company-filter").val(); filtered_company = (parseInt(company) === 0) ? '' : '&selected_company=' + company; filtered_date_start = (startDate === '') ? '' : '&start_date=' + startDate; filtered_date_end = (endDate === '') ? '' : '&end_date=' + endDate; } function DoCellData(cell, row, col, data) { // console.log(data) } function DoBeforeAutotable(table, headers, rows, AutotableSettings) { } function exportPdf(){ var date_range = start_date + "@" + end_date; var count = $('#span-total').text(); if(generate_fup_report == 0){ toastr.remove(); toastr.error("No access in generating report"); } else { // $.ajax({ // url: 'print_functions/print_fup_report.php', // type: 'POST', // delay: 250, // data: { // filter_date: date_range, // filter_status: type_status, // count: count, // company: company, // dealer: dealer, // mask: mask // }, // beforeSend: function(data) { // }, // success: function(result) { // } // }); // alert('print_functions/print_fup_record.php?filter_date=' + date_range + '&filter_status=' + type_status + '&count='+ count + '&company='+ company + '&dealer='+ dealer + '&mask='+ mask); return; window.open('print_functions/print_fup_report.php?filter_date=' + date_range + '&filter_status=' + type_status + '&count='+ count + '&company='+ company + '&dealer='+ dealer + '&mask='+ mask); } } function exportXlsx() { $('#compliance-table').tableExport({ fileName: 'Report', type: 'xlsx' }); } function fetchDealer(){ $('#dealer').select2({ "language": { "noResults": function() { return 'Enter dealer name or code'; } }, escapeMarkup: function(markup) { return markup; }, placeholder: 'Search dealer name or code', ajax: { url: 'app/misc/get_dealer_customer.php', dataType: 'json', delay: 250, data: function(data) { return { searchTerm: data.term, // search term type: 1, company_id: $("#company").val() }; }, processResults: function(response) { response.unshift({ // id: "0" }); return { results: response }; }, cache: true } }); } function refreshFollowUpTable() { var $table = $('#fup-record-table') $(function() { $table.bootstrapTable('refresh', { // 17 follow up report url: 'app/table/reload_table.php' }); }) } function queryFollowUp(params) { $.cookie("compliance_start_date", start_date); $.cookie("compliance_end_date", end_date); return { search: params.search, offset: params.offset, start_date: start_date, end_date: end_date, company: company, dealer: dealer, status: type_status, action_status: action_status, mask: mask, type: 17, // followup report limit: params.limit }; } // function removeTableField(field_name) { // // Get target th with the name you want to remove // var target = $('#fup-record-table').find('.' + field_name); // // Find its index among other ths // var index = target.index(); // // For each tr, remove all th and td that match the index // $('table tr').find('th:eq(' + index + ')' ).remove(); // $('table tr').find('td:eq(' + index + ')' ).remove(); // } $(function(){ $('#filter-date').daterangepicker({ autoUpdateInput: false, showDropdowns: true, locale: { cancelLabel: 'Cancel' }, startDate: start, opens: "left", endDate: end, ranges: { 'Today': [moment(), moment()], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 'This Month': [moment().startOf('month'), moment().endOf('month')], 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')], 'This Year': [moment().startOf('year'), moment().endOf('year')], 'Last Year': [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')] } }); }); function setDateRangePickerWidth(isMobile) { if ($(".daterangepicker").hasClass('show-calendar') && !isMobile) { $('.daterangepicker').css('width', '630px'); } else { $('.daterangepicker').css('width', 'auto'); } } function getCookie(name) { var match = document.cookie.match(RegExp('(?:^|;\\s*)' + name + '=([^;]*)')); return match ? match[1] : null; } if((getCookie("compliance_start_date") == null || $.cookie("compliance_start_date") == '') || (getCookie("compliance_end_date") == null || $.cookie("compliance_end_date") == '')) { start = moment().startOf('month'); end = moment().endOf('month'); } else { start = moment($.cookie("compliance_start_date")); end = moment($.cookie("compliance_end_date")); } $('#filter-date').on('click', function() { setDateRangePickerWidth(isMobile); }); $('.daterangepicker').on('click', function() { setDateRangePickerWidth(isMobile); }); $('#filter-date').on('apply.daterangepicker', function(ev, picker) { start_date = picker.startDate.format('yyyy-MM-DD'); end_date = picker.endDate.format('yyyy-MM-DD'); $('#filter-date-selected').val(picker.startDate.format('MMMM D, YYYY') + ' to ' + picker.endDate.format('MMMM D, YYYY')); cb(picker.startDate, picker.endDate); }); $('#filter-date').on('cancel.daterangepicker', function(ev, picker) { $('#filter-date').data('daterangepicker').hideCalendars(); }); $('#button-generate').on('click', function(){ if($('#filter-date-selected').val() == ""){ toastr.remove(); toastr.warning("Date range is empty", "Specify date"); return; } company = $('#company').val(); $('#dealer').val() == 0 ? dealer = "" : dealer = $('#dealer').val(); type_status = $('#status').val(); action_status = $('#action_status').val(); $('#table-div').attr('hidden', false); $('#details-div').attr('hidden', false); refreshFollowUpTable(); // if(type_status == 0){ // sms and call // // addTableField(''); // } // else if(type_status == 1){ // sms only // removeTableField('call-field'); // } // else if(type_status == 2){ // call only // removeTableField('sms-field'); // } }); $('#company').on('select2:select', function(e) { fetchDealer(); }); $('#chkMasked').on('click', function(){ if(mask == 0){ mask = 1; } else { mask = 0; } });
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings