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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.