* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once 'HTML/QuickForm.php'; require_once 'DB.php'; $config = unserialize(file_get_contents('config.inc')); // connect to the data base $db = &DB::connect($config['dsn']); if (DB::isError($db)) die("Could not connect to the database"); if ($config['log_handler'] != 'sql') die("Unsupported log handler"); $number_of_msg = 8; // Count log messages $query = "SELECT COUNT(*) FROM log"; $res =& $db->query($query); if (DB::isError($res)) die($res->getMessage()); $row = $res->fetchRow(); $count = $row[0]; $startMsg = ((empty($_GET['startMsg'])) ? 0 : $_GET['startMsg']); $query = "SELECT * FROM log ORDER BY id DESC"; if (!isset($_GET['show_all'])) $query .= " OFFSET $startMsg LIMIT " . ($startMsg + $number_of_msg); $res =& $db->query($query); if (DB::isError($res)) die($res->getMessage()); $numRows = $res->numRows(); ?>
| Previous"; else echo "Previous" ?> | $number_of_users) && !isset($_GET['show_all'])) echo "Next"; else echo "Next"; if (isset($_GET['show_all'])) echo "| Paginate"; else { for ($i = 0; $i < $count; $i += $number_of_msg) if ($i == $startMsg) echo "| " . ( $i / $number_of_msg); else echo "| " . ( $i / $number_of_msg) . ""; if ($count > $number_of_msg) echo "| Show All"; } ?> | |||
| date | filename | priority | message |
| " . $desc[$row[$i]] . " | "; break; case "message": echo "" . $row[$i] . " | "; break; default: echo "" . $row[$i] . " | "; } } echo "|
Copyright © 2004 Entr'ouvert