File manager - Edit - /home/autoph/public_html/data03252025consolidation/dist/js.bak/bank/bank_config_area.js
Back
// GLOBAL VARIABLES var area_id_selected = ""; $(function(){ $('#area-status-checkbox').bootstrapSwitch('disabled', true); $('#update-area').attr('disabled', true); }) $("input[data-bootstrap-switch]").each(function(){ $(this).bootstrapSwitch('state', $(this).prop('checked')); }); function refreshBankConfigAreaList(){ $.ajax({ url:"app/area/configurations/area.php", type:"POST", data: { type: 4 // reload list w/o area id }, beforeSend: function(){ }, success: function(result) { $('#area-list').html(''); $('#area-list').append("\"" + result + "\""); }, }) } function delayArea(callback, ms) { var timer = 0; return function() { var context = this, args = arguments; clearTimeout(timer); timer = setTimeout(function () { callback.apply(context, args); }, ms || 0); }; } $('#add-area').on('click', function(){ var new_area = $('#new-area-name').val(); if(new_area == ""){ toastr.remove(); toastr.error('Area name field is empty'); return; } $.ajax({ url:"app/area/configurations/area.php", type:"POST", dataType: 'json', data: { type: 1, // add area new_area: new_area }, beforeSend: function(){ }, success: function(result) { if(result.status == 0){ // dupli name toastr.remove(); toastr.error(result.message); } else if(result.status == 1){ toastr.remove(); toastr.success("New area added successfully"); $('#new-area-name').val(""); $('#modal-add-area').modal('hide'); refreshBankConfigAreaList(); } }, }); }); $('#area-list').on('change', function(){ area_id_selected = $('#area-list').val(); $.ajax({ url:"app/area/configurations/area.php", type:"POST", dataType: 'json', data: { area_id: area_id_selected, type: 2 // reload/load area }, beforeSend: function(){ }, success: function(result) { $('#area-code').val(result.code); $('#area-name').val(result.name); $('#area-added-by').text(result.added_by); $('#area-last-modified-by').text(result.last_modified_by + "\n" + "(" + result.date_modified + ")"); $('#area-date-added').text(result.date_added); $('#area-status-checkbox').bootstrapSwitch('disabled', false); $('#area-status-checkbox').bootstrapSwitch('state', result.status); $('#update-area').attr('disabled', false); }, }) }); $('#update-area').on('click', function (){ var update_area_name = $('#area-name').val(); var status = $('#area-status-checkbox').bootstrapSwitch('state'); if(area_id_selected == ""){ toastr.remove(); toastr.error("Please select area name to be modified first"); exit; } if(update_area_name == ""){ toastr.remove(); toastr.error("Area name is empty"); return; } $.ajax({ url:"app/area/configurations/area.php", type:"POST", dataType: 'json', data: { type: 3, // update area area_id: area_id_selected, new_area_name: update_area_name, status: status }, beforeSend: function(){ $('#update-area').attr('disabled', true); }, success: function(result) { if(result.status == 0){ toastr.remove(); toastr.error("Area name already existing"); $('#update-area').attr('disabled', false); return; } if(result.status == 1){ toastr.remove(); toastr.success("Area details successfully updated"); refreshBankConfigAreaList(); $('#area-code').val(""); $('#area-name').val(""); $('#area-added-by').text(""); $('#area-date-added').text(""); $('#area-last-modified-by').text(""); $('#area-status-checkbox').bootstrapSwitch('disabled', true); $('#update-area').attr('disabled', true); area_id_selected = ""; return; } }, }) }); $('#search-area').keyup(delayArea(function (e){ var search_area = $('#search-area').val(); area_id_selected = ""; $.ajax({ url:"app/area/configurations/area.php", type:"POST", data: { type: 5, // search search_item: search_area }, beforeSend: function(){ }, success: function(result){ $('#area-list').html(''); $('#area-list').append("\"" + result + "\""); } }); }, 500)); $('#area-close-modal').on('click', function(){ $('#modal-add-area').modal('hide'); $('#new-area-code').val(""); $('#new-area-name').val(""); });
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings