You are here:  » Confirmation on Delete's

Support Forum



Confirmation on Delete's

Submitted by BobL on Wed, 2012-08-15 14:22 in

Hi David

I was wondering how hard it would be to modify the delete links to have a confirm dialog box before deleting the records?

Thanks David,
Great Product you have developed & great support.

Submitted by support on Wed, 2012-08-15 14:45

Hello Bob,

Sure - here's a replacement admin/feeds_deregister.php with confirmation:

<?php
  
@set_time_limit(0);
  require(
"../includes/common.php");
  
$admin_checkPassword TRUE;
  require(
"../includes/admin.php");
  
$filename $_GET["filename"];
  if (isset(
$_GET["confirm"]))
  {
    if (
$_GET["confirm"]=="Yes")
    {
      
admin_deregister($_GET["filename"]);
    }
    
header("Location: index.php");
    exit();
  }
  require(
"admin_header.php");
  require(
"admin_menu.php");
  print 
"<h2>De-Register Feed (".$filename.")</h2>";
  print 
"<h3>Confirm Deletion</h3>";
  
$sql "SELECT COUNT(*) AS numProducts FROM `".$config_databaseTablePrefix."products` WHERE filename='".database_safe($filename)."'";
  
database_querySelect($sql,$rows);
  print 
"<p>".$rows[0]["numProducts"]." products will be deleted!</p>";
  print 
"<form method='GET'>";
  print 
"<input type='hidden' name='filename' value='".htmlentities($filename,ENT_QUOTES,$config_charset)."' />";
  print 
"<select name='confirm'><option value='No'>No</option><option value='Yes'>Yes</option></select><br /><br />";
  print 
"<input type='submit' value='Submit' />";
  print 
"</form>";
  require(
"admin_footer.php");
?>

Cheers,
David.
--
PriceTapestry.com

Submitted by BobL on Wed, 2012-08-15 14:56

Bob L.

Wow, that was quick.
Thank you, you really amaze me with your programming. :)

Thank you David.
Think I can handle the others, Mapping, Filtering etc. now that I see how it is done.