]> git.datanom.net - qtadmin.git/commitdiff
Add multi action
authorMichael Rasmussen <mir@datanom.net>
Tue, 2 Jun 2015 22:40:46 +0000 (00:40 +0200)
committerMichael Rasmussen <mir@datanom.net>
Tue, 2 Jun 2015 22:40:46 +0000 (00:40 +0200)
index.php
js/checkbox.js [new file with mode: 0644]
js/timer.js
lib/utils.inc.php

index 68526246ecccf1e7ba3ac56c035934504e45d890..96cfd4ed61ea586ce650312a1355e3ecede712b0 100644 (file)
--- a/index.php
+++ b/index.php
@@ -33,7 +33,7 @@
         echo "<span class=\"total-rows\">$numrows quarantined mail(s)</span>";
         echo "<table><tr>";
         echo "<table><tr><th>Received</th><th>Cause</th>";
-        echo "<th>Sender</th><th>Recipient</th><th>Subject</th><th>Action</th>";
+        echo "<th>Sender</th><th>Recipient</th><th>Subject</th><th>Action</th><th></th>";
         echo "</tr>";
 
         $mailInfo = array();
@@ -46,6 +46,7 @@
             $id = $row->mail_id;
             $mailInfo[$id] = serialize($row);
             $url = urlencode($id);
+            $checkbox = "<input name=\"action\" type=\"checkbox\" value=\"$url\" />";
             $recipient = "<a title=\"Show Report\" href=\"mail_report.php?id=$url\">{$row->recipient}</a>";
             $action = "<a title=\"Release Mail\" href=\"quarantine.php?id=$url&op=release\">";
             $action .= "<img class=\"nav-img\" src=\"pics/release.png\" alt=\"Release\" /></a>";
@@ -57,7 +58,7 @@
             $subject = $row->subject;
             echo "<td>$received</td><td class=\"nav-action\">".
                 "$quaratinefor</td><td>$sender</td><td>$recipient</td>".
-                "<td>$subject</td><td class=\"nav-action\">$action</td></tr>";
+                "<td>$subject</td><td class=\"nav-action\">$action</td><td>$checkbox</td></tr>";
             $i++;
         }
         $_SESSION['mailInfo'] = $mailInfo;
diff --git a/js/checkbox.js b/js/checkbox.js
new file mode 100644 (file)
index 0000000..d008803
--- /dev/null
@@ -0,0 +1,16 @@
+/* vim: set ts=4 tw=4 sw=4 noet: */
+
+function checkAction() {
+    var ids = '';
+    var c = document.getElementsByName('action');
+    for (var i = 0; i < c.length; i++) {
+        if (c[i].type == 'checkbox' and c[i].checked == true) {
+            if (ids == '') {
+                ids = c[i].value;
+            } else {
+                ids += ',' + c[i].value;
+            }
+        }
+    }
+    alert(ids);
+}
index 1db783cc22fd20c3a6dcce63988a6bbc507c2a48..54e9700699b04e9afe42e097aad065349013f17e 100644 (file)
@@ -1,4 +1,4 @@
-/* vim: set ts=4 tw=0 sw=4 noet: */
+/* vim: set ts=4 tw=4 sw=4 noet: */
 var timerRef=setInterval(function(){myTimer()},1000);
 var timeStart = new Date().getTime() + timeout;
 
index dca39a6b2473b760e579aca40da9b863f655adcd..e59cf8c1379132517b37d1d7930fb13d457f33cc 100644 (file)
@@ -18,6 +18,7 @@ class Utils {
         var timeout = __TIMEOUT__;
     </script>
     <script src="__ROOT__js/timer.js"></script>
+    <script src="__ROOT__js/checkbox.js"></script>
     <title>__TITLE__</title>
 </head>
 <body>';
This page took 0.036798 seconds and 5 git commands to generate.