$(document).ready(function(){ $("body").on('click', '.goodCartEdit', function(){ var item_id = $(this).attr('item_id'); if (item_id ==undefined) { item_id = $(this).parent().attr('item_id'); } if (window.open("/admin/mod_edit.phtml?item_id="+item_id+"&action=edit", "", "status:0; border:thin; dialogWidth:900pt; dialogHeight:600pt; help:0; center:1; ")>0) { document.location.reload(false); } }); $.fn.requestListRefresh = function() { var dateFrom = $("#dateFrom").val(); var dateTo = $("#dateTo").val(); var comm = $(".contentTable #container h2").attr('comm'); var status_ids = []; $("#statusList input:checked").each(function() { var status_id = $(this).attr('status_id'); status_ids.push(status_id); }); $(".contentTable #container .requests").addClass('loading'); params = { dateFrom: dateFrom, dateTo: dateTo, comm: comm, status_ids: status_ids }; $.ajax({ url: "/admin/orders.phtml", data: params, type: 'GET', cache: false, success: function(html) { $(".contentTable #container .requests").html(html); $(".contentTable #container .requests").removeClass('loading'); } }); } $("#dateFrom, #dateTo").change(function() { $(this).requestListRefresh(); }); $("#statusList input").click(function() { $(this).requestListRefresh(); }); $(".adminTable .btn_edit").click(function(){ var item_id = $(this).parents("tr").attr('item_id'); if (window.open("/admin/mod_edit.phtml?item_id="+item_id+"&action=edit", "", "status:0; border:thin; dialogWidth:900pt; dialogHeight:600pt; help:0; center:1; ")>0) { document.location.reload(false); } return false; }); $(".adminTable .btn_remove").click(function() { var item_id = $(this).parents("tr").attr('item_id'); $("
Удалить Элемент?
").dialog({ buttons: { "Да": function() { params = { item_id: item_id, action: 'del' }; $.ajax({ url: "/admin/mod_edit.phtml", data: params, type: 'GET', cache: false, success: function(html) { $(this).dialog("close"); document.location.reload(false); } }); $(this).dialog("close"); }, "Нет": function() { $(this).dialog("close"); } } }); return false; }) $("body").on('mouseenter', '.adminTable .buttons img', function(){ $(this).addClass('over'); }); $("body").on('mouseleave', ".adminTable .buttons img", function(){ $(this).removeClass('over'); }); $("body").on('mousedown', ".adminTable tr", function(){ $(".adminTable tr").removeClass('selected'); $(this).addClass('selected'); }); $("body").on('dblclick', ".adminTable tr", function(){ var item_id = $(this).attr('item_id'); window.location.href='?item_parent_id='+item_id; }); });