var notification_sound = new Audio(__base_http+'/audio/notification.mp3'); notification_sound.volume = 1; function lostpassword(btn){ var $this = $(btn); var $form = $("div[data-name='login']"); var email = jQuery.trim($form.find("input[name='email']").val()); if( email == '' ){ show_warning(getLang('LOGIN_MISSING_FIELDS')); return false; } $this.attr("disabled", "disabled"); getAjaxData({ op : "request", item: "lost-password", email:email }, function(response){ $this.attr("disabled", null); if(response.statustext == "error"){ show_error(response.data); }else{ show_success(response.data); setTimeout(function(){ window.top.location = '/index.php'; }, 2000); } }); return false; } function manage_account(uID, btn){ var $this = $(btn); $this.attr("disabled", "disabled"); getAjaxData({ op:"fetch", item:"view", page:"manage-account", uID:uID }, function(response){ if(response.statustext == "error"){ show_error(response.data); $this.attr("disabled", null); return false; } }); return false; } function mark_as_read_all_notifications(btn){ var $this = $(btn); getAjaxData({ op : "update", item: "notifications", status: "read-all" }, function(response){ $this.attr("disabled", null); if(response.status == "error"){ show_error("Παρουσιάστηκε σφάλμα κατά την αποστολή του αιτήματός σας. Παρακαλούμε δοκιμάστε ξανά. ["+response.data+"]"); }else{ var table = $('#tbl-new-notifications').DataTable(); table.clear().draw(); refresh_notifications(); } }); return false; } function mark_as_read_notification(btn, nID){ var $this = $(btn); getAjaxData({ op : "update", item: "notifications", status: "read-this", nID:nID }, function(response){ $this.attr("disabled", null); if(response.status == "error"){ alert("Παρουσιάστηκε σφάλμα σκατά την αποστολή του αιτήματός σας. Παρακαλούμε δοκιμάστε ξανά. ["+response.data+"]"); }else{ show_success("Η ειδοποίηση αρχειοθετήθηκε."); refresh_notifications(); var table = $('#tbl-new-notifications').DataTable(); table.clear().draw(); } }); return false; } function refresh_notifications(){ var _current = parseInt( $("#noticePanel span.notification-count").html() ); getAjaxData({ op : "fetch", item: "notification-panel" }, function(response){ if(response.statustext == "error"){ show_error("Παρουσιάστηκε σφάλμα σκατά την αποστολή του αιτήματός σας. Παρακαλούμε δοκιμάστε ξανά. ["+response.data+"]"); }else{ $("#noticePanel").html(response.data); var _new = parseInt( $("#noticePanel span.notification-count").html() ); if(_new > _current){ notification_sound.volume = 1; notification_sound.play(); notification_sound.play(); } } }); return false; } function proegkriseis_katastimaton(){ getAjaxData({ op : "fetch", item: "view", page: "proegkriseis-katastimaton-dashboard" }, function(response){ if(response.statustext == "error"){ show_error("Παρουσιάστηκε σφάλμα κατά την αποστολή του αιτήματός σας. Παρακαλούμε δοκιμάστε ξανά. ["+response.data+"]"); }else{ $("#main_view").html(response.data); } }); return false; } function adeiodotiseis_katastimaton(){ getAjaxData({ op : "fetch", item: "view", page: "adeia-katastimaton-dashboard" }, function(response){ if(response.statustext == "error"){ show_error("Παρουσιάστηκε σφάλμα κατά την αποστολή του αιτήματός σας. Παρακαλούμε δοκιμάστε ξανά. ["+response.data+"]"); }else{ $("#main_view").html(response.data); } }); return false; } function show_warning(message, title){ if(typeof(title) == "undefined"){ title = "Έλεγχος δεδομένων"; } $.gritter.add({ title: title, text: message, class_name: 'with-icon exclamation-circle warning' }); } function show_error(message, title){ if(typeof(title) == "undefined"){ title = "Σφάλμα εκτέλεσης λειτουργίας"; } $.gritter.add({ title: title, text: message, class_name: 'with-icon times-circle danger' }); } function show_success(message, title){ if(typeof(title) == "undefined"){ title = "Επιτυχής εκτέλεση λειτουργίας"; } $.gritter.add({ title: title, text: message, class_name: 'with-icon check-circle success' }); } function view_notifications(){ getAjaxData({ op : "fetch", item: "view", page: "manage-notifications" }, function(response){ if(response.statustext == "error"){ show_error(response.data); }else{ $("#main_view").html(response.data); } }); return false; } function get_system_protocol(){ getAjaxData({ op : "fetch", item: "view", page: "protocol" }, function(response){ if(response.statustext == "error"){ show_error(response.data); }else{ $("#main_view").html(response.data); } }); } $(document).on("modal.dialog.is.loaded", function(event){ var $target = $(event.target); if($target.length == 1){ $target.find(".modal-content"); var _data = $target.attr("data-data"); if($target.attr("id") == "modal-window-info"){ var info = 1; }else{ var info = 0; } /* var _z = 25000; $target.css("z-index", _z); $(".modal").each(function(idx, elem){ var $elem = $(elem); if($elem.css("display") == "block" && $elem.attr("id") !== $target.attr("id")){ _z -= 10; $elem.css("z-index", _z); } }); _z = 25000; */ if($target.attr("data-src") == "show-user-profile"){ getAjaxData({op:"fetch", item:"view", page:"manage-account", uID:_data, personal_info_only:info}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "update-user-pass"){ getAjaxData({op:"fetch", item:"view", page:"update-user-pass", uID:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "new-user"){ getAjaxData({op:"fetch", item:"view", page:"new-user"}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "manage-user-account"){ getAjaxData({op:"fetch", item:"view", page:"manage-account", uID:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "new-aitisi-proegkrisis-gia-katastima"){ getAjaxData({op:"fetch", item:"view", page:"new-aitisi-proegkrisis-gia-katastima", uID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "neo-katastima-xristi"){ getAjaxData({op:"fetch", item:"view", page:"neo-katastima-xristi", undefined:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "edit-katastima-xristi"){ getAjaxData({op:"fetch", item:"view", page:"edit-katastima-xristi", katID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "info-katastima-xristi"){ getAjaxData({op:"fetch", item:"view", page:"info-katastima-xristi", data_katastimatos:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "delete-katastima-xristi"){ getAjaxData({op:"fetch", item:"view", page:"delete-katastima-xristi", katID:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "neo-nomiko-prosopo-xristi"){ getAjaxData({op:"fetch", item:"view", page:"neo-nomiko-prosopo-xristi", katID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "edit-nomiko-prosopo-xristi"){ getAjaxData({op:"fetch", item:"view", page:"edit-nomiko-prosopo-xristi", npID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "info-nomiko-prosopo-xristi"){ getAjaxData({op:"fetch", item:"view", page:"info-nomiko-prosopo-xristi", nomiko_prosopo_data:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "delete-nomiko-prosopo-xristi"){ getAjaxData({op:"fetch", item:"view", page:"delete-nomiko-prosopo-xristi", npID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "show-aitisi-proegkrisis-step-options"){ getAjaxData({op:"fetch", item:"view", page:"show-aitisi-proegkrisis-step-options", sID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "view-proegkrisi-katastimatos-docs"){ getAjaxData({op:"fetch", item:"view", page:"view-aitisi-proegkrisis-doc", pID:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "show-diadikasia-proegkrisis-info"){ getAjaxData({op:"fetch", item:"view", page:"diadikasia-proegkrisis-info", info:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "new-aitisi-egkrisis-adeias-gia-katastima"){ getAjaxData({op:"fetch", item:"view", page:"new-aitisi-egkrisis-adeias-gia-katastima", info:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "show-aitisi-adeias-katastimatos-step-options"){ getAjaxData({op:"fetch", item:"view", page:"show-aitisi-adeias-katastimatos-step-options", sID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "view-adeia-katastimatos-docs"){ getAjaxData({op:"fetch", item:"view", page:"view-adeia-katastimatos-docs", pID:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "check-service-constants"){ getAjaxData({op:"fetch", item:"view", page:"check-service-constants", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "fms-edit-marker"){ getAjaxData({op:"fetch", item:"view", page:"fms-edit-school-form-marker", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-edit-school") { getAjaxData({ op: "fetch", item: "view", page: "fms-edit-school-form", schoolID: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-neo-eidos-paraggelias"){ getAjaxData({op:"fetch", item:"view", page:"fms-neo-eidos-paraggelias", data:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "fms-rename-eidos-paraggelias"){ getAjaxData({op:"fetch", item:"view", page:"fms-update-eidos-paraggelias", eidosID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "fms-change-type-icon"){ getAjaxData({op:"fetch", item:"view", page:"fms-change-type-icon", eidosID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "fms-neo-eidos-episkevis"){ getAjaxData({op:"fetch", item:"view", page:"fms-neo-eidos-episkevis", data:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "fms-rename-eidos-episkevis"){ getAjaxData({op:"fetch", item:"view", page:"fms-update-eidos-episkevis", eidosID:_data}, function(res){ $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if($target.attr("data-src") == "fms-nea-paraggelia"){ getAjaxData({op:"fetch", item:"view", page:"fms-add-paraggelia", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-nea-episkevi"){ getAjaxData({op:"fetch", item:"view", page:"fms-add-episkevi", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-view-service-info"){ getAjaxData({op:"fetch", item:"view", page:"fms-view-service-info", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-action-for-service"){ getAjaxData({op:"fetch", item:"view", page:"fms-action-for-service", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-view-episkevi-info"){ getAjaxData({op:"fetch", item:"view", page:"service-fixmyschool-view-episkevi-info", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-action-for-episkeves"){ getAjaxData({op:"fetch", item:"view", page:"service-fixmyschool-action-for-episkevi", data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } ///////////////////////////////////////////// ILIOUPOLI if ($target.attr("data-src") == "fms-edit-marker-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-edit-school-form-marker", data: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-neo-eidos-paraggelias-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-neo-eidos-paraggelias", data: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-rename-eidos-paraggelias-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-update-eidos-paraggelias", eidosID: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-contract-item-schools-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-contract-item-schools", ci_id: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-contract-item-school-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-contract-item-school", details: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-change-type-icon-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-change-type-icon", eidosID: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-neo-eidos-episkevis-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-neo-eidos-episkevis", data: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-rename-eidos-episkevis-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-update-eidos-episkevis", eidosID: _data }, function (res) { $target.find(".modal-content").html(res.data); check_for_changes_at_modal_window(); }); return false; } if ($target.attr("data-src") == "fms-nea-paraggelia-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-paraggelia", data: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-nea-episkevi-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-episkevi", data: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-add-service-item-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-service-item", sID: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-view-service-info-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-view-service-info", data: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-action-for-service-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-action-for-service", data: _data }, function (res) { $target.find(".modal-content").html(res.data); fms_get_service_items(_data, true); }); return false; } if ($target.attr("data-src") == "fms-new-home-order-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-home-order" }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-new-home-service-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-home-service" }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-view-episkevi-info-il") { getAjaxData({ op: "fetch", item: "view", page: "service-fixmyschool-view-episkevi-info", data: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-action-for-episkeves-il") { getAjaxData({ op: "fetch", item: "view", page: "service-fixmyschool-action-for-episkevi", data: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-add-executive-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-view-executive" }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-update-executive-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-view-executive", exe_id: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-add-service-item-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-service-item", sID: _data }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-new-home-order-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-home-order" }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-new-home-service-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-home-service" }, function (res) { $target.find(".modal-content").html(res.data); }); return false; } if ($target.attr("data-src") == "fms-open-service-history-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-service-history", data: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-add-contract-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-contract" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-add-contract-item-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-contract-item", con_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-edit-contract-il") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-contract", con_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } ///////////////////////////////////////////// END ILIOUPOLI if($target.attr("data-src") == "view-system-source"){ getAjaxData({op:"fetch", item:"view", page:"view-system-source", req_data:_data}, function(res){ $target.find(".modal-content").html(res.data); }); return false; } if($target.attr("data-src") == "fms-open-service-history"){ getAjaxData({op:"fetch", item:"view", page:"fms-service-history", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "mw-add-marina"){ getAjaxData({op:"fetch", item:"view", page:"mw-add-marina", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-edit-marina"){ getAjaxData({op:"fetch", item:"view", page:"mw-edit-marina", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-add-marina-thesi-category"){ getAjaxData({op:"fetch", item:"view", page:"mw-add-marina-thesi-category", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-add-marina-thesi-available-status"){ getAjaxData({op:"fetch", item:"view", page:"mw-add-marina-thesi-available-status", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-edit-marina-thesi-category"){ getAjaxData({op:"fetch", item:"view", page:"mw-edit-marina-thesi-category", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-edit-marina-thesi-status"){ getAjaxData({op:"fetch", item:"view", page:"mw-edit-marina-thesi-status", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-edit-marina-thesi-data"){ getAjaxData({op:"fetch", item:"view", page:"mw-edit-marina-thesi-data", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if ($target.attr("data-src") == "mw-update-marina-thesi-data") { getAjaxData({ op: "fetch", item: "view", page: "mw-update-marina-thesi-data", data: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-add-marina-notification-by-fylaka"){ getAjaxData({op:"fetch", item:"view", page:"mw-add-marina-notification-by-fylaka", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-edit-marina-notification-by-fylaka"){ getAjaxData({op:"fetch", item:"view", page:"mw-edit-marina-notification-by-fylaka", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-add-marina-notification-from-fylaka"){ getAjaxData({op:"fetch", item:"view", page:"mw-add-marina-notification-from-fylaka", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-view-marina-thesi-notification"){ getAjaxData({op:"fetch", item:"view", page:"mw-view-marina-thesi-notification", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "mw-edit-marina-map"){ getAjaxData({op:"fetch", item:"view", page:"mw-edit-marina-map", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Marinas Watch"); } }); return false; } if($target.attr("data-src") == "cm-add-cemetery"){ getAjaxData({op:"fetch", item:"view", page:"cm-add-cemetery", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-edit-cemetery"){ getAjaxData({op:"fetch", item:"view", page:"cm-edit-cemetery", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-edit-cemetery-map"){ getAjaxData({op:"fetch", item:"view", page:"cm-edit-cemetery-map", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-add-cemetery-thesi-category"){ getAjaxData({op:"fetch", item:"view", page:"cm-add-cemetery-thesi-category", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-edit-cemetery-thesi-category"){ getAjaxData({op:"fetch", item:"view", page:"cm-edit-cemetery-thesi-category", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-add-cemetery-thesi-available-status"){ getAjaxData({op:"fetch", item:"view", page:"cm-add-cemetery-thesi-available-status", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-edit-cemetery-thesi-status"){ getAjaxData({op:"fetch", item:"view", page:"cm-edit-cemetery-thesi-status", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-edit-cemetery-thesi-data"){ getAjaxData({op:"fetch", item:"view", page:"cm-edit-cemetery-thesi-data", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-add-cemetery-ektafi-category"){ getAjaxData({op:"fetch", item:"view", page:"cm-add-cemetery-ektafi-category", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-edit-cemetery-ektafi-category"){ getAjaxData({op:"fetch", item:"view", page:"cm-edit-cemetery-ektafi-category", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-ektafi-from-cemetery-thesi"){ getAjaxData({op:"fetch", item:"view", page:"cm-ektafi-from-cemetery-thesi", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "get-cemetery-thesi-history-data"){ getAjaxData({op:"fetch", item:"view", page:"get-cemetery-thesi-history-data", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "view-cemetery-history-info"){ getAjaxData({op:"fetch", item:"view", page:"view-cemetery-history-info", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "search-cemetery-person-dialog"){ getAjaxData({op:"fetch", item:"view", page:"search-cemetery-person-dialog", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "cm-view-cemetery-aitisi-proteraiotitas-data"){ getAjaxData({op:"fetch", item:"view", page:"cm-view-cemetery-aitisi-proteraiotitas-data", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "CemeteryWatch"); } }); return false; } if($target.attr("data-src") == "fmc-manage-eidos-anaforas-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-manage-eidos-anaforas-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-edit-kyria-katigoria-anaforas"){ getAjaxData({op:"fetch", item:"view", page:"fmc-edit-kyria-katigoria-anaforas", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-add-ypokatigoria-anaforas-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-add-ypokatigoria-anaforas-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-edit-ypokatigoria-anaforas-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-edit-ypokatigoria-anaforas-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-edit-ypokatigoria-anaforas-anathesi-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-edit-ypokatigoria-anaforas-anathesi-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-open-locationmap-anaforas-politi-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-open-locationmap-anaforas-politi-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-open-anafora-politi-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-open-anafora-politi-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if ($target.attr("data-src") == "fmc-relate-requests") { getAjaxData({ op: "fetch", item: "view", page: "fmc-relate-requests", aID: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-new-paratiriseis-sto-aitima-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-new-paratiriseis-sto-aitima-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "fmc-open-workflow-anaforas-politi-view"){ getAjaxData({op:"fetch", item:"view", page:"fmc-open-workflow-anaforas-politi-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMyCity"); } }); return false; } if($target.attr("data-src") == "apo-neo-stoixeio-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-neo-stoixeio-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-edit-title-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-title-stoixeiou-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-edit-icon-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-icon-stoixeiou-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-nea-parametros-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-nea-parametros-stoixeiou-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-edit-parametro-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-parametro-stoixeiou-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-open-info-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-open-info-stoixeiou-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-edit-filiki-onomasia-siskevis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-filiki-onomasia-siskevis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-edit-type-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-type-stoixeiou-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-data-omadas-stoixeion-katagrafis-view"){ console.log(_data); getAjaxData({op:"fetch", item:"view", page:"apo-data-omadas-stoixeion-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-open-info-group-stoixeion-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-open-info-group-stoixeion-katagrafis-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-neo-software-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-neo-software-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if($target.attr("data-src") == "apo-edit-software-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-software-view", data:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Αποτυπώσεις"); } }); return false; } if ($target.attr("data-src") == "apo-stats-sum") { getAjaxData({ op: "fetch", item: "view", page: "apo-stats-sum", data: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityPoints"); } }); return false; } if ($target.attr("data-src") == "apo-stats-stats") { getAjaxData({ op: "fetch", item: "view", page: "apo-stats-stats", data: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityPoints"); } }); return false; } if($target.attr("data-src") == "rou-edit-title-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-title-stoixeiou-katagrafis-view", data:_data, service:"routes"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "City Routes"); } }); return false; } if($target.attr("data-src") == "rou-edit-icon-stoixeiou-katagrafis-view"){ getAjaxData({op:"fetch", item:"view", page:"apo-edit-icon-stoixeiou-katagrafis-view", data:_data, service:"routes"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "City Routes"); } }); return false; } if($target.attr("data-src") == "kat-view-entity") { getAjaxData({op:"fetch", item:"view", page:"kat-view-entity", entID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-add-entity") { getAjaxData({op:"fetch", item:"view", page:"kat-view-entity"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "cn-view-category") { getAjaxData({op:"fetch", item:"view", page:"cn-view-category", artcID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Citynews"); } }); return false; } if($target.attr("data-src") == "cn-add-category") { getAjaxData({op:"fetch", item:"view", page:"cn-view-category"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Citynews"); } }); return false; } if ($target.attr("data-src") == "cn-view-article") { getAjaxData({ op: "fetch", item: "view", page: "cn-view-article", artID: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citynews"); } }); return false; } if ($target.attr("data-src") == "cn-read-article") { getAjaxData({ op: "fetch", item: "view", page: "cn-read-article", artID: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citynews"); } }); return false; } if ($target.attr("data-src") == "cn-add-article") { getAjaxData({ op: "fetch", item: "view", page: "cn-view-article" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citynews"); } }); return false; } if ($target.attr("data-src") == "ccert-new-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-add-request" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-issue-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-issue-request", ca_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-edit-certificate-category") { getAjaxData({ op: "fetch", item: "view", page: "ccert-view-certificate-category", cc_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-edit-certificate-category-template") { getAjaxData({ op: "fetch", item: "view", page: "ccert-view-certificate-category-template", cc_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-add-certificate-category") { getAjaxData({ op: "fetch", item: "view", page: "ccert-view-certificate-category" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-upload-digitally-signed") { getAjaxData({ op: "fetch", item: "view", page: "ccert-upload-digitally-signed", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-correct-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-correct-request", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-view-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-view-request", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-reject-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-reject-request", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-protocol-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-protocol-request", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-wait-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-wait-request", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-return-to-created-request") { getAjaxData({ op: "fetch", item: "view", page: "ccert-return-to-created-request", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if ($target.attr("data-src") == "ccert-issue-modal") { getAjaxData({ op: "fetch", item: "view", page: "ccert-issue-modal", ca_id: _data}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "CityCertify"); } }); return false; } if($target.attr("data-src") == "kat-add-shop") { getAjaxData({op:"fetch", item:"view", page:"kat-view-shop"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-add-application") { getAjaxData({op:"fetch", item:"view", page:"kat-view-application"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-edit-shop") { getAjaxData({op:"fetch", item:"view", page:"kat-view-shop", sID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-submit-application-dom") { getAjaxData({op:"fetch", item:"view", page:"kat-submit-application-dom"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if ($target.attr("data-src") == "kat-submit-application-dom-fo") { getAjaxData({ op: "fetch", item: "view", page: "kat-submit-application-dom-fo", details: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Καταστήματα"); } }); return false; } if ($target.attr("data-src") == "kat-submit-application-ps") { getAjaxData({ op: "fetch", item: "view", page: "kat-submit-application-ps" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-shop-history") { getAjaxData({op:"fetch", item:"view", page:"kat-shop-history", sID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-dom-approve") { getAjaxData({op:"fetch", item:"view", page:"kat-dom-approve", sID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if ($target.attr("data-src") == "kat-ps-approve") { getAjaxData({ op: "fetch", item: "view", page: "kat-ps-approve", sID: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-submit-notification") { getAjaxData({op:"fetch", item:"view", page:"kat-submit-notification", sID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if ($target.attr("data-src") == "kat-shop-stop") { getAjaxData({ op: "fetch", item: "view", page: "kat-shop-stop", details: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Καταστήματα"); } }); return false; } if ($target.attr("data-src") == "kat-cancel-ps") { getAjaxData({ op: "fetch", item: "view", page: "kat-cancel-ps", details: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "kat-notify-ps") { getAjaxData({op:"fetch", item:"view", page:"kat-notify-ps", sID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Καταστήματα"); } }); return false; } if($target.attr("data-src") == "lang-view-lang") { getAjaxData({op:"fetch", item:"view", page:"lang-view-lang", langID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Γλώσσες"); } }); return false; } if($target.attr("data-src") == "lang-load-file") { getAjaxData({op:"fetch", item:"view", page:"lang-load-file", langID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Γλώσσες"); } }); return false; } if($target.attr("data-src") == "lang-insert-lang") { getAjaxData({op:"fetch", item:"view", page:"lang-view-lang"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "Γλώσσες"); } }); return false; } if($target.attr("data-src") == "fms-new-asset-type") { getAjaxData({op:"fetch", item:"view", page:"fms-new-asset-type"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-add-asset") { getAjaxData({op:"fetch", item:"view", page:"fms-add-asset"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-add-vendor") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-vendor" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-add-contract") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-contract" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-add-contract-item") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-contract-item", con_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-edit-contract") { getAjaxData({ op: "fetch", item: "view", page: "fms-add-contract", con_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-new-property-doc") { getAjaxData({op:"fetch", item:"view", page:"fms-new-property-doc", scID:_data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-edit-asset") { getAjaxData({op:"fetch", item:"view", page:"fms-add-asset", aID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "fms-edit-vendor") { getAjaxData({ op: "fetch", item: "view", page: "fms-edit-vendor", ven_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-view-school-assets") { getAjaxData({op:"fetch", item:"view", page:"fms-view-school-assets", scID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-view-school-property-docs") { getAjaxData({op:"fetch", item:"view", page:"fms-view-school-property-docs", scID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-view-school-property-docs-r") { getAjaxData({op:"fetch", item:"view", page:"fms-view-school-property-docs", scID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-edit-asset-type") { getAjaxData({op:"fetch", item:"view", page:"fms-edit-asset-type", atID: _data}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if($target.attr("data-src") == "fms-school-options-view") { getAjaxData({op:"fetch", item:"view", page:"fms-school-options-view"}, function(res){ if(res.statustext === "success"){ $target.find(".modal-content").html(res.data); }else{ show_error(res.data, "FixMySchool"); } }); return false; } if ($target.attr("data-src") == "cl-add-store-category") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-store-category"}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-edit-store-category") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-store-category", sc_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-add-store") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-store"}, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-edit-store") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-store", store_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-add-offer") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-offer" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-edit-offer") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-offer", offer_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-add-event") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-event" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-edit-event") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-event", se_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-add-municipality-event") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-municipality-event" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-edit-municipality-event") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-municipality-event", me_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-add-municipality-event-category") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-municipality-event-category" }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } if ($target.attr("data-src") == "cl-edit-municipality-event-category") { getAjaxData({ op: "fetch", item: "view", page: "cl-view-municipality-event-category", mec_id: _data }, function (res) { if (res.statustext === "success") { $target.find(".modal-content").html(res.data); } else { show_error(res.data, "Citylife"); } }); return false; } show_error("Unknown modal option", "Modal window handler"); }else{ show_error("Unknown modal window", "Modal window handler"); } }); $(document).on("hide.bs.modal", function(event){ var $target = $(event.target); if($target.attr("id") == "modal-window" && $target.data('src') !== 'mw-edit-marina-thesi-data'){ if($target.attr("data-dirty") == "1"){ show_modal_alert_window("Οι αλλαγές σας δεν έχουν αποθηκευτεί.Εάν κλείσετε το παράθυρο θα χαθούν. Θέλετε να συνεχίσετε;"); return false; } } $target.find(".modal-content").html(""); }); function hideModal(){ $("button[data-dismiss='modal']").trigger("click"); } function view_system_source(pID, sID, target){ pID = parseInt(pID); if( !(pID > 0)){ show_error("Σφάλμα ανάκτησης κωδικού πρωτοκόλλου."); return false; } var json = {pID:pID, sID:sID}; var id = parseInt( Math.random()*1000 ); if(typeof(target) === "undefined"){ target = "modal-window"; } $("body").append($("")); $("#"+id).trigger("click"); return false; } function download_system_source(pID, sID, btn){ var $this = $(btn); $this.attr("disabled", "disabled"); getAjaxData({ op: "fetch", item: "file", pID:pID, sID:sID }, function(response){ $this.attr("disabled", null); if(response.statustext == "error"){ show_error(response.data); } }); } function upload_system_source(sID, files, callback_success, callback_fail){ var formData = new FormData(); formData.append("op", "add"); formData.append("item", "source-in-service"); formData.append("sID", sID); if(files.length > 0){ for(var i = 0; i < files.length; i++){ formData.append("uploaded_source_"+i, files[i]); } getAjaxFormData(formData, function(data){ if(data.statustext === "success"){ callback_success(data.data); }else{ show_error(data.data); callback_fail(data.data); } }); }else{ callback_success(-1); } return false; } /* function delete_system_source(pID, sID, target){ var $this = $(btn); $this.attr("disabled", "disabled"); getAjaxData({ op: "delete", item: "system-source", pID:pID, sID:sID }, function(response){ $this.attr("disabled", null); if(response.statustext == "error"){ show_error(response.data); }else{ } }); } */ function deactivate_user(uid, btn){ $this = $(btn); getAjaxData({ op : "update", item: "user", option: "active-status", params: 0, uID:uid }, function(response){ if(response.statustext == "error"){ show_error(response.data); }else{ show_success(response.data); get_system_users(); hideModal(); } }); } function update_user_pass(uID, btn){ var $this = $(btn); if( uID <= 0 || uID == ""){ show_error("Σφάλμα ανάκτησης χρήστη."); return false; } replace_modal('update-user-pass', uID); return false; } function send_user_pass(uID, btn){ var $this = $(btn); if( uID <= 0 || uID == ""){ show_error("Σφάλμα ανάκτησης χρήστη."); return false; } $this.attr("disabled", "disabled"); getAjaxData({ op : "update", item: "user", option: "send-user-pass", uID:uID }, function(response){ $this.attr("disabled", null); if(response.statustext == "error"){ show_error(response.data); }else{ show_success(response.data); hideModal(); if($this.attr("data-mode") != "self"){ get_system_users(); } } }, null); return false; } function update_user_details(btn){ var $this = $(btn); var $form = $("div.profile"); var uID = $form.attr("data-uID"); var name = jQuery.trim($form.find("input[name='name']").val()); var surname = jQuery.trim($form.find("input[name='surname']").val()); var f_name = jQuery.trim($form.find("input[name='f_name']").val()); var f_surname = jQuery.trim($form.find("input[name='f_surname']").val()); var m_name = jQuery.trim($form.find("input[name='m_name']").val()); var m_surname = jQuery.trim($form.find("input[name='m_surname']").val()); var adt = jQuery.trim($form.find("input[name='adt']").val()); var afm = jQuery.trim($form.find("input[name='afm']").val()); var birth_date = jQuery.trim($form.find("input[name='birth_date']").val()); var birth_place = jQuery.trim($form.find("input[name='birth_place']").val()); var poli = jQuery.trim($form.find("input[name='poli']").val()); var odos = jQuery.trim($form.find("input[name='odos']").val()); var tk = jQuery.trim($form.find("input[name='tk']").val()); var landline = jQuery.trim($form.find("input[name='landline']").val()); var mobile = jQuery.trim($form.find("input[name='mobile']").val()); var fax = jQuery.trim($form.find("input[name='fax']").val()); $this.attr("disabled", "disabled"); getAjaxData({ op : "update", item: "user", option: "user-details", params: { name:name, surname:surname, f_name:f_name, f_surname:f_surname, m_name:m_name, m_surname:m_surname, adt:adt, afm:afm, birth_date:birth_date, birth_place:birth_place, poli:poli, odos:odos, tk:tk, landline:landline, mobile:mobile, fax:fax }, uID:uID }, function(response){ $this.attr("disabled", null); if(response.statustext == "error"){ show_error(response.data); }else{ show_success(response.data); if($form.attr("data-from-manage-users") == 1){ hideModal(); refresh_user_tables(); }else{ setTimeout(function(){ window.top.location = '/index.php'; }, 2000); } } }, null); return false; } function request_account(btn){ var $this = $(btn); var $form = $("div.new-account"); var email = jQuery.trim($form.find("input[name='email']").val()); $this.attr("disabled", "disabled"); getAjaxData({ op : "request", item: "new-account", email:email }, function(response){ $this.attr("disabled", null); if(response.statustext == "error"){ show_error(response.data); }else{ show_success(response.data); if($form.hasClass("self")){ hideModal(); refresh_user_tables(); }else{ setTimeout(function(){ window.top.location = "/index.php"; }, 3000); } } }, null); return false; } function refresh_user_tables(){ var table_inactive = $('#tbl-inactive-users').DataTable(); var table_active = $('#tbl-active-users').DataTable(); table_inactive.clear().draw(); table_active.clear().draw(); } function clear_modal_window(){ unmark_modal_window(); hideModal(); } function show_modal_alert_window(text){ ask_user(text, function(){ clear_modal_window(); }, function(){ }); } function check_for_changes_at_modal_window(){ $("#modal-window select, #modal-window input, #modal-window textarea").on("change", function(){ mark_modal_window(); }); } function mark_modal_window(){ $("#modal-window").attr("data-dirty", 1); } function unmark_modal_window(){ $("#modal-window").attr("data-dirty", 0); } function replace_modal(id, data){ unmark_modal_window(); hideModal(); if(typeof(data) == "object"){ data = JSON.stringify(data); } setTimeout(function(){ $("body").append($("")); $("button[data-id='"+id+"']").trigger("click").remove(); }, 100); } function replace_modal2(id, data){ unmark_modal_window2(); hideModal2(); if(typeof(data) == "object"){ data = JSON.stringify(data); } setTimeout(function(){ $("body").append($("")); $("button[data-id='"+id+"']").trigger("click").remove(); }, 100); } function hideModal2(){ $("#modal-window-2 button[data-dismiss='modal']").trigger("click"); } function unmark_modal_window2(){ $("#modal-window-2").attr("data-dirty", 0); } function ask_user(){ var html = "
"; if(arguments.length == 5){ var text = arguments[0]; var text_yes = arguments[1]; var text_no = arguments[3]; var func_yes = arguments[2]; var func_no = arguments[4]; html += ""; html += ""; html += ""; }else{ var text_yes = getLang('YES'); var text_no = getLang('NO'); if(arguments.length == 3){ var text = arguments[0]; var func_yes = arguments[1]; var func_no = arguments[2]; }else{ if(arguments.length == 2){ var text = arguments[0]; var func_yes = arguments[1]; var func_no = function(){} }else{ show_error("Λανθασμένη χρήση παραμέτρων", "Διαδικασία ask_user"); return false; } } html += ""; html += ""; } html += "
"; if(typeof(func_no) != "function"){ func_no_fin = function(){ __modal_window_close(); } }else{ func_no_fin = function(){ func_no(); __modal_window_close(); } } if(typeof(func_yes) != "function"){ func_yes_fin = function(){ __modal_window_close(); } }else{ func_yes_fin = function(){ func_yes(); __modal_window_close(); } } window.__modal_window_ok = func_yes_fin; window.__modal_window_no = func_no_fin; window.__modal_window_close = function(){ $("#modal-window-request-user-action").css("display", "none"); } var _holder = $("#modal-window-request-user-action").find(".modal-content"); _holder.html(""); _holder.append($("
"+text+"
")); _holder.append($(html)); $("#modal-window-request-user-action").css("display", "block"); } function get_system_subsystems(){ getAjaxData({ op : "fetch", item: "view", page: "system-subsystems" }, function(response){ if(response.statustext == "error"){ show_error(response.data); }else{ $("#main_view").html(response.data); } }); return false; } function reload_left_panel(){ getAjaxData({ op : "fetch", item: "view", page: "left-panel" }, function(response){ if(response.statustext == "error"){ show_error(response.data); }else{ $("#left-panel").html(response.data); } }); return false; } function template(state){ if(!state.id){ return state.text; } var $option = $(state.element); //return $(' ' + state.text + ''); return $('   ' + state.text + ' '); } function save_user_password(btn) { var $this = $(btn); var details = $('#update-user-pass-form').serializeObject(); if(!details.password_new){ show_warning("Εισάγετε κωδικό", "User management"); return false; } if(!details.password_new_v){ show_warning("Εισάγετε επιβεβαίωση κωδικού", "User Management"); return false; } var uID = details.uID; if(details.password_new != details.password_new_v) { show_warning("Οι κωδικοί δεν ταιριάζουν", "User Management"); return false; } $this.prop("disabled", "disabled"); console.log(details); getAjaxData({ op : 'update', item: "user", option: 'user-pass', uID: uID ? uID : '', password_new: details.password_new, password_new_verification: details.password_new_v }, function(response){ $this.prop("disabled", null); if(response.statustext == "error"){ show_error(response.data); }else{ show_success(response.data); replace_modal('manage-user-account', uID); } }); return false; } $(document).ready(function(){ $("#ch_lan").select2({ templateResult: template, templateSelection: template, minimumResultsForSearch: -1, dropdownParent: $('#header-panel') }); setTimeout(function () { $('.select2-container--default .select2-selection--single .select2-selection__arrow').css('border-color', '#fff transparent transparent transparent!important'); }, 1000); $("#ch_lan").on("change", function(){ var $this = $(this); console.log($this.val()); getAjaxData({op:"update", uID:0, item:"user", option:"user-default-lan", lan:$this.val()}, function(response){ if(response.statustext === "success"){ window.top.location.reload(); }else{ show_error(response.data); } }); }); }); function getLang(text){ if(typeof(__i18n[text]) === "undefined"){ return text; }else{ var t = ( typeof(__i18n[text][__i18n.user_default_lan]) === "string" ) ? __i18n[text][__i18n.user_default_lan] : ""; if(t == ""){ return ( typeof(__i18n[text][__i18n.system_default_lan]) === "string" ) ? __i18n[text][__i18n.system_default_lan] : text; }else{ return t; } } } function view_dashboard() { getAjaxData({ op: "fetch", item: "view", page: "home-dashboard" }, function (response) { if (response.statustext == "error") { show_error(response.data); } else { $("#main_view").html(response.data); } }); return false; } function lista_kleiston_aitimaton() { lista_aitimaton_politon(); setTimeout(function () { $('#fmc-closed-aitimata-btn').click() }, 1000); } function lista_open_aitimaton_politon() { lista_aitimaton_politon(); setTimeout(function () { $('#fmc-open-aitimata-btn').click() }, 1000); } function get_widgets() { getAjaxData({ op: "fetch", item: "view", page: "my-widgets" }, function (response) { if (response.statustext == "error") { show_error(response.data); } else { $("#main_view").html(response.data); } }); return false; } function fetch_myespa() { $("#main_view").html(""); } $(document).ready(function(){ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { $($.fn.dataTable.tables(true)).DataTable() .columns.adjust() .responsive.recalc(); }); }); $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if( typeof(o[this.name]) !== "undefined") { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); }else { o[this.name] = this.value || ''; } }); return o; };