From 5c7b972ed26570d2bf4e092d937b81578e84c124 Mon Sep 17 00:00:00 2001 From: Michael Rasmussen Date: Wed, 3 Jun 2015 00:40:46 +0200 Subject: [PATCH] Add multi action --- index.php | 5 +++-- js/checkbox.js | 16 ++++++++++++++++ js/timer.js | 2 +- lib/utils.inc.php | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 js/checkbox.js diff --git a/index.php b/index.php index 6852624..96cfd4e 100644 --- a/index.php +++ b/index.php @@ -33,7 +33,7 @@ echo "$numrows quarantined mail(s)"; echo ""; echo "
"; - echo ""; + echo ""; echo ""; $mailInfo = array(); @@ -46,6 +46,7 @@ $id = $row->mail_id; $mailInfo[$id] = serialize($row); $url = urlencode($id); + $checkbox = ""; $recipient = "{$row->recipient}"; $action = ""; $action .= "\"Release\""; @@ -57,7 +58,7 @@ $subject = $row->subject; echo "". - ""; + ""; $i++; } $_SESSION['mailInfo'] = $mailInfo; diff --git a/js/checkbox.js b/js/checkbox.js new file mode 100644 index 0000000..d008803 --- /dev/null +++ b/js/checkbox.js @@ -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); +} diff --git a/js/timer.js b/js/timer.js index 1db783c..54e9700 100644 --- a/js/timer.js +++ b/js/timer.js @@ -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; diff --git a/lib/utils.inc.php b/lib/utils.inc.php index dca39a6..e59cf8c 100644 --- a/lib/utils.inc.php +++ b/lib/utils.inc.php @@ -18,6 +18,7 @@ class Utils { var timeout = __TIMEOUT__; + __TITLE__'; -- 2.39.2
ReceivedCauseSenderRecipientSubjectActionSenderRecipientSubjectAction
$received". "$quaratinefor$sender$recipient$subject$action
$subject$action$checkbox