general layout fixing
This commit is contained in:
@@ -158,10 +158,8 @@
|
||||
<div class="card-body">
|
||||
<h5 class="header-title pb-3 mt-0">Importify: <?php echo $dashboard; ?></h5>
|
||||
<a class="btn btn-primary" href="insert-importifytemplate.php" role="button">Insert new template</a>
|
||||
<a class="btn btn-success" href="rsl-category.php" role="button">Import File</a>
|
||||
<a href="history_importify.php"><button type="button" class="btn btn-info w-md waves-effect waves-light">Hystory Import</button></a>
|
||||
<a href="importifydashboard.php"><button type="button" class="btn btn-pink w-md waves-effect waves-light">Importify Dasboard</button></a>
|
||||
<a href="dashboard.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Reportify Dasboard</button></a>
|
||||
<a href="../index.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Reportify Dasboard</button></a>
|
||||
<br><br>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm sm-0">
|
||||
@@ -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'].length; i++) {
|
||||
str_arr_option += '<option value="' + arr_labs['laboratories'][i]['idlab'] + '">' + arr_labs['laboratories'][i]['name'] +' - '+arr_labs['laboratories'][i]['description'] + '</option>';
|
||||
let str_arr_option = '';
|
||||
for (let i = 0; i < arr_labs['laboratories'].length; i++) {
|
||||
str_arr_option += '<option value="' + arr_labs['laboratories'][i]['idlab'] + '">' + arr_labs['laboratories'][i]['name'] + ' - ' + arr_labs['laboratories'][i]['description'] + '</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.length; i++) {
|
||||
for (let i = 0; i < arr_similary.length; i++) {
|
||||
str_arr_option += '<option value="' + arr_similary[i]['refid'] + '">' + arr_similary[i]['nameanalysisvoc'] + '</option>';
|
||||
}
|
||||
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 += '<option value="' + inserted_info['ref_id'] + '">' + inserted_info['name'] + '</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.length; i++) {
|
||||
for (let i = 0; i < arr_similary.length; i++) {
|
||||
str_arr_option += '<option value="' + arr_similary[i]['refid'] + '">' + arr_similary[i]['namecompoundsvocabulary'] + '</option>';
|
||||
}
|
||||
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 += '<option value="' + inserted_info['ref_id'] + '">' + inserted_info['name'] + '</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 @@
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user