cvs: pearweb /public_html package-delete.php

From: Date: Sun, 27 Jan 2002 05:51:16 +0000
Subject: cvs: pearweb /public_html package-delete.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2160@lists.php.net to get a copy of this message
cox Sun Jan 27 00:51:16 2002 EDT Modified files: /pearweb/public_html package-delete.php Log: update package counter when deleting Index: pearweb/public_html/package-delete.php diff -u pearweb/public_html/package-delete.php:1.3 pearweb/public_html/package-delete.php:1.4 --- pearweb/public_html/package-delete.php:1.3 Sat Jan 26 06:49:12 2002 +++ pearweb/public_html/package-delete.php Sun Jan 27 00:51:16 2002 @@ -2,7 +2,7 @@ /** * Interface to delete a package. * - * $Id: package-delete.php,v 1.3 2002/01/26 11:49:12 mj Exp $ + * $Id: package-delete.php,v 1.4 2002/01/27 05:51:16 cox Exp $ */ auth_require(); @@ -37,14 +37,14 @@ if (!isset($_POST['confirm'])) { $bb = new Borderbox("Confirmation"); - + $form->start(); echo "Are you sure that you want to delete the package?<br /><br />"; $form->displaySubmit("yes", "confirm"); echo "&nbsp;"; $form->displaySubmit("no", "confirm"); - + echo "<br /><br /><font color=\"#ff0000\"><b>Warning:</b> Deleting the package will remove all package information and all releases!</font>"; @@ -88,6 +88,9 @@ echo "\n" . $file_rm . " file(s) deleted\n\n"; + $catid = package::info($_GET['id'], 'categoryid'); + $dbh->query("UPDATE categories SET npackages = npackages-1 WHERE id=$catid"); + foreach ($tables as $table => $field) { $query = sprintf("DELETE FROM %s WHERE %s = '%s'", $table, @@ -97,7 +100,7 @@ echo "Removing package information from table \"" . $table . "\": "; $dbh->query($query); - + echo "<b>" . $dbh->affectedRows() . "</b> rows affected.\n"; }

« previous php.pear.cvs (#2160) next »