function category_products_popup(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_products_popup.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_upload_popup(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_upload_form.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_add_form() { editPopup("open"); category_add_form_content(); } function category_add_form_content() { dojo.xhrPost ( { url: 'tools/shop/backend/admin/actions/category_add_form.php', handleAs: "text", load: function (data) { dojo.byId('popup').innerHTML = data; }, error: function (error) { console.error ('Error: ', error); } } ); } function close_category_add() { editPopup("close"); } function categories_show() { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_show.php", handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("category_show").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_add() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/category_add.php", handleAs: "text", form: 'form_add_category', error: function (error) { console.error ('Error: ', error); } } ); close_category_add(); categories_show(); categories_show(); } function category_alert_show() { editPopup("open"); category_move(); } function category_move() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/category_move.php", handleAs: "text", form: 'form_move_category', load: function (data) { dojo.byId('popup').innerHTML = data; }, error: function (error) { console.error ('Error: ', error); } } ); } function category_move_form() { editPopup("open"); category_form_move(); } function category_form_move() { dojo.xhrPost ( { url: 'tools/shop/backend/admin/actions/category_move_form.php', handleAs: "text", load: function (data) { dojo.byId('popup').innerHTML = data; }, error: function (error) { console.error ('Error: ', error); } } ); } function category_alert_close() { document.getElementById("popup").style.visibility = "hidden"; } function category_alert_close_reload() { document.getElementById("popup").style.visibility = "hidden"; categories_show(); } function category_delete(id) { editPopup("open"); category_delete_content(id); } function category_delete_content(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_delete_confirm.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_delete_confirm(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_delete.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_delete_reload() { editPopup("close"); categories_show(); } function category_move_up_down(direction,id) { editPopup("open"); category_move_up_down_content(direction,id); } function category_move_up_down_content(direction,id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_move_up_down.php?id=" + id + "&direction=" + direction, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_filters(id) { editPopup("open"); category_edit_filters(id); } function category_edit_filters(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_filters.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_add_filter(id) { var element = document.getElementById('filter_rules'); element.innerHTML = ""; dojo.xhrPost( { url: "tools/shop/backend/admin/actions/category_filters_add.php", handleAs: "text", timeout: 5000, form: 'form_add_filter', load: function(response, ioArgs) { category_edit_filters(id); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_filter_delete(category,filter) { var element = document.getElementById('filter_rules'); element.innerHTML = ""; dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_filters_delete.php?filter=" + filter, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { category_edit_filters(category); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_filter_edit(filter) { category_edit_rules_form(filter); } function category_rule_delete(cat,rule) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_rule_delete.php?rule=" + rule, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { category_edit_rules_form(cat); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_edit_rules_form(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_rules.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("filter_rules").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function get_rules_small_form(typeproperty,category) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_rules_small_form.php?id=" + category + "&typeproperty=" + typeproperty, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("rules_small_form").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_rules_edit(id) { dojo.xhrPost( { url: "tools/shop/backend/admin/actions/category_rules_edit.php", handleAs: "text", timeout: 5000, form: 'categories_rules_edit', load: function(response, ioArgs) { category_edit_rules_form(id); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_edit_popup(id) { editPopup("open"); category_edit_form_content(id); } function category_edit_form_content(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/category_edit_form.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function category_edit() { dojo.xhrPost( { url: "tools/shop/backend/admin/actions/category_edit.php", handleAs: "text", timeout: 5000, form: 'categories_edit', load: function(response, ioArgs) { category_delete_reload(); editPopup("close"); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function property_edit(propertyid) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/property_edit.php?propertyid=" + escape(propertyid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function show_producttypes() { location.href = 'index.php?link=shop_admin_producttypes'; // dojo.xhrGet( // { // url: "tools/shop/backend/admin/actions/types_show.php", // handleAs: "text", // timeout: 5000, // load: function(response, ioArgs) { // dojo.byId("content").innerHTML = response ; // return response; // }, // error: function(response, ioArgs) { // console.error("HTTP status code: ", ioArgs.xhr.status); // return response; // } // } // ); } function show_producttype(typeid) { dojo.xhrGet( { url: "tools/shop/backend/admin/show_producttype.php?id=" + escape(typeid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("content").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function type_add() { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/type_add.php", handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function type_save() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/type_save.php", handleAs: "text", // Name of the Form we want to submit form: 'form_save_type', load: function(response, ioArgs) { }, // Call this function if an error happened error: function (error) { console.error ('Error: ', error); } } ); } function type_edit(propertyid) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/type_edit.php?id=" + escape(propertyid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function property_add() { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/property_add.php", handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function property_save() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/property_save.php", handleAs: "text", load: function(response, ioArgs) { editPopup("close"); show_properties(); }, form: 'form_save_property', error: function (error) { console.error ('Error: ', error); } } ); } function type_property_add(typeid) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/type_property_add.php?typeid=" + escape(typeid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function type_property_save(typeid) { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/type_property_save.php", handleAs: "text", // Name of the Form we want to submit form: 'form_save_property', load: function(response, ioArgs) { }, // Call this function if an error happened error: function (error) { console.error ('Error: ', error); } } ); } function show_properties() { location.href="index.php?link=shop_admin_properties"; // dojo.xhrGet( // { // url: "tools/shop/backend/admin/actions/properties_show.php", // handleAs: "text", // timeout: 5000, // load: function(response, ioArgs) { // dojo.byId("content").innerHTML = response ; // return response; // }, // error: function(response, ioArgs) { // console.error("HTTP status code: ", ioArgs.xhr.status); // return response; // } // } // ); } function type_property_edit(propertyid) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/type_property_edit.php?propertyid=" + escape(propertyid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function property_select_edit(propertyid) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/property_select_edit.php?propertyid=" + escape(propertyid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function property_select_save() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/property_select_save.php", handleAs: "text", // Name of the Form we want to submit form: 'form_save_property_select', load: function(response, ioArgs) { editPopup("close"); // dojo.byId("popup").innerHTML = response ; // return response; show_properties(); }, // Call this function if an error happened error: function (error) { console.error ('Error: ', error); } } ); } function type_remove_check_confirm(typeid) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/type_remove_check_confirm.php?typeid=" + escape(typeid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function type_remove(typeid) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/type_remove_notice.php?typeid=" + escape(typeid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function type_remove_close_reload() { editPopup("close"); show_producttypes(); }function product_delete(id) { editPopup("open"); product_delete_content(id); } function product_delete_reload() { editPopup("close"); var sURL = unescape(window.location.pathname) + "?link=shop_admin_products"; window.location.href = sURL; } function product_delete_content(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_delete_confirm.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_delete_confirm(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_delete.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { show_products(); editPopup("close"); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_edit_save(id) { dojo.xhrPost( { url: "tools/shop/backend/admin/actions/product_cost_edit_save.php", handleAs: "text", timeout: 5000, form: "form_price_properties", load: function(response, ioArgs) { product_cost_edit(id); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_edit_form(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_edit_form.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function check_product_option(productid, propertyid, optionvalue, value) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_option_check.php?productid=" + escape(productid) + "&propertyid=" + escape(propertyid) + "&optionvalue=" + escape(optionvalue) + "&value=" + escape(value) , handleAs: "text", timeout: 5000, load: function(response, ioArgs) { return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_rule_delete(id,pc) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_cost_rule_delete.php?pc=" + escape(pc), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { product_cost_edit(id); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_save_permanent(id) { editPopup("open"); dojo.xhrPost( { url: "tools/shop/backend/admin/actions/product_cost_save_permanent.php", handleAs: "text", //timeout: 5000, form: 'others', load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; product_cost_popup(id); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_view(id,view) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_cost_edit.php?id=" + id + "&view=" + view, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_delete(id,prod) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_cost_delete.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { //dojo.byId("popup").innerHTML = response ; product_cost_popup(prod); return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_new_rule_save(id) { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/product_cost_new_rule_save.php", handleAs: "text", form: 'product_cost_new_rule_save_form', load: function(response, ioArgs) { product_cost_edit(id); return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function product_cost_new(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_cost_new.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_new_save() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/product_cost_new_save.php", handleAs: "text", form: 'form_product_cost_new', load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function product_cost_popup(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_cost_overview.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_cost_edit(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_cost_edit.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function show_products() { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/products_show.php", handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("content").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_upload_popup_intro(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_upload_form_intro.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_upload_popup(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_upload_form.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_add1(pid) { editPopup("open"); if (pid) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_add1.php?pid=" + escape(pid), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } else { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_add1.php", handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } } function product_add2() { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_add2.php", handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_add3(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_add3.php?pid=" + escape(id), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_save1() { editPopup("open"); dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/product_save.php", handleAs: "text", form: 'form_save_type', load: function(response, ioArgs) { product_add2(); show_products(); return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function product_save2() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/product_save.php", handleAs: "text", form: 'form_save_type', load: function(response, ioArgs) { product_add2(); show_products(); return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function product_properties_save () { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/product_properties_save.php", handleAs: "text", form: 'form_save_product_properties', load: function(response, ioArgs) { show_products(); return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function product_categories_popup(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_categories_popup.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function product_category_add(productid, categoryid, val) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/product_category_add.php?productid=" + escape(productid) + "&categoryid=" + escape(categoryid) + "&val=" + escape(val), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("res_" + productid).innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); }function reference_add_form() { editPopup("open"); reference_add_form_content(); } function reference_add_form_content() { dojo.xhrPost ( { url: 'tools/shop/backend/admin/actions/reference_add_form.php', handleAs: "text", load: function (response, ioArgs) { dojo.byId('popup').innerHTML = response; return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function reference_edit_popup(id) { editPopup("open"); reference_edit_form_content(id); } function reference_edit_form_content(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/reference_edit_form.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function reference_edit() { dojo.xhrPost( { url: "tools/shop/backend/admin/actions/reference_edit.php", handleAs: "text", timeout: 5000, form: 'references_edit', load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function reference_add() { dojo.xhrPost ( { url: "tools/shop/backend/admin/actions/reference_add.php", handleAs: "text", form: 'form_add_reference', load: function(response, ioArgs) { reference_alert_close(); reference_refresh(); return response; }, error: function (error) { console.error ('Error: ', error); } } ); } function reference_alert_close() { editPopup("close"); } function reference_refresh() { editPopup("close"); var sURL = unescape(window.location.pathname) + "?link=shop_admin_references"; window.location.href = sURL; } function reference_delete(id) { editPopup("open"); reference_delete_content(id); } function reference_delete_content(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/reference_delete_confirm.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function reference_delete_confirm(id) { dojo.xhrGet( { url: "tools/shop/backend/admin/actions/reference_delete.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); } function reference_upload_popup(id) { editPopup("open"); dojo.xhrGet( { url: "tools/shop/backend/admin/actions/reference_upload_form.php?id=" + id, handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("popup").innerHTML = response ; return response; }, error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } } ); }function editPopup(action) { if (action == 'open') { document.getElementById("popup").style.visibility = "visible"; } else if (action == 'close') { document.getElementById("popup").style.visibility = "hidden"; } }