<?php

//    drop.php
//    Drop an ht://Check database
//
//    Part of the ht://Check package
//
//    Copyright (c) 1999-2004 Comune di Prato - Prato - Italy
//    Author: Gabriele Bartolini - Prato - Italy <angusgb@users.sourceforge.net>
//
//    For copyright details, see the file COPYING in your distribution
//    or the GNU General Public License version 2 or later 
//    <http://www.gnu.org/copyleft/gpl.html>
//
//    $Id: drop.php,v 1.9 2003/12/30 09:39:23 angusgb Exp $

///////
   //    Global settings
///////

include ("./include/global.inc.php");


if (!isset($dbname))
{
   // Error
   DisplayErrMsg($strErrorNoDBSelected);
   echo "<a href=\"index.php\">" . $strMainPage . "</A>";
   die;
}

   if (! isset($confirmed))
      $delete=0;
   else $delete=1;
   
   $pagetitle = "$strDBDeletion: '" . $dbname . "'. Take "
      . $delete+1 . "/2";
   $linkbar = "<a href=\"index.php\">" . $strMainPage . "</A>";

   if (! $delete)
      $linkbar = $linkbar . " | " .
         "<a href=\"javascript:history.go(-1)\">" . $strBack . "</A>";

?>
<?php include ("./include/header.inc.php"); ?>
<?php

   if ($delete)
   {
      $result=$MyDB->Drop($dbname);
   
      if ($result)
      {
         DisplayErrMsg($MyDB->errmsg);
         die;
      }

      eval("\$strdeleted = \" $strDBDeleted \";");
   
?>
<p><?php echo $strdeleted; ?></p>

<?php
   }
   else
   {
?>
<p><?php echo $strDBDropSure; ?></p>

<ul>
<li><a href="<?php echo $PHP_SELF; ?>?dbname=<?php echo $dbname; ?>&confirmed=1"><?php echo $strDBDrop; ?></A></li>
<li><a href="index.php?dbname=<?php echo $dbname; ?>"><?php echo $strDBCancel; ?></A></li>
</ul>

<?php
   }
?>
<?php include ("./include/footer.inc.php"); ?>
