From c3ddf47a7e072b774a816a4d1359ad2b61a36014 Mon Sep 17 00:00:00 2001 From: Claudio Date: Tue, 8 Oct 2024 16:17:47 +0200 Subject: [PATCH] general layout fixing --- .../userarea/importify/history_importify.php | 459 +++++++++--------- .../userarea/importify/importifydashboard.php | 71 +-- public/userarea/include/footer.php | 2 +- public/userarea/include/navigationbar.php | 49 +- public/userarea/include/topbar.php | 4 +- public/userarea/index.php | 12 - 6 files changed, 302 insertions(+), 295 deletions(-) diff --git a/public/userarea/importify/history_importify.php b/public/userarea/importify/history_importify.php index e2c76e7..02c8927 100644 --- a/public/userarea/importify/history_importify.php +++ b/public/userarea/importify/history_importify.php @@ -84,7 +84,11 @@ $arr_his = $importify_his->Results; font-size: 12px; } - table.table-bordered.dataTable tbody th, table.table-bordered.dataTable thead td, table.table-bordered.dataTable tbody td, table.table-bordered.dataTable th, table.table-bordered.dataTable td { + table.table-bordered.dataTable tbody th, + table.table-bordered.dataTable thead td, + table.table-bordered.dataTable tbody td, + table.table-bordered.dataTable th, + table.table-bordered.dataTable td { text-align: center !important; } @@ -97,250 +101,267 @@ $arr_his = $importify_his->Results; - -
-
-
+ +
+
+
+
-
-
-
-
+
+
+
+
-
- -
+ +
- + - + -
- -
+
+ +
- + -
+
-
+
-
-
-
-
- -
-

Importify

-
-
-
- - -
-
-
-
-
Importify: History Import
- - -

-
- - - - - - - - - - - - - - - - - - - - - -
NoDate/TimeImportCodeStatusAction
- - - - - - - - - -
-
+
+
+
+
+ +
+

Importify

-
- + + +
+
+
+
+
Importify: History Import
+ + + + +

+
+ + + + + + + + + + + + + + + + + + + + + +
NoDate/TimeImportCodeStatusAction
+ + + + + + + + + +
+
+
+
+
+
+ -
+
-
+
-
+
- + + +
+
- + + + + + + + + + + + + -
- - - - - - - - - - - - + + - - + + + - - - - - - - + + + - - + + $('#tbl_his').DataTable({ + + "processing": true, + "serverSide": false, + "lengthChange": true, + "lengthMenu": [10, 20, 50, 100], + "pageLength": 10, + "columns": [{ + "orderable": true + }, + { + "orderable": true + }, + { + "orderable": true + }, + { + "orderable": true + }, + { + "orderable": false + }, + ], + oLanguage: { + oAria: { + sSortAscending: ": activate to sort column ascending", + sSortDescending: ": activate to sort column descending" + }, + oPaginate: { + sFirst: "First", + sLast: "Last", + sNext: "Next", + sPrevious: "Previous" + }, + sEmptyTable: "No data available in table", + sInfo: "Showing _START_ to _END_ of _TOTAL_ entries", + sInfoEmpty: "Showing 0 to 0 of 0 entries", + sInfoFiltered: "(filtered from _MAX_ total entries)", + sInfoPostFix: "", + sDecimal: "", + sThousands: ",", + sLengthMenu: "_MENU_", + sLoadingRecords: "Loading...", + sProcessing: "Processing...", + sSearch: "Search:", + sSearchPlaceholder: "", + sUrl: "", + sZeroRecords: "No matching records found" + }, + // "ajax": { + // "url": "/loadGoodsDestroyed", + // "type": "POST", + // "dataType": "json", + // "dataSrc": "data", + // "data": {start_date: start_date, end_date: end_date} + // }, + // "columns": [ + // {"data": "name"}, + // {"data": "status"}, + // {"data": "count"}, + // {"data": "price"}, + // {"data": "consumer"}, + // {"data": "date"} + // ] + }); + + function onCancelHis(id) { + Swal.fire({ + title: 'Cancel Confirm!', + text: "Do you want to cancel import his?", + icon: 'warning', + showCancelButton: true, + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', + }).then((result) => { + if (result.isConfirmed) { + $.ajax({ + url: 'cancel_import_his.php', + type: 'POST', + data: { + his_id: id + }, + beforeSend: function() { + $('#ajax_preloader').fadeIn(); + }, + error: function() { + $('#ajax_preloader').fadeOut(); + showWarningAlert("Server Error"); + }, + success: function(data) { + $('#ajax_preloader').fadeOut(); + + if (data.indexOf("success") > -1) { + showSuccessPopup("Your operation successed!", function() { + location.reload(); + }); + } else { + showWarningAlert("Server Error.") + } + } + }) + } + }); + } + - + + \ No newline at end of file diff --git a/public/userarea/importify/importifydashboard.php b/public/userarea/importify/importifydashboard.php index b64b015..d8a916d 100644 --- a/public/userarea/importify/importifydashboard.php +++ b/public/userarea/importify/importifydashboard.php @@ -158,10 +158,8 @@
Importify:
Insert new template - Import File - - +

@@ -256,19 +254,19 @@ function onRunImport(id_template_importify) { tmp_id_template_importify = id_template_importify; - $('#f_csv').trigger("click"); + $('#f_csv').trigger("click"); } - $('#f_csv').change(function(){ + $('#f_csv').change(function() { let formdata = new FormData(); - if($(this).prop('files').length > 0) { + if ($(this).prop('files').length > 0) { formdata.append("f_csv", $(this).prop('files')[0]); formdata.append("template_id", tmp_id_template_importify); // ask user to choose which lab wants to associate from get_laboratories.php $.ajax({ url: 'get_laboratories.php', - type: 'POST', + type: 'POST', processData: false, contentType: false, beforeSend: function() { @@ -281,11 +279,11 @@ }, success: function(data) { $('#ajax_preloader').fadeOut(); - if(data.indexOf("success") > -1) { + if (data.indexOf("success") > -1) { let arr_labs = JSON.parse(data); - let str_arr_option = ''; - for(let i=0; i' + arr_labs['laboratories'][i]['name'] +' - '+arr_labs['laboratories'][i]['description'] + ''; + let str_arr_option = ''; + for (let i = 0; i < arr_labs['laboratories'].length; i++) { + str_arr_option += ''; } Swal.fire({ @@ -297,9 +295,9 @@ confirmButtonText: 'Confirm', allowOutsideClick: false, }).then((result) => { - if(result.isConfirmed) { + if (result.isConfirmed) { let lab_id = $('#sel_lab').val(); - formdata.append("lab_id", lab_id); + formdata.append("lab_id", lab_id); $("#labor_id").val(lab_id); $.ajax({ @@ -318,7 +316,7 @@ }, success: function(data) { $('#ajax_preloader').fadeOut(); - if(data.indexOf("success") > -1) { + if (data.indexOf("success") > -1) { let arr_data = JSON.parse(data); let arr_analysisvoc = arr_data['arr_analysis_data']; console.log(arr_analysisvoc); @@ -333,10 +331,10 @@ tmp_str_arr_kind_option = ''; show_analysis_add_pop(); - }else if(data.indexOf("none_define_column_error") > -1) { + } else if (data.indexOf("none_define_column_error") > -1) { $('#f_csv').val(""); showWarningPopup("The Associate Columns did not define yet!"); - } else if(data.indexOf("invalid_excel_data_format_error") > -1) { + } else if (data.indexOf("invalid_excel_data_format_error") > -1) { $('#f_csv').val(""); showWarningPopup("Excel data format is not valid!") } else { @@ -352,16 +350,17 @@ showWarningAlert("Server Error.") } } - }) + }) } }); - + let arr_total_analysisvoc = Array(); let tmp_analyvoc_idx = 0; let arr_total_compundsvoc = Array(); let tmp_compundsvoc_idx = 0; + function show_analysis_add_pop() { - if(tmp_analyvoc_idx < arr_total_analysisvoc.length) { + if (tmp_analyvoc_idx < arr_total_analysisvoc.length) { show_analysis_add_popup(arr_total_analysisvoc[tmp_analyvoc_idx], function() { tmp_analyvoc_idx++; show_analysis_add_pop(); @@ -372,7 +371,7 @@ } function show_compunds_add_pop() { - if(tmp_compundsvoc_idx < arr_total_compundsvoc.length) { + if (tmp_compundsvoc_idx < arr_total_compundsvoc.length) { show_compunds_add_popup(arr_total_compundsvoc[tmp_compundsvoc_idx], function() { tmp_compundsvoc_idx++; show_compunds_add_pop(); @@ -383,12 +382,13 @@ } let tmp_str_arr_kind_option = ''; + function show_analysis_add_popup(voc_info, callback) { let str_word = voc_info['word']; let arr_similary = voc_info['arr_similary']; let str_arr_option = ''; - for(let i=0; i' + arr_similary[i]['nameanalysisvoc'] + ''; } str_arr_option += tmp_str_arr_kind_option; @@ -421,7 +421,7 @@ didOpen: () => { $('.swal2-popup .ipt_type').select2(); $('.swal2-popup .ipt_type').bind("change", function() { - if($(this).val() == 0) { + if ($(this).val() == 0) { $('.div_input').removeClass("hidden"); $('.ipt_val').val(""); $('.swal2-popup .ipt_name').val(str_word); @@ -455,13 +455,13 @@ }, success: function(data) { $('#ajax_preloader').fadeOut(); - if(data.indexOf("success") > -1) { - if(type == 0) { + if (data.indexOf("success") > -1) { + if (type == 0) { let inserted_info = JSON.parse(data)['info']; tmp_str_arr_kind_option += ''; } showSuccessAlert("Successfully added!"); - if(callback) { + if (callback) { callback(); } } else { @@ -473,13 +473,14 @@ } let tmp_str_arr_compunds_kind_option = ''; + function show_compunds_add_popup(voc_info, callback) { let str_word = voc_info['word']; let str_analysis_word = voc_info['anaysis_word']; let arr_similary = voc_info['arr_similary']; let str_arr_option = ''; - for(let i=0; i' + arr_similary[i]['namecompoundsvocabulary'] + ''; } str_arr_option += tmp_str_arr_compunds_kind_option; @@ -512,7 +513,7 @@ didOpen: () => { $('.swal2-popup .ipt_type').select2(); $('.swal2-popup .ipt_type').bind("change", function() { - if($(this).val() == 0) { + if ($(this).val() == 0) { $('.div_input').removeClass("hidden"); $('.ipt_val').val(""); $('.swal2-popup .ipt_name').val(str_word); @@ -547,13 +548,13 @@ }, success: function(data) { $('#ajax_preloader').fadeOut(); - if(data.indexOf("success") > -1) { - if(type == 0) { + if (data.indexOf("success") > -1) { + if (type == 0) { let inserted_info = JSON.parse(data)['info']; tmp_str_arr_compunds_kind_option += ''; } showSuccessAlert("Successfully added!"); - if(callback) { + if (callback) { callback(); } } else { @@ -566,7 +567,7 @@ function import_auto_script() { let formdata = new FormData(); - if($('#f_csv').prop('files').length > 0) { + if ($('#f_csv').prop('files').length > 0) { formdata.append("f_csv", $('#f_csv').prop('files')[0]); formdata.append("template_id", tmp_id_template_importify); formdata.append("lab_id", $('#labor_id').val()); @@ -587,11 +588,11 @@ }, success: function(data) { $('#ajax_preloader').fadeOut(); - if(data.indexOf("success") > -1) { + if (data.indexOf("success") > -1) { showSuccessPopup("Your operation requested!"); - }else if(data.indexOf("none_define_column_error") > -1) { + } else if (data.indexOf("none_define_column_error") > -1) { showWarningPopup("The Associate Columns did not define yet!"); - } else if(data.indexOf("invalid_excel_data_format_error") > -1) { + } else if (data.indexOf("invalid_excel_data_format_error") > -1) { showWarningPopup("Excel data format is not valid!") } else { showWarningAlert("Server Error.") @@ -652,4 +653,4 @@ - + \ No newline at end of file diff --git a/public/userarea/include/footer.php b/public/userarea/include/footer.php index b91971e..834cc6b 100644 --- a/public/userarea/include/footer.php +++ b/public/userarea/include/footer.php @@ -1,3 +1,3 @@
- © 2020 Reportify by CEsoft. + © 2024 Reportify by CEsoft.
\ No newline at end of file diff --git a/public/userarea/include/navigationbar.php b/public/userarea/include/navigationbar.php index 1d5631b..22bb8bd 100644 --- a/public/userarea/include/navigationbar.php +++ b/public/userarea/include/navigationbar.php @@ -41,7 +41,7 @@
  • - +