2007-05-20 19:12:31 +02:00
|
|
|
<?PHP
|
|
|
|
|
|
|
|
// Pandora FMS - the Free monitoring system
|
|
|
|
// ========================================
|
|
|
|
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
|
|
|
|
// Main PHP/SQL code development and project architecture and management
|
|
|
|
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
|
|
|
|
//
|
|
|
|
// 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; version 2
|
|
|
|
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
// Login check
|
|
|
|
$id_usuario=$_SESSION["id_usuario"];
|
|
|
|
global $REMOTE_ADDR;
|
|
|
|
|
|
|
|
if (comprueba_login() != 0) {
|
|
|
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
|
|
|
|
include ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2007-06-22 09:25:15 +02:00
|
|
|
echo "<h2>".$lang_label["visual_console"]." > ";
|
|
|
|
echo $lang_label["summary"]."</h2>";
|
2007-05-20 19:12:31 +02:00
|
|
|
$sql="SELECT * FROM tlayout";
|
2007-06-22 09:25:15 +02:00
|
|
|
$res=mysql_query($sql);
|
|
|
|
|
|
|
|
if (mysql_num_rows($res)) {
|
|
|
|
|
|
|
|
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
|
|
|
|
echo "<tr>
|
|
|
|
<th>".$lang_label["name"]."</th>
|
|
|
|
<th>".$lang_label["group"]."</th>
|
|
|
|
<th>".$lang_label["elements"]."</th>
|
|
|
|
<th>".$lang_label["view"]."</th>";
|
|
|
|
$color=1;
|
2007-05-21 15:24:17 +02:00
|
|
|
while ($row = mysql_fetch_array($res)){
|
2007-05-20 19:12:31 +02:00
|
|
|
// Calculate table line color
|
|
|
|
if ($color == 1){
|
|
|
|
$tdcolor = "datos";
|
|
|
|
$color = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$tdcolor = "datos2";
|
|
|
|
$color = 1;
|
|
|
|
}
|
|
|
|
echo "<tr>";
|
|
|
|
// Name
|
2007-06-22 09:25:15 +02:00
|
|
|
echo "<td valign='top' class='$tdcolor'>".$row["name"]."</td>";
|
2007-05-20 19:12:31 +02:00
|
|
|
$id_layout = $row["id"];
|
|
|
|
// Group
|
2007-06-22 09:25:15 +02:00
|
|
|
echo "<td valign='top' align='center' class='$tdcolor'><img src='images/".dame_grupo_icono($row["id_group"]).".png'></td>";
|
2007-05-20 19:12:31 +02:00
|
|
|
// # elements
|
|
|
|
$sql2="SELECT COUNT(*) FROM tlayout_data WHERE id_layout = $id_layout";
|
|
|
|
$res2=mysql_query($sql2);
|
|
|
|
$row2 = mysql_fetch_array($res2);
|
2007-06-22 09:25:15 +02:00
|
|
|
echo "<td valign='top'align='center' class='$tdcolor'>".$row2[0]."</td>";
|
2007-05-20 19:12:31 +02:00
|
|
|
// View icon
|
2007-06-22 09:25:15 +02:00
|
|
|
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout'><img src='images/images.png'></a></td></tr>";
|
2007-05-21 15:24:17 +02:00
|
|
|
}
|
2007-06-22 09:25:15 +02:00
|
|
|
echo "</table>";
|
|
|
|
} else {
|
|
|
|
echo "<div class='nf'>".$lang_label["no_layout_def"]."</div>";
|
|
|
|
}
|
2007-05-20 19:12:31 +02:00
|
|
|
|
|
|
|
?>
|