File manager - Edit - /home/autoph/public_html/data03252025consolidation/lms/resources/views/common/scripts/configuration.js
Back
//START CONFIG FILE///////////////////////////////////////////////////////////////////////////////////////////////////// function init_config_page() { init_header(); if (side_menu_loaded) { init_config(); } else { $.when(init_side_content()).done(function(ajax1Results) { init_config(); }); } } var init_config = function() { if(!global_menu_access.includes(1)){ return false; } return $.ajax({ url: "resources/views/config.php", data: {}, type: "POST", beforeSend: function() {}, success: function(data) { document.title = 'Configurations'; $('#center_content').html(data); add_content_close_listener('center_content'); $('#config_user_roles').on('click', function() { init_rolefile_page(); }); $('#config_sms').on('click', function() { $.when(init_sms_modal(),get_activated_sms_api()).done(function(ajax1Results,ajax2Results) { $('#sms_modal').modal('show'); $('#sms_modal').on('hidden.bs.modal', function() { $('#sms_modal').remove(); }); $('#dd_sms_api').select2({ placeholder: "Select API", allowClear: true, minimumResultsForSearch: -1, // allowClear: true, ajax: { url: 'app/models/sms.php?model=api_list', dataType: 'json' } }); $('#btn_sms_save').on('click', function() { var $element = $("[json-sms-modal]"); var json_data = generate_json('json-sms-modal', $element); return $.ajax({ url: "app/models/sms.php", data: { model: 'set_activated_api', json_data: json_data }, type: "POST", dataType: 'json', beforeSend: function() { $('#btn_sms_save').prop( 'disabled', true); toastr.remove(); toastr.info("Saving..."); }, success: function(result) { if (parseInt(result.status) === 1) { toastr.remove(); toastr.success(result.message); $('#sms_modal').modal( 'hide'); $('#sms_modal').remove(); } else { $('#btn_sms_save').prop( 'disabled', false); toastr.remove(); toastr.error(result.message); } }, error: function() { $('#btn_sms_save').prop( 'disabled', false); toastr.remove(); toastr.error( "Error has occurred. Try again." ) } }); }); var api_information = ajax2Results[0]; // console.log(api_information); // set sms api customSelectOption($("#dd_sms_api"), api_information['id'], api_information['name']); }); }); $('#config_system').on('click', function() { $.when(init_system_settings_modal(),get_system_settings()).done(function(ajax1Results,ajax2Results) { $('#system_settings_modal').modal('show'); $('#system_settings_modal').on('hidden.bs.modal', function() { $('#system_settings_modal').remove(); }); var result_system_settings = ajax2Results[0]; $.each(result_system_settings, function(i, n) { $("#" + i).text(n); $("#" + i).val(n); $("#" + i).trigger('change') }); $('#btn_system_settings_save').on('click', function() { var $element = $("[json-system-settings-modal]"); var json_data = generate_json('json-system-settings-modal', $element); return $.ajax({ url: "app/models/system_settings.php", data: { model: 'update', json_data: json_data }, type: "POST", dataType: 'json', beforeSend: function() { $('#btn_sms_save').prop( 'disabled', true); toastr.remove(); toastr.info("Saving..."); }, success: function(result) { if (parseInt(result.status) === 1) { toastr.remove(); toastr.success(result.message); $('#system_settings_modal').modal( 'hide'); $('#system_settings_modal').remove(); } else { $('#btn_sms_save').prop( 'disabled', false); toastr.remove(); toastr.error(result.message); } }, error: function() { $('#btn_sms_save').prop( 'disabled', false); toastr.remove(); toastr.error( "Error has occurred. Try again." ) } }); }); }); }); show_hide_preloader(false); }, error: function() { toastr.remove(); toastr.error("Error has occurred. Try again.") } }); } function init_sms_modal() { return $.ajax({ url: "resources/views/modals/sms_modal.php", data: {}, type: "POST", beforeSend: function() {}, success: function(data) { $('#center_content').append(data); }, error: function() { toastr.remove(); toastr.error("Error has occurred. Try again.") } }); } function init_system_settings_modal() { return $.ajax({ url: "resources/views/modals/system_settings_modal.php", data: {}, type: "POST", beforeSend: function() {}, success: function(data) { $('#center_content').append(data); }, error: function() { toastr.remove(); toastr.error("Error has occurred. Try again.") } }); } function get_system_settings(){ return $.ajax({ url: "app/models/system_settings.php", data: { model: 'get_system_settings' }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) {}, error: function() { toastr.remove(); toastr.error( "Error has occurred. Try again." ) } }); } function get_activated_sms_api() { return $.ajax({ url: "app/models/sms.php", data: { model: 'activated_api' }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) {}, error: function() { toastr.remove(); toastr.error( "Error has occurred. Try again." ) } }); } //END CONFIG FILE/////////////////////////////////////////////////////////////////////////////////////////////////////
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings