|
|
@@ -534,10 +534,10 @@ $(document).ready(function () {
|
|
|
|
|
|
var search_output = {};
|
|
|
var search_word = ""
|
|
|
- $("#advanced-search-button").on("click", function (e) {
|
|
|
+ $("#keep-search-button").on("click", function (e) {
|
|
|
show_progress_bar(true);
|
|
|
update_progress_bar();
|
|
|
-
|
|
|
+
|
|
|
$.ajax({
|
|
|
url: "./script/php/get_search_list.php",
|
|
|
data: {
|
|
|
@@ -568,12 +568,90 @@ $(document).ready(function () {
|
|
|
$("#search-filter").slideUp(200);
|
|
|
$("#filter-slide").toggleClass("fa-sort-desc fa-sort-up");
|
|
|
}
|
|
|
- $("#search-filter-panel-body .btn-default").toggleClass("btn-primary btn-default");
|
|
|
+ $("#search-filter-panel .btn-default").toggleClass("btn-primary btn-default");
|
|
|
show_filter(filter_base_data);
|
|
|
show_progress_bar(false);
|
|
|
+ $("#keep-search-button").css("display", "none");
|
|
|
+ $("#warning-text").css("display", "none");
|
|
|
+ $("#advanced-search-button").css("display", "inline-block");
|
|
|
+ $("#search-filter-panel").css("display", "block");
|
|
|
}, 0);
|
|
|
});
|
|
|
|
|
|
+ $("#advanced-search-button").on("click", function (e) {
|
|
|
+ count = {};
|
|
|
+ $.ajax({
|
|
|
+ url: "./script/php/sql_search_count.php",
|
|
|
+ data: {
|
|
|
+ project_id: [''].concat(search_data["project"]),
|
|
|
+ type_id: [''].concat(search_data["type"]),
|
|
|
+ notes_name: [''].concat(search_data["notes"].filter(element => {return element !== undefined;})),
|
|
|
+ search: $("#search-word").val(),
|
|
|
+ },
|
|
|
+ type: "GET",
|
|
|
+ dataType: "json",
|
|
|
+ contentType: "application/json",
|
|
|
+ async: false
|
|
|
+ }).success(function (response) {
|
|
|
+ displayDetail(true);
|
|
|
+ count = response;
|
|
|
+ }).error(function(error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+
|
|
|
+ search_total_count = count[0]["total"] + count[1]["total"];
|
|
|
+ if(search_total_count > 1000) {
|
|
|
+ $("#keep-search-button").css("display", "inline-block");
|
|
|
+ $("#warning-text").css("display", "inline-block");
|
|
|
+ $("#advanced-search-button").css("display", "none");
|
|
|
+ } else {
|
|
|
+ show_progress_bar(true);
|
|
|
+ update_progress_bar();
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: "./script/php/get_search_list.php",
|
|
|
+ data: {
|
|
|
+ project_id: [''].concat(search_data["project"]),
|
|
|
+ type_id: [''].concat(search_data["type"]),
|
|
|
+ notes_name: [''].concat(search_data["notes"].filter(element => {return element !== undefined;})),
|
|
|
+ search: $("#search-word").val(),
|
|
|
+ },
|
|
|
+ type: "GET",
|
|
|
+ dataType: "json",
|
|
|
+ contentType: "application/json",
|
|
|
+ async: false
|
|
|
+ }).success(function (response) {
|
|
|
+ displayDetail(true);
|
|
|
+ search_output = response;
|
|
|
+ search_word = $("#search-word").val();
|
|
|
+ filter_base_data = search_data;
|
|
|
+ }).error(function(error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ draw_datatable(search_output);
|
|
|
+ e.preventDefault();
|
|
|
+ $.magnificPopup.close();
|
|
|
+
|
|
|
+ if($("#search-filter").css("display") != "none") {
|
|
|
+ $("#search-filter").slideUp(200);
|
|
|
+ $("#filter-slide").toggleClass("fa-sort-desc fa-sort-up");
|
|
|
+ }
|
|
|
+ $("#search-filter-panel .btn-default").toggleClass("btn-primary btn-default");
|
|
|
+ show_filter(filter_base_data);
|
|
|
+ show_progress_bar(false);
|
|
|
+ $("#search-filter-panel").css("display", "block");
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#advancedSearch .panel-body input").on("change", function() {
|
|
|
+ $("#keep-search-button").css("display", "none");
|
|
|
+ $("#warning-text").css("display", "none");
|
|
|
+ $("#advanced-search-button").css("display", "inline-block");
|
|
|
+ });
|
|
|
+
|
|
|
function draw_datatable(search_output) {
|
|
|
table.clear().draw();
|
|
|
|
|
|
@@ -721,17 +799,22 @@ $(document).ready(function () {
|
|
|
// $("#progress-bars").parent().css("display", "none");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- $("#filter-slide").on("click", function (e) {
|
|
|
- if($("#search-filter").css("display") == "block"){
|
|
|
- $("#search-filter").slideUp(200);
|
|
|
- } else {
|
|
|
- $("#search-filter").slideDown(200);
|
|
|
- }
|
|
|
- $("#filter-slide").toggleClass("fa-sort-desc fa-sort-up")
|
|
|
+
|
|
|
+ $("#search-filter-panel").hoverIntent({
|
|
|
+ sensitivity: 50,
|
|
|
+ interval: 200,
|
|
|
+ over: function( e ) {
|
|
|
+ $("#search-filter").slideDown(200);
|
|
|
+ $("#filter-slide").toggleClass("fa-sort-desc fa-sort-up")
|
|
|
+ },
|
|
|
+ timeout: 200,
|
|
|
+ out: function( e ) {
|
|
|
+ $("#search-filter").slideUp(200);
|
|
|
+ $("#filter-slide").toggleClass("fa-sort-desc fa-sort-up")
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- $("#search-filter-panel-body button").on("click", function (e) {
|
|
|
+ $("#search-filter-panel button").on("click", function (e) {
|
|
|
$(this).toggleClass("btn-primary btn-default");
|
|
|
|
|
|
click_option = get_filter_click("btn-primary");
|