3 /**************************************************************************
4 ** This is free software; you can redistribute it and/or modify it under the
5 ** terms of the GNU General Public License, see the file COPYING.
6 ***************************************************************************/
10 * Objects Administration page.
11 * Input parameters: action (POST) : empty, 'Create'
12 * objname (POST) : name of the object to create or remove
16 require_once('classes/gnucomo_config.php');
19 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
22 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
23 <link rel='stylesheet' href='gnucomo.css' type='text/css'>
24 <title>GNUCoMo login</title>
26 <script language='JavaScript'>
27 function CheckCreate(f)
29 if (f.objectname.value == "")
31 alert("You must supply a name");
37 function CheckRemove(f)
39 var message = "Are you sure you want to remove object ";
40 message += f.objectname.value;
43 return confirm(message);
51 if (empty($_SESSION['username']))
53 echo "Please log in first.";
58 $config = new gnucomo_config;
60 $config->read("gnucomo");
62 // Connect to the database
63 $conn = pg_connect($config->Database($_SESSION['username'], $_SESSION['password']));
65 if (!empty($_GET['oid']))
67 $res = pg_exec("SELECT objectname FROM object WHERE objectid=" . $_GET['oid']);
68 $obj = pg_fetch_object($res, 0);
69 echo "<h1>Log for " . $obj->objectname . "</h1><hr>";
71 $res = pg_exec("SELECT object_timestamp, servicecode, rawdata FROM log "
72 ."WHERE objectid=" . $_GET['oid']);
76 while ($row < pg_numrows($res))
78 $log = pg_fetch_object($res, $row);
80 <tr><td align='center'>
81 <?php echo $log->object_timestamp?>
83 <?php echo $log->servicecode?>
85 <?php echo $log->rawdata?>