Jump to content

How to display delete warning


ankit.pandeyc012

Recommended Posts

<html><head><script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script src="/js/jquery.confirm.js" type="text/javascript">
</script>
<script language="javascript">
// load jquery here before calling this
$(document).ready(function() {

    // delete the entry once we have confirmed that it should be deleted
    $('.delete').click(function() {
	var parent = $(this).closest('tr');
	$.ajax({
		type: 'get',
		url: 'delete.php', // <- replace this with your url here
		data: 'ajax=1&#038;delete=' + $(this).attr('id'),
		beforeSend: function() {
			parent.animate({'backgroundColor':'#fb6c6c'},300);
		},
		success: function() {
			parent.fadeOut(300,function() {
				parent.remove();
			});
		}
	});	        
    });

    // confirm that it should be deleted
    $('.delete').confirm({
        msg:'Do you really want to delete this?',
        timeout:3000
    });		
});
</script></head></html>
<?php
require_once('upper.php');
if(isset($_COOKIE['AdminCookie'])){

require_once('database.php');
$query="select * from events ";
$result=mysqli_query($dbc,$query) or die('Not Connected');
while($row=mysqli_fetch_array($result)){
echo "<div id='delete'>";
echo "<a href='EventsDeleted.php?EventId=".$row['EventId']."'>".$row['Title']."</a><br><br>";
echo "<br></div>";
}
echo "<a href='log_out.php'>Admin Log out</a><br>";
echo "<a href='AdminHome.php'>Back to Admin Home</a>";
}

else{echo 'Sorry, This page is restricted.';}
require_once('lower.php');

 

In above code I want that when admin delete any event, there should an warning message prompt but my jquery not works..........

Plz help.................

Link to comment
https://forums.phpfreaks.com/topic/225247-how-to-display-delete-warning/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.