File manager - Edit - /home/autoph/public_html/connectv1/dist/js.bak/bank/bank_report.js
Back
// GLOBAL VARIABLES var selected_bank = 0; var selected_company = 0; var selected_dealer = 0; $(function(){ // INITIALIZATIONS initTableBankReport(); $('#bank').select2({ placeholder: "Select bank", allowClear: true }) $('#bank').on('select2: unselecting', function(event){ selected_bank = 0; }) $('#company-filter').select2({ placeholder: "Company", allowClear: true }) $('#dealer').select2({ placeholder: "Dealer", allowClear: true }) triggerBankDropdown(); $('#button-download').attr('disabled', true); document.getElementById("dropdown-filter").addEventListener('click', function(event) { event.stopPropagation(); }); }) // INITIALIZE TABLE function initTableBankReport() { var $table = $('#bank-record-table') $table.bootstrapTable('destroy').bootstrapTable({ onLoadSuccess: function(data){ var total = data.total; if(total > 0){ $('#download-pdf-bank').attr('disabled', false); } else { $('#download-pdf-bank').attr('disabled', true); } } }) } function refreshBankReportTable() { var $table = $('#bank-record-table') $(function() { $table.bootstrapTable('refresh', { // 4 url: 'app/table/bank_table.php' }); }) } function queryBankRecord(params) { // alert(selected_dealer); return { search: params.search, offset: params.offset, limit: params.limit, bank_id: selected_bank, company: selected_company, dealer: selected_dealer, type: 4 // bank report table }; } function triggerBankDropdown(){ selected_bank = $('#bank').val(); if(selected_bank === null || selected_bank == "" || typeof selected_bank === "undefined"){ selected_bank = 0; } refreshBankReportTable(); } // function fillBranch(){ // $.ajax({ // url:"app/misc/get_branch.php", // type:"POST", // data: { // bank: selected_bank, // type: 1 // }, // beforeSend: function(){ // }, // success: function(result){ // $('#dealer').html(''); // // $('#dealer').append("\"<option value=''>ALL</option>\""); // $('#dealer').append("\"" + result + "\""); // } // }); // } function fillDealer(comp){ var comp = $('#company-filter').val(); dealer = 0; $.ajax({ url:"app/misc/get_dealer3.php", type:"POST", data: { company: comp, type: 3 }, beforeSend: function(){ }, success: function(result){ $('#dealer').html(''); $('#dealer').append("\"<option value=''></option>\""); $('#dealer').append("\"" + result + "\""); } }); } function buttonsFunction() { return { grid_toggle_off: { 'icon': 'far fa-file-pdf', 'event': 'exportPdf', 'attributes': { 'id': 'download-pdf-bank', '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 exportPdf(){ window.open('print_bank_report.php?bank_id=' + selected_bank + "&comp=" + selected_company + "&deal=" + selected_dealer); // if(generate_bg_report == 0){ // toastr.remove(); // toastr.error("No access in generating BG report"); // } // else { // window.open('print_bank_report.php?bank_id=' + selected_bank); // } } $('#company-filter').on('change', function(){ selected_company = $('#company-filter').val(); if(selected_company === null || selected_company == "" || typeof selected_company === "undefined"){ selected_company = 0; } fillDealer(selected_company); refreshBankReportTable(); }) $('#dealer').on('change', function(){ selected_dealer = $('#dealer').val(); if(selected_dealer === null || selected_dealer == "" || typeof selected_dealer === "undefined"){ selected_dealer = 0; } refreshBankReportTable(); }) $('#btn-no-filter').on('click', function(){ $('#company-filter').val('').trigger('change'); // $('#dealer').html(''); selected_company = 0; selected_dealer = 0; refreshBankReportTable(); }) $('#bank-record-table').on('click-cell.bs.table', function(field, value, row, $el){ var record_id = $el.record_id; var bank_id = $el.bank_id; var branch_name = $el.branch_name; window.location.href = 'bankinformation.php?bank_id=' + bank_id + '&branch_name=' + branch_name; }) $('#bank').on('change', function(){ triggerBankDropdown(); }) $('#button-fetch').on('click', function(){ selected_bank = $('#bank').val(); refreshBankReportTable(); }) $('#button-download').on('click', function(){ window.open('print_bank_report.php?bank_id=' + selected_bank); })
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings