Location: PHPKode > projects > OpenDataCenter Network Management System > include/mainview_page/path/view.php
<?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
$x=0;

$request=mysql_query("SELECT id FROM $name_table_slot WHERE device_id=$device1_id") or die ("ERROR!");

while($tmp_request=mysql_fetch_array($request))
{
	$request2=mysql_query("SELECT id FROM $name_table_interface WHERE slot_id=$tmp_request[id]") or die ("ERROR!");

	while($tmp_request2=mysql_fetch_array($request2))
	{
		$request3=mysql_query("SELECT * FROM $name_table_link_port_interface WHERE interface_id=$tmp_request2[id]") or die ("ERROR!");

		while($tmp_request3=mysql_fetch_array($request3))
		{			
			$request4=mysql_query("SELECT id,patch_panel_id FROM $name_table_port WHERE id=$tmp_request3[port_id]") or die ("ERROR!");

			while($tmp_request4=mysql_fetch_array($request4))
			{				
				$request5=mysql_query("SELECT name, id FROM $name_table_patch_panel WHERE id=$tmp_request4[patch_panel_id]") or die ("ERROR!");

				while($tmp_request5=mysql_fetch_array($request5))
				{
					$request6=mysql_query("SELECT id FROM $name_table_port WHERE patch_panel_id=$tmp_request5[id]") or die ("ERROR!");

					while($tmp_request6=mysql_fetch_array($request6))
					{
						$request7=mysql_query("SELECT * FROM $name_table_link_port_interface WHERE port_id=$tmp_request6[id]") or die ("ERROR!");

						while($tmp_request7=mysql_fetch_array($request7))
						{
							$request8=mysql_query("SELECT id,slot_id FROM $name_table_interface WHERE id=$tmp_request7[interface_id]") or die ("ERROR!");
							while($tmp_request8=mysql_fetch_array($request8))
							{
								$request9=mysql_query("SELECT id,device_id FROM $name_table_slot WHERE id=$tmp_request8[slot_id]") or die ("ERROR!");
								while($tmp_request9=mysql_fetch_array($request9))
								{
									$request10=mysql_query("SELECT id,name FROM $name_table_device WHERE id=$tmp_request9[device_id]") or die ("ERROR!");
									while($tmp_request10=mysql_fetch_array($request10))
									{
										if ($x == 0)
										{
											echo "$tmp_request10[name] ($tmp_request10[id]) --> $tmp_request2[id] --> $tmp_request3[port_id] --> $tmp_request5[name]";
										}
										else if ($x == 1)
										{
											echo " <--> $tmp_request6[id] --> $tmp_request9[id] --> $tmp_request10[name] ($tmp_request10[id])";
										}
										$x++;
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

?>
Return current item: OpenDataCenter Network Management System