<?php
// ----------------------------------------------------------------------
// Copyright (C) 2007 by GREGORY LE BRAS
// ----------------------------------------------------------------------
// LICENSE
//
// This file is part of ODCNMS - Open DataCenter Network Management System
//
// ODCNMS 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.
//
// Foobar 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 Foobar; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// ----------------------------------------------------------------------
// Original Author of file: GREGORY LE BRAS - http://www.odcnms.org/
// ----------------------------------------------------------------------
?>
<?php
$request=mysql_query("SELECT * FROM $name_table_slot WHERE id=\"$id\"") or die ("ERROR!");
while($tmp_request=mysql_fetch_array($request))
{
$slot_name = $tmp_request['number'];
?>
<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="80%"><h4><img src="images/slot.gif" alt="slot" align="top"> <?php echo $tmp_request['number']; ?></h4></td>
<td width="10%" style="text-align:right">[ <a href="index.php?include=mainview&page=slot&action=edit&id=<?php echo $id; ?>"><?php echo TXT_EDIT; ?></a> ]</td>
<td width="10%" style="text-align:right">[ <a href="index.php?include=mainview&page=slot&action=delete&id=<?php echo $id; ?>"><?php echo TXT_DELETE; ?></a> ]</td>
<tr>
</table>
<table class="list" width="100%" cellspacing="2" cellpadding="3">
<tr class="list_title">
<td width="100%" style="font-weight:normal;"><b><?php echo TXT_DEVICE; ?> :</b> <?php
$request2=mysql_query("SELECT id,name,model_id FROM $name_table_device WHERE id=$tmp_request[device_id]") or die ("ERROR!");
while($tmp_request2=mysql_fetch_array($request2))
{
$model_id = $tmp_request2['model_id'];
echo "<a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request2[id]\">".$tmp_request2['name']."</a>";
}
?>
</td>
</tr>
<tr class="list_title">
<td width="100%" style="font-weight:normal;"><b><?php echo TXT_NUMBER; ?> :</b> <?php echo $tmp_request['number']; ?></td>
</tr>
<tr class="list_title">
<td width="100%" style="font-weight:normal;"><b><?php echo TXT_INTERFACE; ?> <?php echo TXT_DENSITY; ?> :</b> <?php
$request3=mysql_query("SELECT * FROM $name_table_model_slot WHERE model_id=\"$model_id\" AND number=\"$tmp_request[number]\"") or die ("ERROR!");
while($tmp_request3=mysql_fetch_array($request3))
{
$interface_density= $tmp_request3['interface_density'];
}
echo "$interface_density";
?></td>
</tr>
<tr class="list_title">
<td width="100%" style="font-weight:normal;"><b><?php echo TXT_DESCRIPTION; ?> :</b> <?php echo $tmp_request['description']; ?></td>
</tr>
</table>
<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><h4><img src="images/slot.gif" alt="slot" align="top"> <?php echo TXT_SLOT; ?> <?php echo TXT_VIEW; ?></h4></td>
<tr>
</table>
<div id="ajaxcontentarea"></div>
<div id="rack_view">
<div class="rack">
<div class="device" style="height:50px">
<?php
$request9=mysql_query("SELECT * FROM $name_table_slot WHERE id=\"$id\" ORDER BY id ASC") or die ("ERROR!");
while($tmp_request9=mysql_fetch_array($request9))
{
echo "<div class=\"slot\"><b><a href=\"#\" onclick=\"javascript:urlredirectdiv('ajax_view.php?what=slot&id=$tmp_request9[id]','ajaxcontentarea');\">Slot $tmp_request9[number]</a></b>";
$request10=mysql_query("SELECT * FROM $name_table_interface WHERE slot_id=\"$tmp_request9[id]\"") or die ("ERROR!2");
$i = 1;
while($tmp_request10=mysql_fetch_array($request10))
{
$requestcount=mysql_query("SELECT count(*) FROM $name_table_link_interface_interface WHERE (interface_id=$tmp_request10[id] OR interface2_id=$tmp_request10[id])") or die ("ERROR!");
$count_interface = mysql_fetch_array($requestcount);
$requestcount_port_interface=mysql_query("SELECT count(*) FROM $name_table_link_port_interface WHERE interface_id=$tmp_request10[id]") or die ("ERROR!");
$count_port_interface = mysql_fetch_array($requestcount_port_interface);
if (($count_interface[0] > 0) || ($count_port_interface[0] > 0))
{
echo "<div class=\"interface_linked\"><a href=\"#\" onclick=\"javascript:urlredirectdiv('ajax_view.php?what=interface&id=$tmp_request10[id]','ajaxcontentarea');\" onmouseover=\"javascript:urlredirectdiv('ajax_view.php?what=link_interface&id=$tmp_request10[id]','ajaxcontentarea');\">$i</a></div>";
}
else if (($count_interface[0]==0) || ($count_port_interface[0] == 0))
{
echo "<div class=\"interface\"><a href=\"#\" onclick=\"javascript:urlredirectdiv('ajax_view.php?what=interface&id=$tmp_request10[id]','ajaxcontentarea');\" onmouseover=\"javascript:urlredirectdiv('ajax_view.php?what=link_interface&id=$tmp_request10[id]','ajaxcontentarea');\">$i</a></div>";
}
$i++;
}
echo "</div>";
}
?>
</div>
</div>
</div>
<br><center><a href="javascript:history.go(-1);"><?php echo TXT_BACK; ?></a></center>
<?php
}
?>