|
|
@@ -181,6 +181,7 @@ function api_resp(xhr,extra) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
else if (extra["ui_function"] === "reissue_card.find") {
|
|
|
if (dat["result"] === "success") {
|
|
|
update_message("ui.reissue_card.message", "success", "")
|
|
|
@@ -191,28 +192,37 @@ function api_resp(xhr,extra) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- else if (extra["ui_function"] === "recycle_card.update") {
|
|
|
-
|
|
|
|
|
|
+ else if (extra["ui_function"] === "recycle_card.update") {
|
|
|
if (dat["result"] === "success") {
|
|
|
update_message("ui.recycle_card.message", "success", "")
|
|
|
- //recycle_card_fill(dat);
|
|
|
}
|
|
|
else {
|
|
|
update_message("ui.recycle_card.message", "error", dat.api_comment);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- else if (extra["ui_function"] === "add_card_block.add") {
|
|
|
|
|
|
+ else if (extra["ui_function"] === "add_card_block.add") {
|
|
|
if (dat["result"] === "success") {
|
|
|
update_message("ui.add_card_block.message", "success", "loaded");
|
|
|
}
|
|
|
else {
|
|
|
update_message("ui.add_card_block.message", "error", dat.api_comment);
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ else if (extra["ui_function"] === "ui_search.update") {
|
|
|
|
|
|
+ console.log("search result:", dat);
|
|
|
|
|
|
+ if (dat["result"] === "success") {
|
|
|
+ update_message("ui.search.message", "success", "loaded");
|
|
|
+ ui_search_fill(dat);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ update_message("ui.search.message", "error", dat.api_comment);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
else if (extra["ui_function"] === "group") {
|
|
|
@@ -873,6 +883,30 @@ function reissue_card_fill(card_data) {
|
|
|
// --------------------------------------
|
|
|
// --------------------------------------
|
|
|
|
|
|
+function ui_search(search_type) {
|
|
|
+ var txt = _get_input_field( "ui.search." + search_type);
|
|
|
+
|
|
|
+ console.log(">>>", search_type, txt);
|
|
|
+
|
|
|
+ var dat = {
|
|
|
+ "api_function":"Search",
|
|
|
+ "ui_function":"ui_search.update",
|
|
|
+ "data": [
|
|
|
+ ["search_type", search_type],
|
|
|
+ ["search_string", txt]
|
|
|
+ ]};
|
|
|
+ api_req(dat);
|
|
|
+}
|
|
|
+
|
|
|
+function ui_search_fill(data) {
|
|
|
+}
|
|
|
+
|
|
|
+// --------------------------------------
|
|
|
+// --------------------------------------
|
|
|
+// --------------------------------------
|
|
|
+// --------------------------------------
|
|
|
+// --------------------------------------
|
|
|
+
|
|
|
function manage_card_redirect_manage_user() {
|
|
|
var userid = _get_input_field("ui.manage_card.userid");
|
|
|
_redirect( "manage_user?" + "action=get&userid=" + userid);
|
|
|
@@ -1263,6 +1297,12 @@ function admin_api_init() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ else if (_func === "search") {
|
|
|
+ _attach_button( "ui.search.find_card", (function() { return ui_search("card"); }) );
|
|
|
+ _attach_button( "ui.search.find_user", (function() { return ui_search("user"); }) );
|
|
|
+ _attach_button( "ui.search.find_admin", (function() { return ui_search("admin"); }) );
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|