From acafd6b03f4b92587f3e4ec0af0c46cb3d037ba6 Mon Sep 17 00:00:00 2001 From: Christophe Nowicki Date: Tue, 25 Jan 2005 15:31:39 +0000 Subject: Remove php samples from the lasso repository I'm still working on it. I will release an independant Pear package for Lasso 0.6. The pear package repository is here: https://meuh.dyndns.org/cgi-bin/viewcvs.cgi/lasso_pear/ --- php/Attic/examples/sample-sp/log_view.php | 160 ------------------------------ 1 file changed, 160 deletions(-) delete mode 100644 php/Attic/examples/sample-sp/log_view.php (limited to 'php/Attic/examples/sample-sp/log_view.php') diff --git a/php/Attic/examples/sample-sp/log_view.php b/php/Attic/examples/sample-sp/log_view.php deleted file mode 100644 index ccba208c..00000000 --- a/php/Attic/examples/sample-sp/log_view.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * 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(); - -?> - - - - - Lasso Service Provider Example : View Logs - - -
- - - - - - - - - - - - - - -numCols(); - $tableinfo = $db->tableInfo($res); - - $desc = array("emergency", "alert", "critical", "error", "warning", "notice", "informational", "debug"); - - while($row = $res->fetchRow()) - { - echo ""; - for ($i = 0; $i < $num_col; $i++) - { - switch ($tableinfo[$i]['name']) - { - case "id": - break; - case "priority": - echo ""; - break; - case "message": - echo ""; - break; - default: - echo ""; - } - } - echo ""; - } - } -?> - - - - - - - - -
Logged events
- 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"; - } - ?> -
datefilenameprioritymessage
" . $desc[$row[$i]] . "" . $row[$i] . "" . $row[$i] . "
 
-
-

Index -

-
-

Copyright © 2004, 2005 Entr'ouvert

- - - -- cgit