X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/ff1575e4180175eae8570001953f3981f8438357..928e37f7083dd3320588a26d5dcc6b2d4e4de957:/index.php diff --git a/index.php b/index.php index 9bbd08d..54b82d8 100644 --- a/index.php +++ b/index.php @@ -1,101 +1,112 @@ root . 'lib/db_factory.php'; - require_once $CFG->root . 'lib/utils.inc.php'; + require_once 'config.php'; + require_once $CFG->root . 'lib/db_factory.php'; + require_once $CFG->root . 'lib/utils.inc.php'; - $util = Utils::getInstance(); - unset($_SESSION['mailInfo']); - - if ($util->isLoggedIn()) { - if (isset($_GET['rowsperpage'])) { - $rowsPerPage = $_GET['rowsperpage']; - } else { - $rowsPerPage = 20; - } + $util = new Utils; + unset($_SESSION['mailInfo']); - $pageNum = 1; - if (isset($_GET['page'])) { - $pageNum = $_GET['page']; - } + if ($util->isLoggedIn()) { + if (isset($_GET['rowsperpage'])) { + $rowsPerPage = $_GET['rowsperpage']; + } else { + $rowsPerPage = 20; + } - $offset = ($pageNum - 1) * $rowsPerPage; + $pageNum = 1; + if (isset($_GET['page'])) { + $pageNum = $_GET['page']; + } - $util->setHeading('Quarantine Administration'); - echo $util->getHeader(); - echo $util->getHeading(); + $offset = ($pageNum - 1) * $rowsPerPage; - echo "{$util->getUser()} - Logout"; - $which = ($util->isAdmin() == true) ? 'all' : $util->getUser(); - $rows = $DB->getQMails($offset, $rowsPerPage, $which); - $numrows = $DB->numRows(); - echo "$numrows quarantined mail(s)"; - echo "
| Received | Cause | "; + $util->setHeading('Quarantine Administration'); + echo $util->getHeader(); + echo $util->getHeading(); + + echo "Rows per page {$util->getUser()} + Logout"; + $which = ($util->isAdmin() == true) ? 'all' : $util->getUser(); + $rows = $DB->getQMails($offset, $rowsPerPage, $which); + $numrows = $DB->numRows(); + echo "$numrows quarantined mail(s)"; + echo "
|---|
| Received | Cause | "; echo "Sender | Recipient | Subject | Action | "; - echo ""; + echo ""; - $mailInfo = array(); - $i = 0; - foreach ($rows as $row) { - if ($i % 2) - echo ' |
|---|---|---|---|---|---|
| $received | ". "$quaratinefor | $sender | $recipient | ". - "$subject | $action |
$first$prev Showing page $pageNum of - $maxPage pages $next$last
"; + if ($pageNum < $maxPage) { + $page = $pageNum + 1; + $next = "$first$prev Showing page $pageNum of + $maxPage pages $next$last
"; - echo $util->getFooter(); - } else { - header('Location: auth.php'); - } + echo $util->getFooter(); + } else { + header('Location: auth.php'); + } ?>