Make the drop sequence code actually work
authorxzilla <xzilla>
Fri, 27 Sep 2002 14:15:47 +0000 (14:15 +0000)
committerxzilla <xzilla>
Fri, 27 Sep 2002 14:15:47 +0000 (14:15 +0000)
classes/database/Postgres.php
public_html/sequences.php

index 9f7c1ef405602c62539db9c909b1a12948270671..5dab9e6b33be4482c109ebf75448da2f12a81d8b 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres\r
  * Note: This class uses ADODB and returns RecordSets.\r
  *\r
- * $Id: Postgres.php,v 1.14 2002/09/27 04:02:54 xzilla Exp $\r
+ * $Id: Postgres.php,v 1.15 2002/09/27 14:15:47 xzilla Exp $\r
  */\r
 \r
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???\r
@@ -335,7 +335,7 @@ class Postgres extends BaseDB {
         * Drops a given sequence\r
         * @return 0 success\r
         */\r
-       function &dropSeqeuce($sequence) {\r
+       function &dropSequence($sequence) {\r
                $this->clean($sequence);\r
                $sql = "DROP SEQUENCE {$sequence} ";\r
                return $this->execute($sql);\r
index 0ff66e11d24a2eb1ab883a7a2d8a8e6eeb195084..1a9991b1e04de2a36557354c405c59deac53f6f5 100644 (file)
@@ -3,7 +3,7 @@
  *  FILENAME:   sequence.php
  *  AUTHOR:     Ray Hunter <rhunter@venticon.com>
  *
- *  $Id: sequences.php,v 1.5 2002/09/27 04:02:55 xzilla Exp $
+ *  $Id: sequences.php,v 1.6 2002/09/27 14:15:49 xzilla Exp $
  */
 
 include_once( '../conf/config.inc.php' );
@@ -42,7 +42,7 @@ function doDefault()
                        echo "<td class=\"data{$id}\">";
                                echo "<a href=\"$PHP_SELF?action=properties&database=", htmlspecialchars($_REQUEST['database']), "&sequence=", htmlspecialchars( $sequences->f[$data->sqFields['seqname']]), "\">Properties</a></td>\n"; 
                        echo "<td class=\"data{$id}\">";
-                               echo "<a href=\"$PHP_SELF?action=drop&database=", htmlspecialchars($_REQUEST['database']), "&sequence=", htmlspecialchars( $sequences->f[$data->sqFields['seqname']]), "\">Drop</td>\n"; 
+                               echo "<a href=\"$PHP_SELF?action=confirm_drop&database=", htmlspecialchars($_REQUEST['database']), "&sequence=", htmlspecialchars( $sequences->f[$data->sqFields['seqname']]), "\">Drop</td>\n"; 
                        echo "<td class=\"data{$id}\">";
                                echo "<a href=\"$PHP_SELF?action=priviledges&database=", htmlspecialchars($_REQUEST['database']), "&sequence=", htmlspecialchars( $sequences->f[$data->sqFields['seqname']]), "\">Privileges</td></tr>\n"; 
 
@@ -102,10 +102,10 @@ function doDefault()
 
        }
 
-       function doDrop($strfirm)
+       function doDrop($confirm)
        {
                global $localData, $database;
-               global $PHP_SELF;
+               global $PHP_SELF, $strSequences, $strDropped, $strDrop, $strFailed;
        
                if ($confirm) { 
                        echo "<h2>", htmlspecialchars($_REQUEST['database']), ": $strSequences : ", htmlspecialchars($_REQUEST['sequence']), ": Drop</h2>\n";
@@ -141,8 +141,12 @@ switch( $action )
                doProperties(); 
                break;
        case 'drop':
-               doDrop();
-               break;
+                       if ($_POST['choice'] == 'Yes') doDrop(false);
+                       else doDefault();
+                       break;
+       case 'confirm_drop':
+               doDrop(true);
+               break;                  
        case 'privileges':
                doPrivileges();
                break;