aboutsummaryrefslogtreecommitdiffstats
path: root/A8_srv_build/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'A8_srv_build/delete.php')
-rw-r--r--A8_srv_build/delete.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/A8_srv_build/delete.php b/A8_srv_build/delete.php
new file mode 100644
index 0000000..cfa52a3
--- /dev/null
+++ b/A8_srv_build/delete.php
@@ -0,0 +1,52 @@
+<?php
+session_start();
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="/css/table.css">
+<link rel="stylesheet" type="text/css" href="/css/style.css">
+<title>Delete ID</title>
+</head>
+<body>
+<?php
+//Debug
+//echo 'Session: ' . session_id() . ' Count: ' . $_SESSION['counter'] . '<br>';
+//var_dump($_SESSION);
+?>
+
+<pre>
+<?php
+include('config.inc');
+
+print_r($_POST['delid']);
+
+if (!empty($_POST['delid'])) {
+ $delid = isset($_POST['delid']) ? $delid = $_POST['delid'] : null;
+ $nc = count($delid);
+ for ($i=0;$i<$nc;$i++)
+ {
+ $did = $delid[$i];
+ echo "Removing $did\n";
+$sql = 'DELETE PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, PKG_URL FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, PKG_URL WHERE PKG_CFG.pkg_id = PKG.id AND PKG_BLD.pkg_id = PKG.id AND PKG_NST.pkg_id = PKG.id AND PKG_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id = PKG.id AND PKG_URL.pkg_id = PKG.id AND PKG.id=:id ;';
+
+ try {
+ $stmt = $pdo->prepare($sql);
+ $stmt->execute(['id' => $did]);
+ } catch (PDOException $e) {
+ echo '<font color="D00"><pre>Have a big problem</pre></font>';
+ throw $e;
+ }
+
+ }
+} else {
+ echo "No rows selected to delete!";
+}
+?>
+</pre>
+<form action="list.php" method="POST">
+<input type="submit" name="select" value="OK">
+</form>
+</body>
+</html>