Created
January 27, 2017 13:00
-
-
Save gunaevart/1a106c631d722a1fceabe0f5ea7bc954 to your computer and use it in GitHub Desktop.
Удаление заказов из админики Jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/JavaScript Задаём цвета строк разных статусов заказа | |
$('tr[rel="Новое"]').css({"background":"rgb(0, 122, 22)", "padding":"3px", "color":"#fff"}); | |
$('tr[rel="Старое"]').css({"background":"rgb(188, 188, 188)", "padding":"3px", "color":"#fff"}); | |
//JavaScript функция изменения статуса заказа | |
$(".ok").on("click", function() { | |
$(this).parents('tr').css({"background":"rgb(255, 0, 0)", "padding":"3px", "color":"#fff"}).attr('rel', 'Старое'); | |
$(this,'button').text("готово"); | |
$('#savePage').fadeIn(1000); | |
var status = $(this).parents('tr').attr("value"); | |
var iDStatus = $(this).parents('tr').attr("rel"); | |
$.ajax({ | |
url:'load.php', | |
type:'post', | |
data:{status:status, iDStatus:iDStatus}, | |
success: function(data){} | |
}); | |
}); | |
//JavaScript функция удаление клиентов на странице | |
$(".dell").on("click", function() { | |
$(this).parents('tr').css({"background":"rgb(255, 0, 0)", "padding":"3px", "color":"#fff"}); | |
if (confirm("Удалить данные пользователя!?")){ | |
alert("Совсем, совсем удалить данный?") | |
$(this).parents('tr').hide(500); | |
}else {alert("Вы нажали кнопку отмена")} | |
var status = $(this).parents('tr').attr("value"); | |
$.ajax({ | |
url:'delete.php', | |
type:'post', | |
data:{status:status}, | |
success: function(data){} | |
}); | |
}); | |
//JavaScript функция перегрузки страницы | |
$('#savePage').click(function(){ | |
location.reload(); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment