Location: PHPKode > projects > OpenDataCenter Network Management System > ajax_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/
// ----------------------------------------------------------------------

ini_set('session.cookie_lifetime', 0);
ini_set('session.gc_maxlifetime', 120);

session_start(); 

include ("config/config.php");
include ("function/function.php");
include ("version.php");

if (isset($_COOKIE["ODCNMSLANG"]))
{
	$language = $_COOKIE["ODCNMSLANG"];
	include('language/'.$language.'.php');
}
else
{
	include('language/en.php');	
}

$db_connect=mysql_connect($mysql_hostname,$mysql_username,$mysql_password);
mysql_select_db($mysql_database,$db_connect);

if ((isset($_SESSION['login'])) && (!empty($_SESSION['login'])))
{
	$_SESSION['login'] = $login;
			
	if ((!isset($_SESSION['user_authentication'])) && (empty($_SESSION['user_authentication'])))
	{
		user_authentication ($_SESSION['login'],$name_table_users,$mysql_hostname,$mysql_username,$mysql_password,$mysql_database);
	}
	if ((!isset($_SESSION['user_log'])) && (empty($_SESSION['user_log'])))
	{	
		user_log ($_SESSION['login'],$name_table_users,$name_table_users_log,"LOGIN",$mysql_hostname,$mysql_username,$mysql_password,$mysql_database);
	}

	switch($what)
	{
		case 'port':
		$request=mysql_query("SELECT * FROM $name_table_port WHERE id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<b>".TXT_NAME.":</b> $tmp_request[name]<br>";
			echo "<b>".TXT_DESCRIPTION.":</b> $tmp_request[description]<br><br>";
			
			$request_count_port_port=mysql_query("SELECT count(*) FROM $name_table_link_port_port WHERE port_id=\"$id\" OR port2_id=\"$id\"") or die ("ERROR!");
			$result_port_port = mysql_fetch_array($request_count_port_port);
			
			$request_count_port_interface=mysql_query("SELECT count(*) FROM $name_table_link_port_interface WHERE port_id=\"$id\"") or die ("ERROR!");
			$result_port_interface = mysql_fetch_array($request_count_port_interface);			
			
			if (($result_port_port[0]!="0") || ($result_port_interface[0]!="0"))
			{
				echo "[ <a href=\"index.php?include=mainview&page=port&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a> ]";
			}
			else
			{
				echo "[ <a href=\"index.php?include=mainview&page=port&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a> ] [ <a href=\"index.php?include=mainview&page=link&action=add&id_port=$tmp_request[id]\">".TXT_ADD_LINK."</a> ]";
			}			
			
			echo "</div><br>";
		}	
		
		
		$request=mysql_query("SELECT * FROM $name_table_link_port_port WHERE port_id=\"$id\" OR port2_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$tmp_request[port_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
				
			
			}
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$tmp_request[port2_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=port_port&id_port1=$tmp_request[port_id]&id_port2=$tmp_request[port2_id]\">".TXT_EDIT."</a> ]</div>";
		}
		
		$request=mysql_query("SELECT * FROM $name_table_link_port_interface WHERE port_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a> ";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$id\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=port_interface&id_port=$tmp_request[port_id]&id_interface=$tmp_request[interface_id]\">".TXT_EDIT."</a> ] </div>";
		}		
		break;

		case 'link_port':
		$request=mysql_query("SELECT * FROM $name_table_link_port_port WHERE port_id=\"$id\" OR port2_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$tmp_request[port_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$tmp_request[port2_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=port_port&id_port1=$tmp_request[port_id]&id_port2=$tmp_request[port2_id]\">".TXT_EDIT."</a> ] </div>";
		}
		
		$request=mysql_query("SELECT * FROM $name_table_link_port_interface WHERE port_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a>";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$id\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=port_interface&id_port=$tmp_request[port_id]&id_interface=$tmp_request[interface_id]\">".TXT_EDIT."</a> ] </div>";
		}				
		break;
		
		case 'interface':
		$arrayifType[1] = "other";
		$arrayifType[2] = "regular1822";
		$arrayifType[3] = "hdh1822";
		$arrayifType[4] = "ddnX25";
		$arrayifType[5] = "rfc877x25";
		$arrayifType[6] = "ethernetCsmacd";
		$arrayifType[7] = "iso88023Csmacd";
		$arrayifType[8] = "iso88024TokenBus";
		$arrayifType[9] = "iso88025TokenRing";
		$arrayifType[10] = "iso88026Man";
		$arrayifType[11] = "starLan";
		$arrayifType[12] = "proteon10Mbit";
		$arrayifType[13] = "proteon80Mbit";
		$arrayifType[14] = "hyperchannel";
		$arrayifType[15] = "fddi";
		$arrayifType[16] = "lapb";
		$arrayifType[17] = "sdlc";
		$arrayifType[18] = "ds1";
		$arrayifType[19] = "e1";
		$arrayifType[20] = "basicISDN";
		$arrayifType[21] = "primaryISDN";
		$arrayifType[22] = "propPointToPointSerial";
		$arrayifType[23] = "ppp";
		$arrayifType[24] = "softwareLoopback";
		$arrayifType[25] = "eon";
		$arrayifType[26] = "ethernet3Mbit";
		$arrayifType[27] = "nsip";
		$arrayifType[28] = "slip";
		$arrayifType[29] = "ultra";
		$arrayifType[30] = "ds3";
		$arrayifType[31] = "sip";
		$arrayifType[32] = "frameRelay";
		$arrayifType[33] = "rs232";
		$arrayifType[34] = "para";
		$arrayifType[35] = "arcnet";
		$arrayifType[36] = "arcnetPlus";
		$arrayifType[37] = "atm";
		$arrayifType[38] = "miox25";
		$arrayifType[39] = "sonet";
		$arrayifType[40] = "x25ple";
		$arrayifType[41] = "iso88022llc";
		$arrayifType[42] = "localTalk";
		$arrayifType[43] = "smdsDxi";
		$arrayifType[44] = "frameRelayService";
		$arrayifType[45] = "v35";
		$arrayifType[46] = "hssi";
		$arrayifType[47] = "hippi";
		$arrayifType[48] = "modem";
		$arrayifType[49] = "aal5";
		$arrayifType[50] = "sonetPath";
		$arrayifType[51] = "sonetVT";
		$arrayifType[52] = "smdsIcip";
		$arrayifType[53] = "propVirtual";
		$arrayifType[54] = "propMultiplexor";
		$arrayifType[55] = "ieee80212";
		$arrayifType[56] = "fibreChannel";
		$arrayifType[57] = "hippiInterface";
		$arrayifType[58] = "frameRelayInterconnect";
		$arrayifType[59] = "aflane8023";
		$arrayifType[60] = "aflane8025";
		$arrayifType[61] = "cctEmul";
		$arrayifType[62] = "fastEther";
		$arrayifType[63] = "isdn";
		$arrayifType[64] = "v11";
		$arrayifType[65] = "v36";
		$arrayifType[66] = "g703at64k";
		$arrayifType[67] = "g703at2mb";
		$arrayifType[68] = "qllc";
		$arrayifType[69] = "fastEtherFX";
		$arrayifType[70] = "channel";
		$arrayifType[71] = "ieee80211";
		$arrayifType[72] = "ibm370parChan";
		$arrayifType[73] = "escon";
		$arrayifType[74] = "dlsw";
		$arrayifType[75] = "isdns";
		$arrayifType[76] = "isdnu";
		$arrayifType[77] = "lapd";
		$arrayifType[78] = "ipSwitch";
		$arrayifType[79] = "rsrb";
		$arrayifType[80] = "atmLogical";
		$arrayifType[81] = "ds0";
		$arrayifType[82] = "ds0Bundle";
		$arrayifType[83] = "bsc";
		$arrayifType[84] = "async";
		$arrayifType[85] = "cnr";
		$arrayifType[86] = "iso88025Dtr";
		$arrayifType[87] = "eplrs";
		$arrayifType[88] = "arap";
		$arrayifType[89] = "propCnls";
		$arrayifType[90] = "hostPad";
		$arrayifType[91] = "termPad";
		$arrayifType[92] = "frameRelayMPI";
		$arrayifType[93] = "x213";
		$arrayifType[94] = "adsl";
		$arrayifType[95] = "radsl";
		$arrayifType[96] = "sdsl";
		$arrayifType[97] = "vdsl";
		$arrayifType[98] = "iso88025CRFPInt";
		$arrayifType[99] = "myrinet";
		$arrayifType[100] = "voiceEM";
		$arrayifType[101] = "voiceFXO";
		$arrayifType[102] = "voiceFXS";
		$arrayifType[103] = "voiceEncap";
		$arrayifType[104] = "voiceOverIp";
		$arrayifType[105] = "atmDxi";
		$arrayifType[106] = "atmFuni";
		$arrayifType[107] = "atmIma";
		$arrayifType[108] = "pppMultilinkBundle";
		$arrayifType[109] = "ipOverCdlc";
		$arrayifType[110] = "ipOverClaw";
		$arrayifType[111] = "stackToStack";
		$arrayifType[112] = "virtualIpAddress";
		$arrayifType[113] = "mpc";
		$arrayifType[114] = "ipOverAtm";
		$arrayifType[115] = "iso88025Fiber";
		$arrayifType[116] = "tdlc";
		$arrayifType[117] = "gigabitEthernet";
		$arrayifType[118] = "hdlc";
		$arrayifType[119] = "lapf";
		$arrayifType[120] = "v37";
		$arrayifType[121] = "x25mlp";
		$arrayifType[122] = "x25huntGroup";
		$arrayifType[123] = "trasnpHdlc";
		$arrayifType[124] = "interleave";
		$arrayifType[125] = "fast";
		$arrayifType[126] = "ip";
		$arrayifType[127] = "docsCableMaclayer";
		$arrayifType[128] = "docsCableDownstream";
		$arrayifType[129] = "docsCableUpstream";
		$arrayifType[130] = "a12MppSwitch";
		$arrayifType[131] = "tunnel";
		$arrayifType[132] = "coffee";
		$arrayifType[133] = "ces";
		$arrayifType[134] = "atmSubInterface";
		$arrayifType[135] = "l2vlan";
		$arrayifType[136] = "l3ipvlan";
		$arrayifType[137] = "l3ipxvlan";
		$arrayifType[138] = "digitalPowerline";
		$arrayifType[139] = "mediaMailOverIp";
		$arrayifType[140] = "dtm";
		$arrayifType[141] = "dcn";
		$arrayifType[142] = "ipForward";
		$arrayifType[143] = "msdsl";
		$arrayifType[144] = "ieee1394";
		$arrayifType[145] = "if-gsn";
		$arrayifType[146] = "dvbRccMacLayer";
		$arrayifType[147] = "dvbRccDownstream";
		$arrayifType[148] = "dvbRccUpstream";
		$arrayifType[149] = "atmVirtual";
		$arrayifType[150] = "mplsTunnel";
		$arrayifType[151] = "srp";
		$arrayifType[152] = "voiceOverAtm";
		$arrayifType[153] = "voiceOverFrameRelay";
		$arrayifType[154] = "idsl";
		$arrayifType[155] = "compositeLink";
		$arrayifType[156] = "ss7SigLink";
		$arrayifType[157] = "propWirelessP2P";
		$arrayifType[158] = "frForward";
		$arrayifType[159] = "rfc1483";
		$arrayifType[160] = "usb";
		$arrayifType[161] = "ieee8023adLag";
		$arrayifType[162] = "bgppolicyaccounting";
		$arrayifType[163] = "frf16MfrBundle";
		$arrayifType[164] = "h323Gatekeeper";
		$arrayifType[165] = "h323Proxy";
		$arrayifType[166] = "mpls";
		$arrayifType[167] = "mfSigLink";
		$arrayifType[168] = "hdsl2";
		$arrayifType[169] = "shdsl";
		$arrayifType[170] = "ds1FDL";
		$arrayifType[171] = "pos";
		$arrayifType[172] = "dvbAsiIn";
		$arrayifType[173] = "dvbAsiOut";
		$arrayifType[174] = "plc";
		$arrayifType[175] = "nfas";
		$arrayifType[176] = "tr008";
		$arrayifType[177] = "gr303RDT";
		$arrayifType[178] = "gr303IDT";
		$arrayifType[179] = "isup";
		$arrayifType[180] = "propDocsWirelessMaclayer";
		$arrayifType[181] = "propDocsWirelessDownstream";
		$arrayifType[182] = "propDocsWirelessUpstream";
		$arrayifType[183] = "hiperlan2";
		$arrayifType[184] = "propBWAp2Mp";
		$arrayifType[185] = "sonetOverheadChannel";
		$arrayifType[186] = "digitalWrapperOverheadChannel";
		$arrayifType[187] = "aal2";
		$arrayifType[188] = "radioMAC";
		$arrayifType[189] = "atmRadio";
		$arrayifType[190] = "imt";
		$arrayifType[191] = "mvl";
		$arrayifType[192] = "reachDSL";
		$arrayifType[193] = "frDlciEndPt";
		$arrayifType[194] = "atmVciEndPt";
		$arrayifType[195] = "opticalChannel";
		$arrayifType[196] = "opticalTransport";
		$arrayifType[197] = "propAtm";
		$arrayifType[198] = "voiceOverCable";
		$arrayifType[199] = "infiniband";
		$arrayifType[200] = "teLink";
		$arrayifType[201] = "q2931";
		$arrayifType[202] = "virtualTg";
		$arrayifType[203] = "sipTg";
		$arrayifType[204] = "sipSig";
		$arrayifType[205] = "docsCableUpstreamChannel";
		$arrayifType[206] = "econet";
		$arrayifType[207] = "pon155";
		$arrayifType[208] = "pon622";
		$arrayifType[209] = "bridge";
		$arrayifType[210] = "linegroup";
		$arrayifType[211] = "voiceEMFGD";
		$arrayifType[212] = "voiceFGDEANA";
		$arrayifType[213] = "voiceDID";
		$arrayifType[214] = "mpegTransport";
		$arrayifType[215] = "sixToFour";
		$arrayifType[216] = "gtp";
		$arrayifType[217] = "pdnEtherLoop1";
		$arrayifType[218] = "pdnEtherLoop2";
		$arrayifType[219] = "opticalChannelGroup";
		$arrayifType[220] = "homepna";
		$arrayifType[221] = "gfp";
		$arrayifType[222] = "ciscoISLvlan";
		$arrayifType[223] = "actelisMetaLOOP";
		$arrayifType[224] = "fcipLink";
		$arrayifType[225] = "rpr";
		$arrayifType[226] = "qam";
		$arrayifType[227] = "lmp";
		$arrayifType[228] = "cblVectaStar";
		$arrayifType[229] = "docsCableMCmtsDownstream";
		$arrayifType[230] = "adsl2";
		$arrayifType[231] = "macSecControlledIF";
		$arrayifType[232] = "macSecUncontrolledIF";
		$arrayifType[233] = "aviciOpticalEther";
		$arrayifType[234] = "atmbond";
		$arrayifType[235] = "voiceFGDOS";
		$arrayifType[236] = "mocaVersion1";
		$arrayifType[237] = "ieee80216WMAN";
		$arrayifType[238] = "adsl2plus";
		$arrayifType[239] = "dvbRcsMacLayer";
		$arrayifType[240] = "dvbTdm";
		$arrayifType[241] = "dvbRcsTdma";
		$arrayifType[242] = "x86Laps";
		
		$request=mysql_query("SELECT * FROM $name_table_interface WHERE id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<b>".TXT_INDEX.":</b> $tmp_request[index]<br>";
			echo "<b>".TXT_NAME."::</b> $tmp_request[name]<br>";
			foreach ($arrayifType as $key => $arrayvalue)
			{
				if ($key == $tmp_request['type'])
				{
					echo "<b>".TXT_TYPE."::</b> $arrayvalue<br>";
				}
			}
			switch ($tmp_request['speed'])
			{
				case '10':
				echo "<b>".TXT_SPEED.":</b> 10 Mbps<br>";
				break;
				
				case '100':
				echo "<b>".TXT_SPEED.":</b> 10/100 Mbps<br>";						
				break;
				
				case '1000':
				echo "<b>".TXT_SPEED.":</b> 10/100/1000 Mbps<br>";										
				break;
			}			
			echo "<b>".TXT_DESCRIPTION.":</b> $tmp_request[description]<br><br>";
			
			$request_count_interface_interface=mysql_query("SELECT count(*) FROM $name_table_link_interface_interface WHERE interface_id=\"$id\" OR interface2_id=\"$id\"") or die ("ERROR!");
			$result_interface_interface = mysql_fetch_array($request_count_interface_interface);
			
			$request_count_port_interface=mysql_query("SELECT count(*) FROM $name_table_link_port_interface WHERE interface_id=\"$id\"") or die ("ERROR!");
			$result_port_interface = mysql_fetch_array($request_count_port_interface);			
			
			if (($result_interface_interface[0]!="0") || ($result_port_interface[0]!="0"))
			{
				echo "[ <a href=\"index.php?include=mainview&page=interface&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a> ]";
			}
			else
			{
				echo "[ <a href=\"index.php?include=mainview&page=interface&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a> ] [ <a href=\"index.php?include=mainview&page=link&action=add&id_interface=$tmp_request[id]\">".TXT_ADD_LINK."</a> ]";
			}
			
			echo "</div><br>";
		}
		
		$request=mysql_query("SELECT * FROM $name_table_link_interface_interface WHERE interface_id=\"$id\" OR interface2_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a> ";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface2_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a> ";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=interface_interface&id_interface1=$tmp_request[interface_id]&id_interface2=$tmp_request[interface2_id]\">".TXT_EDIT."</a> ] </div>";
		}
		
		$request=mysql_query("SELECT * FROM $name_table_link_port_interface WHERE interface_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a> ";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$tmp_request[port_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=port_interface&id_port=$tmp_request[port_id]&id_interface=$tmp_request[interface_id]\">".TXT_EDIT."</a> ] </div>";
		}		
		
		break;		
		
		
		case 'link_interface':
		$request=mysql_query("SELECT * FROM $name_table_link_interface_interface WHERE interface_id=\"$id\" OR interface2_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a> ";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface2_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a><br>";
					echo TXT_AND." ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=interface_interface&id_interface1=$tmp_request[interface_id]&id_interface2=$tmp_request[interface2_id]\">".TXT_EDIT."</a> ] </div>";
		}
		
		$request=mysql_query("SELECT * FROM $name_table_link_port_interface WHERE interface_id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<img src=\"images/link.gif\" alt=\"Link\" align=\"top\"> <b>".TXT_LINK_BETWEEN."</b><br><br>";
			
			$request2=mysql_query("SELECT id,slot_id,name FROM $name_table_interface WHERE id=\"$tmp_request[interface_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/interface.gif\" alt=\"Interface\" align=\"top\"> ".TXT_INTERFACE." $tmp_request2[name] of slot";
				
				$request3=mysql_query("SELECT id,number,device_id FROM $name_table_slot WHERE id=\"$tmp_request2[slot_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request3[id]\">$tmp_request3[number]</a> ";
					echo " - ".TXT_DEVICE;
					
					$request4=mysql_query("SELECT id,name FROM $name_table_device WHERE id=\"$tmp_request3[device_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						echo " <a href=\"index.php?include=mainview&page=device&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";
					}					
				}			
			}
			
			$request2=mysql_query("SELECT id,patch_panel_id,name FROM $name_table_port WHERE id=\"$tmp_request[port_id]\"") or die ("ERROR1!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				echo "<img src=\"images/port.gif\" alt=\"Port\" align=\"top\"> ".TXT_PORT." ".TXT_NUMBER." $tmp_request2[name] ".TXT_OF." ".TXT_PATCH_PANEL;
				
				$request3=mysql_query("SELECT id,name,rack_id FROM $name_table_patch_panel WHERE id=\"$tmp_request2[patch_panel_id]\"") or die ("ERROR1!");
				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo " <a href=\"index.php?include=mainview&page=patch_panel&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a> and ";
					
					$request4=mysql_query("SELECT id,name,location_id FROM $name_table_rack WHERE id=\"$tmp_request3[rack_id]\"") or die ("ERROR1!");
					while($tmp_request4=mysql_fetch_array($request4))
					{
						$request5=mysql_query("SELECT id,name FROM $name_table_location WHERE id=\"$tmp_request4[location_id]\"") or die ("ERROR1!");
						while($tmp_request5=mysql_fetch_array($request5))
						{
							echo " <a href=\"index.php?include=mainview&page=rack&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a> (<a href=\"index.php?include=mainview&page=location&action=view&id=$tmp_request5[id]\">$tmp_request5[name]</a>)<br>";
						}
					}	
				}
			}
			echo "<br>[ <a href=\"index.php?include=mainview&page=link&action=edit&what=port_interface&id_port=$tmp_request[port_id]&id_interface=$tmp_request[interface_id]\">".TXT_EDIT."</a> ] </div>";
		}
		
		break;		
		
		case 'patch_panel':
		$request=mysql_query("SELECT * FROM $name_table_patch_panel WHERE id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<b>".TXT_NAME.":</b> $tmp_request[name]<br>";
			echo "<b>".TXT_PORT_DENSITY.":</b> $tmp_request[port_density] ports<br>";
			echo "<b>".TXT_HEIGHT.":</b> $tmp_request[height] U<br>";
			echo "<b>".TXT_DESCRIPTION.":</b> $tmp_request[description]<br><br>";
			echo "[ <a href=\"index.php?include=mainview&page=patch_panel&action=edit&id=$id\">".TXT_EDIT."</a> ]";
			echo "</div>";
		}
		break;	
		
		case 'device':
		$request=mysql_query("SELECT * FROM $name_table_device WHERE id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<b>".TXT_NAME.":</b> <a href=\"index.php?include=mainview&page=device&action=view&id=$id\">$tmp_request[name]</a><br>";
			echo "<b>".TXT_IP_ADDRESS.":</b> ";
			$request5=mysql_query("SELECT id,ip FROM $name_table_ip_address WHERE id=$tmp_request[ip_address_id]") or die ("ERROR!");
			
			while($tmp_request5=mysql_fetch_array($request5))
			{
				echo "<a href=\"index.php?include=mainview&page=ip_address&action=view&id=$tmp_request5[id]\">".$tmp_request5['ip']."</a>";
			}
			echo "<br>";
			
			$request2=mysql_query("SELECT id,name,manufacturer_id,category_id FROM $name_table_model WHERE id=\"$tmp_request[model_id]\"") or die ("ERROR!");

			while($tmp_request2=mysql_fetch_array($request2))
			{	
			
				$request3=mysql_query("SELECT id,name FROM $name_table_manufacturer WHERE id=\"$tmp_request2[manufacturer_id]\"") or die ("ERROR!");
				while($tmp_request3=mysql_fetch_array($request3))
				{	
					echo "<b>".TXT_MANUFACTURER.":</b> <a href=\"index.php?include=mainview&page=manufacturer&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a><br>";						
				}
				
				$request4=mysql_query("SELECT id,name FROM $name_table_category WHERE id=\"$tmp_request2[category_id]\"") or die ("ERROR!");
				while($tmp_request4=mysql_fetch_array($request4))
				{		
					echo "<b>Category:</b> <a href=\"index.php?include=mainview&page=category&action=view&id=$tmp_request4[id]\">$tmp_request4[name]</a><br>";					
				}				
				echo "<b>Model:</b> <a href=\"index.php?include=mainview&page=model&action=view&id=$tmp_request2[id]\">$tmp_request2[name]</a><br>";
			}
			echo "<b>".TXT_DESCRIPTION.":</b> $tmp_request[description]<br><br>";
			echo "[ <a href=\"index.php?include=mainview&page=device&action=view&id=$id\">".TXT_VIEW."</a> ] [ <a href=\"index.php?include=mainview&page=device&action=edit&id=$id\">".TXT_EDIT."</a> ]";
			echo "</div>";
		}
		break;
		
		case 'slot':
		$request=mysql_query("SELECT * FROM $name_table_slot WHERE id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{	
			echo "<div style=\"border:1px solid #c0c0c0;padding:10px;\">";
			echo "<b>Number:</b> <a href=\"index.php?include=mainview&page=slot&action=view&id=$tmp_request[id]\">$tmp_request[number]</a><br>";
			echo "<b>".TXT_DESCRIPTION.":</b> $tmp_request[description]<br>";
			echo "[ <a href=\"index.php?include=mainview&page=slot&action=edit&id=$id\">".TXT_EDIT."</a> ]";
			echo "</div>";
		}
		break;
		
		case 'generatesubnet':
		?>
		<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
		<html>
		<head>
			<title>Open DataCenter Network Management System</title>
			<link href="stylesheets/style.css" rel=StyleSheet type=text/css>
			<link rel="shortcut icon" href="favicon.gif">	
			<script language="JavaScript" type="text/javascript" src="javascript/javascript.js"></script>
			<script language="JavaScript" type="text/javascript" src="javascript/slider.js"></script>
			<script language="JavaScript" type="text/javascript" src="javascript/network_calculator.js"></script>
			<script language="JavaScript" type="text/javascript" src="javascript/javascript_test.js"></script>
			<script language="JavaScript" type="text/javascript" src="javascript/selectbox.js"></script>
			<script language="JavaScript" type="text/javascript" src="javascript/OptionTransfer.js"></script>
			<script language="JavaScript" type="text/javascript" src="javascript/gen_validatorv2.js" ></script>	
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
			<meta http-equiv="Content-Language" content="en-us">
		</head>
		<noscript>
		<div id="noscript">JavaScript must be enabled in order for you to use this application. However, it seems JavaScript is either disabled or not supported by your browser. To use this application, enable JavaScript by changing your browser options, then <a href="index.php">try again</a>.</div>
		</noscript>
		<body>
		<a name="top"></a>
		<center><fieldset class="form" style="width:96%;text-align:left;">
			<legend style="font-size:120%"><img src="images/bulk_edit.gif" alt="Bulk Edit" align="top"> Bulk edit</legend>
			<table border="0" cellspacing="2" cellpadding="5" width="85%">
				<tr style="font-weight:bold;">
					<td width="25%">Select category</td>
					<td width="25%">Select subnet #</td>
					<td width="35%">Edit</td>
				</tr>
				<tr>
					<td width="25%" valign="top">
						<select name="selectcategory" id="selectcategory" size="1" onchange="bulkedit(this.value);">
							<option value="null">Please select a category</option>
							<option value="0">Name</option>
							<option value="1">Customer</option>
							<option value="2">Vlan</option>
							<option value="3">Status</option>
							<option value="4">Description</option>
						</select>					
					</td>
					<td width="25%" valign="top">
						<select name="selectsubnetnumber[]" id="selectsubnetnumber" size="10" multiple>
							<?php
								for ($i = 1;$i < $amountsubnet+1;$i++)
								{
									echo "<option value=\"$i\">Subnet #$i</option>";
								}
							?>
						</select><br>
						<input type="button" value="Select All" onclick="selectAll('selectsubnetnumber',true);" name="Select All"> <input type="button" value="Select None" onclick="selectAll('selectsubnetnumber',false);" name="Select None">						
					</td>
					<td width="35%" id="bulkedit" valign="top"></td>
				</tr>
			</table>
			<font size="1">Press and hold "Ctrl" key to select multiple items</font>
			<center><input type="button" onclick="bulkapply();" value="Apply"></center>
		</fieldset></center>
		<form method="post" action="index.php?include=mainview&page=subnet&action=automatically_add&add=confirm" name="confirm_subnet">
		<div class="form configurationcontent" style="border:0px; text-align:left;">
		<table class="list" id="generatedsubnettable" border="0" width="100%" cellspacing="2" cellpadding="5">
			<tr class="list_title" style="font-weight: bold;background-color: #ededed;">
				<td style="padding:2px;">#</td>
				<td style="padding:2px;"><?php echo TXT_NAME; ?></td>
				<td style="padding:2px;"><?php echo TXT_CUSTOMER; ?></td>
				<td style="padding:2px;"><?php echo TXT_VLAN; ?></td>
				<td style="padding:2px;"><?php echo TXT_ADDRESS; ?> /CIDR</td>
				<td style="padding:2px;"><?php echo TXT_STATUS; ?></td>
				<td style="padding:2px;"><?php echo TXT_DESCRIPTION; ?></td>
				<td style="padding:2px;"><?php echo TXT_ACTION; ?></td>
			</tr>
		<?php
			$list1 = "list1"; 
			$list2 = "list2"; 
			$line_count = 0; 

			$address = $oct1.".".$oct2.".".$oct3.".".$oct4;
			$address2 = ip2long($address);
			for ($i = 1;$i < $amountsubnet+1;$i++)
			{
				$line_color = ($line_count % 2) ? $list1 : $list2;

				if ($i == 1)
				{
					$address2 = $address2 + ($numnode*0);
				}
				else
				{
					$address2 = $address2 + $numnode;
				}
				$address3 = long2ip ($address2);
				echo "<tr class=\"$line_color\"><td valign='top'><center>$i</center></td><td><input type=\"text\" name=\"name_$i\" id=\"name_$i\"size=\"15\"></td><td><select size=\"1\" name=\"customer_$i\" id=\"customer_$i\"></select> <input type=\"hidden\" name=\"customer_array_$i\" id=\"customer_array_$i\" value=\"\"><a href=\"#\" onclick=\"removeselectedoption('customer_$i','customer_array_$i');\"><img src=\"images/garbage.gif\" alt=\"Garbage\" border=\"0\" align=\"top\"></a></td><td><select name=\"vlan_$i\" id=\"vlan_$i\" size=\"1\"></select> <input type=\"hidden\" name=\"vlan_array_$i\" id=\"vlan_array_$i\" value=\"\"><a href=\"#\" onclick=\"removeselectedoption('vlan_$i','vlan_array_$i');\"><img src=\"images/garbage.gif\" alt=\"Garbage\" border=\"0\" align=\"top\"></a></td><td  valign='top'><input type=\"text\" name=\"address_$i\" size=\"20\" value=\"$address3\" style=\"color:#978e7b;\" readonly> <input type=\"text\" name=\"cidr_$i\" size=\"2\" value=\"$cidr\" style=\"color:#978e7b;\" readonly></td><td><select name=\"status_$i\" id=\"status_$i\" size=\"1\"><option value=\"0\">".TXT_ASSIGNED."</option><option value=\"1\" selected>".TXT_UNUSED."</option><option value=\"2\">".TXT_RESERVED."</option></select></td><td><input type=\"text\" name=\"description_$i\" id=\"description_$i\" size=\"20\" maxlength=\"255\"></td><td><input type=\"button\" name=\"delete\" value=\"Delete\" onclick=\"deleteRow(this,'generatedsubnettable');\"></td></tr>";
			}
		?>
		</table>
		<input type="hidden" name="amountsubnet" value="<?php echo "$amountsubnet"; ?>">
		<input type="hidden" name="network_id" value="<?php echo "$network_id"; ?>">
		<input type="hidden" name="mask" value="<?php echo "$mask"; ?>">
		<br><br>
		<center><input type="submit" name="submit" value="<?php echo TXT_CONFIRM; ?>"> <input type="button" name="cancel" value="<?php echo TXT_CANCEL; ?>" onclick="Dialog.cancelCallback();"></center>
		</div>
		</form>
		<html>
		<?php
		break;
		
		case 'bulkcustomer':
		?>
		<select name="bulkcustomer[]" id="bulkcustomer" multiple="multiple" size="10">
		<?php
		$request=mysql_query("select name,id FROM $name_table_customer") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select><br>
		<input type="button" value="Select All" onclick="selectAll('bulkcustomer',true);" name="Select All"> <input type="button" value="Select None" onclick="selectAll('bulkcustomer',false);" name="Select None">
		<?php
		break;
		
		case 'bulkvlan':
		?>
		<div id="add_vlan" style="float:left;display:none;margin-right:5px;"> <input type="text" name="new_vlan_name" id="new_vlan_name" size="15" style="background-image:url(images/background_name.png);background-repeat:no-repeat;"> <input type="text" name="new_vlan_number" id="new_vlan_number" size="15" style="background-image:url(images/background_number.png);background-repeat:no-repeat;"></div>
		<select name="bulkvlan[]" id="bulkvlan" size="1">
		<?php
		$request=mysql_query("select name,id,number FROM $name_table_vlan") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name] ($tmp_request[number])</option>";
		}
		?>
		</select> <input type="button" value="Add a new vlan" onclick="changedisabled('bulkvlan');displayelement('add_vlan');displayelement('bulkvlan'); if(document.getElementById('add_vlan').style.display=='none') this.value='Add a new vlan'; else {this.value='Select a vlan'; document.getElementById('new_vlan_name').value=''; document.getElementById('new_vlan_number').value='';}">
		<?php
		break;		
		
		case 'displaysubnet':
		?>
		<table width="100%" cellspacing="2" cellpadding="3">
			<tr class="list_title" style="font-weight: bold;background-color: #ededed;">
				<td style="padding:2px;"><?php echo TXT_NAME; ?></td>
				<td style="padding:2px;"><?php echo TXT_ADDRESS; ?> /CIDR</td>
				<td style="padding:2px;"><?php echo TXT_CUSTOMER; ?></td>
				<td style="padding:2px;"><?php echo TXT_VLAN; ?></td>
				<td style="padding:2px;"><?php echo TXT_STATUS; ?></td>
				<td style="padding:2px;"><?php echo TXT_DESCRIPTION; ?></td>
				<td style="padding:2px;"><?php echo TXT_ACTION; ?></td>
			</tr>
		<?php
		$request=mysql_query("select * FROM $name_table_subnet WHERE network_id=$id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$cidr = find_net($tmp_request['address'],$tmp_request['mask']);
			?>
			<tr style="background-color:#fff">
			<td width="15%"><?php print("<a href=\"index.php?include=mainview&page=subnet&action=view&id=$tmp_request[id]\">$tmp_request[name]</a>"); ?></td>
			<td width="10%"><?php echo $tmp_request['address']." ".$cidr['cidr'];?></td>
			<td width="15%"><select><?php 
			$request2=mysql_query("select * FROM $name_table_link_customer_subnet WHERE subnet_id=$tmp_request[id]") or die ("ERROR!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				$request3=mysql_query("select id,name FROM $name_table_customer WHERE id=$tmp_request2[customer_id]") or die ("ERROR!");

				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo "<option value=\"$tmp_request3[id]\">$tmp_request3[name]</option>";
				}
			}
			?></select></td>
			<td width="10%"><?php 
			$request2=mysql_query("select * FROM $name_table_link_subnet_vlan WHERE subnet_id=$tmp_request[id]") or die ("ERROR!");

			while($tmp_request2=mysql_fetch_array($request2))
			{
				$request3=mysql_query("select id,name FROM $name_table_vlan WHERE id=$tmp_request2[vlan_id]") or die ("ERROR!");

				while($tmp_request3=mysql_fetch_array($request3))
				{
					echo "<a href=\"$tmp_request3[id]\">$tmp_request3[name]</a>";
				}
			}
			?></td>
			<td width="8%" align="center"><?php			
			switch ($tmp_request['status'])
			{
				case '0':
				echo "<p style='margin:0px;background:#0000ff;color:#fff'>".TXT_ASSIGNED."</p>";
				break;
				
				case '1':
				echo "<p style='margin:0px;background:#00ff00;color:#fff'>".TXT_UNUSED."</p>";
				break;

				case '2':
				echo "<p style='margin:0px;background:#ff0000;color:#fff'>".TXT_RESERVED."</p>";
				break;
				
			}
			?></td>
			<td width="20%"><?php echo $tmp_request['description']; ?></td>
			<td width="12%">[ <?php print("<a href=\"index.php?include=mainview&page=subnet&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a>"); ?> ] [ <?php print("<a href=\"index.php?include=mainview&page=subnet&action=delete&id=$tmp_request[id]\">".TXT_DELETE."</a>"); ?> ]</td></tr><?php
		}
		echo "</table>";
		break;
		
		case 'model':
		?>
		<label><?php echo TXT_MODEL; ?></label>
		<select name="model" id="model" size="1">
			<option value="null"><?php echo TXT_SELECT_MODEL; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_model WHERE category_id=$category_id AND manufacturer_id=$manufacturer_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;
		
		case 'model2':
		?>
		<label><?php echo TXT_MODEL; ?></label>
		<select name="model" id="model" size="1" onchange="javascript:urlredirectdiv('ajax_view.php?what=adddevice2&model_id='+this.value,'ajaxdevicearea');document.getElementById('model_check').value='this.value';">
			<option value="null"><?php echo TXT_SELECT_MODEL; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_model WHERE category_id=$category_id AND manufacturer_id=$manufacturer_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;		
		
		case 'model3':
		?>
		<label><?php echo TXT_MODEL; ?></label>
		<select name="model" id="model" size="1" onchange="javascript:selectlayer('otherip','addvlan',this.value);">
			<option value="null"><?php echo TXT_SELECT_MODEL; ?></option>
		<?php
		$request=mysql_query("select id,name,layer FROM $name_table_model WHERE category_id=$category_id AND manufacturer_id=$manufacturer_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id],$tmp_request[layer]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;		
		
		
		case 'adddevice':
		?>
		<label><?php echo TXT_DEVICE; ?></label>
		<select name="device" id="device" size="1">
			<option value="null"><?php echo TXT_SELECT_DEVICE; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_device WHERE model_id=$model_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;	
		
		case 'adddevice2':
		?>
		<label><?php echo TXT_DEVICE; ?></label>
		<select name="device" id="device" size="1" onchange="javascript:document.getElementById('device_check').value='this.value';">
			<option value="null"><?php echo TXT_SELECT_DEVICE; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_device WHERE model_id=$model_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;		
		
		case 'ajaxsubnet':
		?>
		<label><?php echo TXT_SUBNET; ?></label>
		<select name="subnet" id="subnet" size="1" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxipaddress&subnet_id='+this.value,'ajaxipaddressarea');">
			<option value="null"><?php echo TXT_SELECT_SUBNET; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_subnet WHERE network_id=$network_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;
		
		case 'ajaxsubnet2':
		?>
		<label><?php echo TXT_SUBNET; ?></label>
		<select name="subnet" id="subnet" size="1" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxipaddress2&subnet_id='+this.value,'ajaxipaddressarea');">
			<option value="null"><?php echo TXT_SELECT_SUBNET; ?></option>
		<?php
		$request=mysql_query("select id,name,address,mask FROM $name_table_subnet WHERE network_id=$network_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$cidr = $cidr = find_net($tmp_request['address'],$tmp_request['mask']);
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name] ($tmp_request[address]$cidr[cidr])</option>";
		}
		?>
		</select>
		<?php
		break;		
		
		case 'ajaxnetworkdevice':
		?>
		<label><?php echo TXT_NETWORK; ?></label>
		<select name="network" id="network" size="1" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxsubnetdevice&irowcount=<?php echo "$irowcount"; ?>&network_id='+this.value,'ajaxsubnetarea_<?php echo "$irowcount"; ?>');">
		<option value="null"><?php echo TXT_SELECT_NETWORK_SEGMENT; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_network") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<div id="ajaxsubnetarea_<?php echo "$irowcount"; ?>"></div>
		<?php
		break;		
		
		case 'ajaxsubnetdevice':
		?>
		<label><?php echo TXT_SUBNET; ?></label>
		<select name="subnet_<?php echo "$irowcount"; ?>" id="subnet_<?php echo "$irowcount"; ?>" size="1" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxipaddressdevice&irowcount=<?php echo "$irowcount"; ?>&subnet_id='+this.value,'ajaxipaddressarea_<?php echo "$irowcount"; ?>');">
			<option value="null"><?php echo TXT_SELECT_SUBNET; ?></option>
		<?php
		$request=mysql_query("select id,name,address,mask FROM $name_table_subnet WHERE network_id=$network_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$cidr = $cidr = find_net($tmp_request['address'],$tmp_request['mask']);
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name] ($tmp_request[address]$cidr[cidr])</option>";
		}
		?>
		</select>
		<div id="ajaxipaddressarea_<?php echo "$irowcount"; ?>"></div>		
		<?php
		break;		

		case 'ajaxipaddressdevice':
		$request=mysql_query("select address FROM $name_table_subnet WHERE id=$subnet_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$addressarray = explode(".", $tmp_request['address']);
		}			
		?>
		<label id="address_label_<?php echo "$irowcount"; ?>"><?php echo TXT_ADDRESS; ?></label>
		<div id="add_address_<?php echo "$irowcount"; ?>" style="display:none;margin-right:5px;"> <input type="hidden" id="new_address_<?php echo "$irowcount"; ?>" name="new_address_<?php echo "$irowcount"; ?>" value=""><label><?php echo TXT_ADDRESS; ?></label> <input type="text" name="oct1_<?php echo "$irowcount"; ?>" id="oct1_<?php echo "$irowcount"; ?>" size="3" maxlength="3" value="<?php echo $addressarray[0]; ?>" onkeydown="keynext(event.keyCode,'oct2_<?php echo "$irowcount"; ?>');if (event.keyCode==190) return false;" onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct2_<?php echo "$irowcount"; ?>" id="oct2_<?php echo "$irowcount"; ?>" onkeydown="keynext(event.keyCode,'oct3_<?php echo "$irowcount"; ?>');if (event.keyCode==190) return false;" size="3" maxlength="3" value="<?php echo $addressarray[1]; ?>"onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct3_<?php echo "$irowcount"; ?>" id="oct3_<?php echo "$irowcount"; ?>" size="3" maxlength="3" value="<?php echo $addressarray[2]; ?>"onkeydown="keynext(event.keyCode,'oct4_<?php echo "$irowcount"; ?>');if (event.keyCode==190) return false;" onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct4_<?php echo "$irowcount"; ?>" id="oct4_<?php echo "$irowcount"; ?>" size="3" maxlength="3" value="<?php echo $addressarray[3]; ?>" onKeyPress="return numbersonly(this, event);"> <label><?php echo TXT_MAC_ADDRESS; ?> <font size="1">(xxxx.xxxx.xxxx format)</font></label> <input type="text" name="mac1_<?php echo "$irowcount"; ?>" id="mac1_<?php echo "$irowcount"; ?>" size="4" maxlength="4" onkeydown="keynext(event.keyCode,'mac2_<?php echo "$irowcount"; ?>');if (event.keyCode==190) return false;"><span style="top: -6px;position:relative;">.</span><input type="text" name="mac2_<?php echo "$irowcount"; ?>" id="mac2_<?php echo "$irowcount"; ?>" onkeydown="keynext(event.keyCode,'mac3_<?php echo "$irowcount"; ?>');if (event.keyCode==190) return false;" size="4" maxlength="4"><span style="top: -6px;position:relative;">.</span><input type="text" name="mac3_<?php echo "$irowcount"; ?>" id="mac3_<?php echo "$irowcount"; ?>" size="4" maxlength="4" onkeydown="keynext(event.keyCode,'mac4_<?php echo "$irowcount"; ?>');if (event.keyCode==190) return false;"> <label><?php echo TXT_NAME; ?> & <?php echo TXT_DESCRIPTION; ?></label> <input type="text" name="new_address_name_<?php echo "$irowcount"; ?>" id="new_address_name_<?php echo "$irowcount"; ?>" size="15" style="background-image:url(images/background_name.png);background-repeat:no-repeat;"> <input type="text" name="new_address_description_<?php echo "$irowcount"; ?>" id="new_address_description_<?php echo "$irowcount"; ?>" size="20" style="background-image:url(images/background_description.png);background-repeat:no-repeat;"></div>
		<select name="address_<?php echo "$irowcount"; ?>" id="address_<?php echo "$irowcount"; ?>" size="1" style="float:left; margin-right:5px;">
		<?php
		$request=mysql_query("select id,name,ip FROM $name_table_ip_address WHERE subnet_id=$subnet_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[ip] - $tmp_request[name]</option>";
		}
		?>
		</select>
		<input type="button" value="Add a new address" onclick="document.getElementById('new_address_<?php echo "$irowcount"; ?>').value='yes';changedisabled('address_<?php echo "$irowcount"; ?>');displayelement('add_address_<?php echo "$irowcount"; ?>');displayelement('address_label_<?php echo "$irowcount"; ?>');displayelement('address_<?php echo "$irowcount"; ?>'); if (this.value=='Add a new address'){this.value='Select an address';} else {this.value='Add a new address';document.getElementById('new_address_<?php echo "$irowcount"; ?>').value='';document.getElementById('new_address_name_<?php echo "$irowcount"; ?>').value='';document.getElementById('new_address_description_<?php echo "$irowcount"; ?>').value='';}"><br>
		<?php
		break;			
		
		case 'ajaxipaddress':
		$request=mysql_query("select id,address,mask FROM $name_table_subnet WHERE id=$subnet_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$addressarray = explode(".", $tmp_request['address']);
		}
		?>
		<label><?php echo TXT_ADDRESS; ?></label>
		<input type="text" name="oct1" id="oct1" size="3" maxlength="3" value="<?php echo $addressarray[0]; ?>" onkeydown="keynext(event.keyCode,'oct2');if (event.keyCode==190) return false;" onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct2" id="oct2" onkeydown="keynext(event.keyCode,'oct3');if (event.keyCode==190) return false;" size="3" maxlength="3" value="<?php echo $addressarray[1]; ?>"onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct3" id="oct3" size="3" maxlength="3" value="<?php echo $addressarray[2]; ?>"onkeydown="keynext(event.keyCode,'oct4');if (event.keyCode==190) return false;" onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct4" id="oct4" size="3" maxlength="3" value="<?php echo $addressarray[3]; ?>" onKeyPress="return numbersonly(this, event);"><br>	
		<?php
		break;
		
		case 'ajaxipaddress2':
		$request=mysql_query("select address FROM $name_table_subnet WHERE id=$subnet_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$addressarray = explode(".", $tmp_request['address']);
		}			
		?>
		<label id="address_label"><?php echo TXT_ADDRESS; ?></label>
		<div id="add_address" style="display:none;margin-right:5px;"> <input type="hidden" id="new_address" name="new_address" value=""><label><?php echo TXT_ADDRESS; ?></label> <input type="text" name="oct1" id="oct1" size="3" maxlength="3" value="<?php echo $addressarray[0]; ?>" onkeydown="keynext(event.keyCode,'oct2');if (event.keyCode==190) return false;" onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct2" id="oct2" onkeydown="keynext(event.keyCode,'oct3');if (event.keyCode==190) return false;" size="3" maxlength="3" value="<?php echo $addressarray[1]; ?>"onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct3" id="oct3" size="3" maxlength="3" value="<?php echo $addressarray[2]; ?>"onkeydown="keynext(event.keyCode,'oct4');if (event.keyCode==190) return false;" onKeyPress="return numbersonly(this, event);"><span style="top: -6px;position:relative;">.</span><input type="text" name="oct4" id="oct4" size="3" maxlength="3" value="<?php echo $addressarray[3]; ?>" onKeyPress="return numbersonly(this, event);"> <label><?php echo TXT_MAC_ADDRESS; ?> <font size="1">(xxxx.xxxx.xxxx format)</font></label> <input type="text" name="mac1" id="mac1" size="4" maxlength="4" onkeydown="keynext(event.keyCode,'mac2');if (event.keyCode==190) return false;"><span style="top: -6px;position:relative;">.</span><input type="text" name="mac2" id="mac2" onkeydown="keynext(event.keyCode,'mac3');if (event.keyCode==190) return false;" size="4" maxlength="4"><span style="top: -6px;position:relative;">.</span><input type="text" name="mac3" id="mac3" size="4" maxlength="4" onkeydown="keynext(event.keyCode,'mac4');if (event.keyCode==190) return false;"> <label><?php echo TXT_NAME; ?> & <?php echo TXT_DESCRIPTION; ?></label> <input type="text" name="new_address_name" id="new_address_name" size="15" style="background-image:url(images/background_name.png);background-repeat:no-repeat;"> <input type="text" name="new_address_description" id="new_address_description" size="20" style="background-image:url(images/background_description.png);background-repeat:no-repeat;"></div>
		<select name="address" id="address" size="1" style="float:left; margin-right:5px;">
		<?php
		$request=mysql_query("select id,name,ip FROM $name_table_ip_address WHERE subnet_id=$subnet_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[ip] - $tmp_request[name]</option>";
		}
		?>
		</select>
		<input type="button" value="Add a new address" onclick="document.getElementById('new_address').value='yes';changedisabled('address');displayelement('add_address');displayelement('address_label');displayelement('address'); if (this.value=='Add a new address'){this.value='Select an address';} else {this.value='Add a new address';document.getElementById('new_address').value='';document.getElementById('new_address_name').value='';document.getElementById('new_address_description').value='';}"><br>
		<?php
		break;		
		
		case 'ajaxrack':
		?>		
		<label><?php echo TXT_RACK; ?></label>
		<select name="rack" id="rack" size="1">
			<option value="null"><?php echo TXT_SELECT_RACK; ?></option>
		<?php
		$request=mysql_query("select id,name FROM $name_table_rack WHERE location_id=$location_id") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
		}
		?>
		</select>
		<?php
		break;
		
		case 'snmpajax':
		$sysname = snmpget("$ipaddress:$snmpport","$snmpreadcommunity",".1.3.6.1.2.1.1.5.0","200000","3");
		$sysdescr = snmpget("$ipaddress:$snmpport","$snmpreadcommunity",".1.3.6.1.2.1.1.1.0","200000","3");
		?>
		<label><?php echo TXT_NAME; ?></label>
		<input type="text" name="name" size="50" value=<?php echo "$sysname";?>><br>
		<label><?php echo TXT_LOCATION; ?></label>
		<select name="location" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxrack&location_id='+this.value,'ajaxrackarea');">
			<?php
			$request=mysql_query("SELECT name,id FROM $name_table_location ORDER BY name ASC") or die ("ERROR!");

			while($tmp_request=mysql_fetch_array($request))
			{
				echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>\n";
			}
			?>
		</select>
		<div id="ajaxrackarea"></div>
		<label><?php echo TXT_DESCRIPTION; ?></label>
		<textarea name="description" rows="10" cols="50"><?php echo "$sysdescr";?></textarea><br>
		<?php
		snmp_set_quick_print(TRUE);

			$ifIndex = snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity", ".1.3.6.1.2.1.2.2.1.1");
			$ifDescr = snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity", ".1.3.6.1.2.1.2.2.1.2");
			$ifType = snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity", ".1.3.6.1.2.1.2.2.1.3");
			$ifSpeed = snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity", ".1.3.6.1.2.1.2.2.1.5");
			$ifAdminStatus = snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity", ".1.3.6.1.2.1.2.2.1.7");
			$ifOperStatus = snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity", ".1.3.6.1.2.1.2.2.1.8");

			$arrayifType[1] = "other";
			$arrayifType[2] = "regular1822";
			$arrayifType[3] = "hdh1822";
			$arrayifType[4] = "ddnX25";
			$arrayifType[5] = "rfc877x25";
			$arrayifType[6] = "ethernetCsmacd";
			$arrayifType[7] = "iso88023Csmacd";
			$arrayifType[8] = "iso88024TokenBus";
			$arrayifType[9] = "iso88025TokenRing";
			$arrayifType[10] = "iso88026Man";
			$arrayifType[11] = "starLan";
			$arrayifType[12] = "proteon10Mbit";
			$arrayifType[13] = "proteon80Mbit";
			$arrayifType[14] = "hyperchannel";
			$arrayifType[15] = "fddi";
			$arrayifType[16] = "lapb";
			$arrayifType[17] = "sdlc";
			$arrayifType[18] = "ds1";
			$arrayifType[19] = "e1";
			$arrayifType[20] = "basicISDN";
			$arrayifType[21] = "primaryISDN";
			$arrayifType[22] = "propPointToPointSerial";
			$arrayifType[23] = "ppp";
			$arrayifType[24] = "softwareLoopback";
			$arrayifType[25] = "eon";
			$arrayifType[26] = "ethernet3Mbit";
			$arrayifType[27] = "nsip";
			$arrayifType[28] = "slip";
			$arrayifType[29] = "ultra";
			$arrayifType[30] = "ds3";
			$arrayifType[31] = "sip";
			$arrayifType[32] = "frameRelay";
			$arrayifType[33] = "rs232";
			$arrayifType[34] = "para";
			$arrayifType[35] = "arcnet";
			$arrayifType[36] = "arcnetPlus";
			$arrayifType[37] = "atm";
			$arrayifType[38] = "miox25";
			$arrayifType[39] = "sonet";
			$arrayifType[40] = "x25ple";
			$arrayifType[41] = "iso88022llc";
			$arrayifType[42] = "localTalk";
			$arrayifType[43] = "smdsDxi";
			$arrayifType[44] = "frameRelayService";
			$arrayifType[45] = "v35";
			$arrayifType[46] = "hssi";
			$arrayifType[47] = "hippi";
			$arrayifType[48] = "modem";
			$arrayifType[49] = "aal5";
			$arrayifType[50] = "sonetPath";
			$arrayifType[51] = "sonetVT";
			$arrayifType[52] = "smdsIcip";
			$arrayifType[53] = "propVirtual";
			$arrayifType[54] = "propMultiplexor";
			$arrayifType[55] = "ieee80212";
			$arrayifType[56] = "fibreChannel";
			$arrayifType[57] = "hippiInterface";
			$arrayifType[58] = "frameRelayInterconnect";
			$arrayifType[59] = "aflane8023";
			$arrayifType[60] = "aflane8025";
			$arrayifType[61] = "cctEmul";
			$arrayifType[62] = "fastEther";
			$arrayifType[63] = "isdn";
			$arrayifType[64] = "v11";
			$arrayifType[65] = "v36";
			$arrayifType[66] = "g703at64k";
			$arrayifType[67] = "g703at2mb";
			$arrayifType[68] = "qllc";
			$arrayifType[69] = "fastEtherFX";
			$arrayifType[70] = "channel";
			$arrayifType[71] = "ieee80211";
			$arrayifType[72] = "ibm370parChan";
			$arrayifType[73] = "escon";
			$arrayifType[74] = "dlsw";
			$arrayifType[75] = "isdns";
			$arrayifType[76] = "isdnu";
			$arrayifType[77] = "lapd";
			$arrayifType[78] = "ipSwitch";
			$arrayifType[79] = "rsrb";
			$arrayifType[80] = "atmLogical";
			$arrayifType[81] = "ds0";
			$arrayifType[82] = "ds0Bundle";
			$arrayifType[83] = "bsc";
			$arrayifType[84] = "async";
			$arrayifType[85] = "cnr";
			$arrayifType[86] = "iso88025Dtr";
			$arrayifType[87] = "eplrs";
			$arrayifType[88] = "arap";
			$arrayifType[89] = "propCnls";
			$arrayifType[90] = "hostPad";
			$arrayifType[91] = "termPad";
			$arrayifType[92] = "frameRelayMPI";
			$arrayifType[93] = "x213";
			$arrayifType[94] = "adsl";
			$arrayifType[95] = "radsl";
			$arrayifType[96] = "sdsl";
			$arrayifType[97] = "vdsl";
			$arrayifType[98] = "iso88025CRFPInt";
			$arrayifType[99] = "myrinet";
			$arrayifType[100] = "voiceEM";
			$arrayifType[101] = "voiceFXO";
			$arrayifType[102] = "voiceFXS";
			$arrayifType[103] = "voiceEncap";
			$arrayifType[104] = "voiceOverIp";
			$arrayifType[105] = "atmDxi";
			$arrayifType[106] = "atmFuni";
			$arrayifType[107] = "atmIma";
			$arrayifType[108] = "pppMultilinkBundle";
			$arrayifType[109] = "ipOverCdlc";
			$arrayifType[110] = "ipOverClaw";
			$arrayifType[111] = "stackToStack";
			$arrayifType[112] = "virtualIpAddress";
			$arrayifType[113] = "mpc";
			$arrayifType[114] = "ipOverAtm";
			$arrayifType[115] = "iso88025Fiber";
			$arrayifType[116] = "tdlc";
			$arrayifType[117] = "gigabitEthernet";
			$arrayifType[118] = "hdlc";
			$arrayifType[119] = "lapf";
			$arrayifType[120] = "v37";
			$arrayifType[121] = "x25mlp";
			$arrayifType[122] = "x25huntGroup";
			$arrayifType[123] = "trasnpHdlc";
			$arrayifType[124] = "interleave";
			$arrayifType[125] = "fast";
			$arrayifType[126] = "ip";
			$arrayifType[127] = "docsCableMaclayer";
			$arrayifType[128] = "docsCableDownstream";
			$arrayifType[129] = "docsCableUpstream";
			$arrayifType[130] = "a12MppSwitch";
			$arrayifType[131] = "tunnel";
			$arrayifType[132] = "coffee";
			$arrayifType[133] = "ces";
			$arrayifType[134] = "atmSubInterface";
			$arrayifType[135] = "l2vlan";
			$arrayifType[136] = "l3ipvlan";
			$arrayifType[137] = "l3ipxvlan";
			$arrayifType[138] = "digitalPowerline";
			$arrayifType[139] = "mediaMailOverIp";
			$arrayifType[140] = "dtm";
			$arrayifType[141] = "dcn";
			$arrayifType[142] = "ipForward";
			$arrayifType[143] = "msdsl";
			$arrayifType[144] = "ieee1394";
			$arrayifType[145] = "if-gsn";
			$arrayifType[146] = "dvbRccMacLayer";
			$arrayifType[147] = "dvbRccDownstream";
			$arrayifType[148] = "dvbRccUpstream";
			$arrayifType[149] = "atmVirtual";
			$arrayifType[150] = "mplsTunnel";
			$arrayifType[151] = "srp";
			$arrayifType[152] = "voiceOverAtm";
			$arrayifType[153] = "voiceOverFrameRelay";
			$arrayifType[154] = "idsl";
			$arrayifType[155] = "compositeLink";
			$arrayifType[156] = "ss7SigLink";
			$arrayifType[157] = "propWirelessP2P";
			$arrayifType[158] = "frForward";
			$arrayifType[159] = "rfc1483";
			$arrayifType[160] = "usb";
			$arrayifType[161] = "ieee8023adLag";
			$arrayifType[162] = "bgppolicyaccounting";
			$arrayifType[163] = "frf16MfrBundle";
			$arrayifType[164] = "h323Gatekeeper";
			$arrayifType[165] = "h323Proxy";
			$arrayifType[166] = "mpls";
			$arrayifType[167] = "mfSigLink";
			$arrayifType[168] = "hdsl2";
			$arrayifType[169] = "shdsl";
			$arrayifType[170] = "ds1FDL";
			$arrayifType[171] = "pos";
			$arrayifType[172] = "dvbAsiIn";
			$arrayifType[173] = "dvbAsiOut";
			$arrayifType[174] = "plc";
			$arrayifType[175] = "nfas";
			$arrayifType[176] = "tr008";
			$arrayifType[177] = "gr303RDT";
			$arrayifType[178] = "gr303IDT";
			$arrayifType[179] = "isup";
			$arrayifType[180] = "propDocsWirelessMaclayer";
			$arrayifType[181] = "propDocsWirelessDownstream";
			$arrayifType[182] = "propDocsWirelessUpstream";
			$arrayifType[183] = "hiperlan2";
			$arrayifType[184] = "propBWAp2Mp";
			$arrayifType[185] = "sonetOverheadChannel";
			$arrayifType[186] = "digitalWrapperOverheadChannel";
			$arrayifType[187] = "aal2";
			$arrayifType[188] = "radioMAC";
			$arrayifType[189] = "atmRadio";
			$arrayifType[190] = "imt";
			$arrayifType[191] = "mvl";
			$arrayifType[192] = "reachDSL";
			$arrayifType[193] = "frDlciEndPt";
			$arrayifType[194] = "atmVciEndPt";
			$arrayifType[195] = "opticalChannel";
			$arrayifType[196] = "opticalTransport";
			$arrayifType[197] = "propAtm";
			$arrayifType[198] = "voiceOverCable";
			$arrayifType[199] = "infiniband";
			$arrayifType[200] = "teLink";
			$arrayifType[201] = "q2931";
			$arrayifType[202] = "virtualTg";
			$arrayifType[203] = "sipTg";
			$arrayifType[204] = "sipSig";
			$arrayifType[205] = "docsCableUpstreamChannel";
			$arrayifType[206] = "econet";
			$arrayifType[207] = "pon155";
			$arrayifType[208] = "pon622";
			$arrayifType[209] = "bridge";
			$arrayifType[210] = "linegroup";
			$arrayifType[211] = "voiceEMFGD";
			$arrayifType[212] = "voiceFGDEANA";
			$arrayifType[213] = "voiceDID";
			$arrayifType[214] = "mpegTransport";
			$arrayifType[215] = "sixToFour";
			$arrayifType[216] = "gtp";
			$arrayifType[217] = "pdnEtherLoop1";
			$arrayifType[218] = "pdnEtherLoop2";
			$arrayifType[219] = "opticalChannelGroup";
			$arrayifType[220] = "homepna";
			$arrayifType[221] = "gfp";
			$arrayifType[222] = "ciscoISLvlan";
			$arrayifType[223] = "actelisMetaLOOP";
			$arrayifType[224] = "fcipLink";
			$arrayifType[225] = "rpr";
			$arrayifType[226] = "qam";
			$arrayifType[227] = "lmp";
			$arrayifType[228] = "cblVectaStar";
			$arrayifType[229] = "docsCableMCmtsDownstream";
			$arrayifType[230] = "adsl2";
			$arrayifType[231] = "macSecControlledIF";
			$arrayifType[232] = "macSecUncontrolledIF";
			$arrayifType[233] = "aviciOpticalEther";
			$arrayifType[234] = "atmbond";
			$arrayifType[235] = "voiceFGDOS";
			$arrayifType[236] = "mocaVersion1";
			$arrayifType[237] = "ieee80216WMAN";
			$arrayifType[238] = "adsl2plus";
			$arrayifType[239] = "dvbRcsMacLayer";
			$arrayifType[240] = "dvbTdm";
			$arrayifType[241] = "dvbRcsTdma";
			$arrayifType[242] = "x86Laps";
?>
		<label><?php echo TXT_INTERFACE; ?></label>
			<?php
			
			function parseslotinterface($ifDescription)
			{
				switch (TRUE)
				{
					case (eregi ("GigabitEthernet[0-9]/[0-9]*", $ifDescription)):
					$ifDescription = eregi_replace ("[a-zA-Z]*","",$ifDescription);
					$ifDescription = eregi_replace ("\"*","",$ifDescription);
					$ifDescription = explode ("/",$ifDescription);
					return $ifDescription;
					break;				
				}
			}
			
			?>
			<input type="hidden" name="slot_interface_snmp" value="yes">
			<table class="list" width="100%" cellspacing="2" cellpadding="2" id="interface_table">
				<tr class="list_title">
					<td width="1%" valign="top"><?php echo TXT_INDEX; ?></td>
					<td width="5%" valign="top"><?php echo TXT_SLOT; ?></td>
					<td width="37%" valign="top"><?php echo TXT_NAME; ?></td>
					<td width="25%" valign="top"><?php echo TXT_TYPE; ?></td>
					<td width="25%" valign="top"><?php echo TXT_SPEED; ?></td>
					<td width="5%" valign="top"><?php echo TXT_ACTION; ?></td>
				</tr>	
															
			<?php	
			$interface_number = 0;
			for ($i=0; $i<count($ifIndex); $i++) {
				$iftypenb = $ifType[$i];
				if ($iftypenb != "53")
				{
					$parsedDescr = parseslotinterface($ifDescr[$i]);
				
					print "<tr>";
					print "<td width=\"1%\" align=\"center\" valign=\"top\"><input type=\"text\" name=\"index_interface_$i\" style=\"margin:0px;\" size=\"3\" value=\"$ifIndex[$i]\" readonly></td>";
					print "<td width=\"5%\" align=\"center\" valign=\"top\"><input type=\"text\" name=\"slot_interface_$i\" style=\"margin:0px;\" size=\"3\" value=\"$parsedDescr[0]\" readonly></td>";
					print "<td width=\"37%\" valign=\"top\"><input type=\"text\" name=\"name_interface_$i\" style=\"margin:0px;\" size=\"50\" value=$ifDescr[$i]></td>";
					print "<td width=\"25%\" valign=\"top\"><select name=\"type_interface_$i\">";
					
					foreach ($arrayifType as $key => $arrayvalue)
					{
						if ($key == $iftypenb)
						{
							echo "<option value=\"$key\" selected>$arrayvalue</option>";
						}
					}
					
					print "</select></td>";
					print "<td width=\"25%\" valign=\"top\"><select name=\"speed_interface_$i\">";
					
					switch ($ifSpeed[$i])
					{
					
						case '100000000' :
						case '1000000000':
						case '10000000':
						echo "<option value=\"1000\" selected>10/100/1000 Mbps</option>";
						break;
						
						case '100000':
						echo "<option value=\"100\" selected>10/100 Mbps</option>";
						break;
						
						case '10000':
						echo "<option value=\"10\" selected>10 Mbps</option>";
						break;						
						
						default : 
						echo "<option value=\"100\" selected>10/100 Mbps</option>";
						break;
						
					
					}			
					print"</select></td>";
					print "<td width=\"5%\" valign=\"top\"><a href=\"#\" onclick=\"deleteRow(this,'interface_table');\"><img src=\"images/garbage.gif\" alt=\"Garbage\" border=\"0\" align=\"top\"></a></td>";
					print "</tr>";
					$interface_number++;
				}
			echo "<input type=\"hidden\" name=\"interface_number\" id=\"interface_number\" value=\"$interface_number\">";
			}
			?>
		</table></div>
		<?php
		break;
		
		
		case 'addslots':
		
		$arrayifType[1] = "other";
			$arrayifType[2] = "regular1822";
			$arrayifType[3] = "hdh1822";
			$arrayifType[4] = "ddnX25";
			$arrayifType[5] = "rfc877x25";
			$arrayifType[6] = "ethernetCsmacd";
			$arrayifType[7] = "iso88023Csmacd";
			$arrayifType[8] = "iso88024TokenBus";
			$arrayifType[9] = "iso88025TokenRing";
			$arrayifType[10] = "iso88026Man";
			$arrayifType[11] = "starLan";
			$arrayifType[12] = "proteon10Mbit";
			$arrayifType[13] = "proteon80Mbit";
			$arrayifType[14] = "hyperchannel";
			$arrayifType[15] = "fddi";
			$arrayifType[16] = "lapb";
			$arrayifType[17] = "sdlc";
			$arrayifType[18] = "ds1";
			$arrayifType[19] = "e1";
			$arrayifType[20] = "basicISDN";
			$arrayifType[21] = "primaryISDN";
			$arrayifType[22] = "propPointToPointSerial";
			$arrayifType[23] = "ppp";
			$arrayifType[24] = "softwareLoopback";
			$arrayifType[25] = "eon";
			$arrayifType[26] = "ethernet3Mbit";
			$arrayifType[27] = "nsip";
			$arrayifType[28] = "slip";
			$arrayifType[29] = "ultra";
			$arrayifType[30] = "ds3";
			$arrayifType[31] = "sip";
			$arrayifType[32] = "frameRelay";
			$arrayifType[33] = "rs232";
			$arrayifType[34] = "para";
			$arrayifType[35] = "arcnet";
			$arrayifType[36] = "arcnetPlus";
			$arrayifType[37] = "atm";
			$arrayifType[38] = "miox25";
			$arrayifType[39] = "sonet";
			$arrayifType[40] = "x25ple";
			$arrayifType[41] = "iso88022llc";
			$arrayifType[42] = "localTalk";
			$arrayifType[43] = "smdsDxi";
			$arrayifType[44] = "frameRelayService";
			$arrayifType[45] = "v35";
			$arrayifType[46] = "hssi";
			$arrayifType[47] = "hippi";
			$arrayifType[48] = "modem";
			$arrayifType[49] = "aal5";
			$arrayifType[50] = "sonetPath";
			$arrayifType[51] = "sonetVT";
			$arrayifType[52] = "smdsIcip";
			$arrayifType[53] = "propVirtual";
			$arrayifType[54] = "propMultiplexor";
			$arrayifType[55] = "ieee80212";
			$arrayifType[56] = "fibreChannel";
			$arrayifType[57] = "hippiInterface";
			$arrayifType[58] = "frameRelayInterconnect";
			$arrayifType[59] = "aflane8023";
			$arrayifType[60] = "aflane8025";
			$arrayifType[61] = "cctEmul";
			$arrayifType[62] = "fastEther";
			$arrayifType[63] = "isdn";
			$arrayifType[64] = "v11";
			$arrayifType[65] = "v36";
			$arrayifType[66] = "g703at64k";
			$arrayifType[67] = "g703at2mb";
			$arrayifType[68] = "qllc";
			$arrayifType[69] = "fastEtherFX";
			$arrayifType[70] = "channel";
			$arrayifType[71] = "ieee80211";
			$arrayifType[72] = "ibm370parChan";
			$arrayifType[73] = "escon";
			$arrayifType[74] = "dlsw";
			$arrayifType[75] = "isdns";
			$arrayifType[76] = "isdnu";
			$arrayifType[77] = "lapd";
			$arrayifType[78] = "ipSwitch";
			$arrayifType[79] = "rsrb";
			$arrayifType[80] = "atmLogical";
			$arrayifType[81] = "ds0";
			$arrayifType[82] = "ds0Bundle";
			$arrayifType[83] = "bsc";
			$arrayifType[84] = "async";
			$arrayifType[85] = "cnr";
			$arrayifType[86] = "iso88025Dtr";
			$arrayifType[87] = "eplrs";
			$arrayifType[88] = "arap";
			$arrayifType[89] = "propCnls";
			$arrayifType[90] = "hostPad";
			$arrayifType[91] = "termPad";
			$arrayifType[92] = "frameRelayMPI";
			$arrayifType[93] = "x213";
			$arrayifType[94] = "adsl";
			$arrayifType[95] = "radsl";
			$arrayifType[96] = "sdsl";
			$arrayifType[97] = "vdsl";
			$arrayifType[98] = "iso88025CRFPInt";
			$arrayifType[99] = "myrinet";
			$arrayifType[100] = "voiceEM";
			$arrayifType[101] = "voiceFXO";
			$arrayifType[102] = "voiceFXS";
			$arrayifType[103] = "voiceEncap";
			$arrayifType[104] = "voiceOverIp";
			$arrayifType[105] = "atmDxi";
			$arrayifType[106] = "atmFuni";
			$arrayifType[107] = "atmIma";
			$arrayifType[108] = "pppMultilinkBundle";
			$arrayifType[109] = "ipOverCdlc";
			$arrayifType[110] = "ipOverClaw";
			$arrayifType[111] = "stackToStack";
			$arrayifType[112] = "virtualIpAddress";
			$arrayifType[113] = "mpc";
			$arrayifType[114] = "ipOverAtm";
			$arrayifType[115] = "iso88025Fiber";
			$arrayifType[116] = "tdlc";
			$arrayifType[117] = "gigabitEthernet";
			$arrayifType[118] = "hdlc";
			$arrayifType[119] = "lapf";
			$arrayifType[120] = "v37";
			$arrayifType[121] = "x25mlp";
			$arrayifType[122] = "x25huntGroup";
			$arrayifType[123] = "trasnpHdlc";
			$arrayifType[124] = "interleave";
			$arrayifType[125] = "fast";
			$arrayifType[126] = "ip";
			$arrayifType[127] = "docsCableMaclayer";
			$arrayifType[128] = "docsCableDownstream";
			$arrayifType[129] = "docsCableUpstream";
			$arrayifType[130] = "a12MppSwitch";
			$arrayifType[131] = "tunnel";
			$arrayifType[132] = "coffee";
			$arrayifType[133] = "ces";
			$arrayifType[134] = "atmSubInterface";
			$arrayifType[135] = "l2vlan";
			$arrayifType[136] = "l3ipvlan";
			$arrayifType[137] = "l3ipxvlan";
			$arrayifType[138] = "digitalPowerline";
			$arrayifType[139] = "mediaMailOverIp";
			$arrayifType[140] = "dtm";
			$arrayifType[141] = "dcn";
			$arrayifType[142] = "ipForward";
			$arrayifType[143] = "msdsl";
			$arrayifType[144] = "ieee1394";
			$arrayifType[145] = "if-gsn";
			$arrayifType[146] = "dvbRccMacLayer";
			$arrayifType[147] = "dvbRccDownstream";
			$arrayifType[148] = "dvbRccUpstream";
			$arrayifType[149] = "atmVirtual";
			$arrayifType[150] = "mplsTunnel";
			$arrayifType[151] = "srp";
			$arrayifType[152] = "voiceOverAtm";
			$arrayifType[153] = "voiceOverFrameRelay";
			$arrayifType[154] = "idsl";
			$arrayifType[155] = "compositeLink";
			$arrayifType[156] = "ss7SigLink";
			$arrayifType[157] = "propWirelessP2P";
			$arrayifType[158] = "frForward";
			$arrayifType[159] = "rfc1483";
			$arrayifType[160] = "usb";
			$arrayifType[161] = "ieee8023adLag";
			$arrayifType[162] = "bgppolicyaccounting";
			$arrayifType[163] = "frf16MfrBundle";
			$arrayifType[164] = "h323Gatekeeper";
			$arrayifType[165] = "h323Proxy";
			$arrayifType[166] = "mpls";
			$arrayifType[167] = "mfSigLink";
			$arrayifType[168] = "hdsl2";
			$arrayifType[169] = "shdsl";
			$arrayifType[170] = "ds1FDL";
			$arrayifType[171] = "pos";
			$arrayifType[172] = "dvbAsiIn";
			$arrayifType[173] = "dvbAsiOut";
			$arrayifType[174] = "plc";
			$arrayifType[175] = "nfas";
			$arrayifType[176] = "tr008";
			$arrayifType[177] = "gr303RDT";
			$arrayifType[178] = "gr303IDT";
			$arrayifType[179] = "isup";
			$arrayifType[180] = "propDocsWirelessMaclayer";
			$arrayifType[181] = "propDocsWirelessDownstream";
			$arrayifType[182] = "propDocsWirelessUpstream";
			$arrayifType[183] = "hiperlan2";
			$arrayifType[184] = "propBWAp2Mp";
			$arrayifType[185] = "sonetOverheadChannel";
			$arrayifType[186] = "digitalWrapperOverheadChannel";
			$arrayifType[187] = "aal2";
			$arrayifType[188] = "radioMAC";
			$arrayifType[189] = "atmRadio";
			$arrayifType[190] = "imt";
			$arrayifType[191] = "mvl";
			$arrayifType[192] = "reachDSL";
			$arrayifType[193] = "frDlciEndPt";
			$arrayifType[194] = "atmVciEndPt";
			$arrayifType[195] = "opticalChannel";
			$arrayifType[196] = "opticalTransport";
			$arrayifType[197] = "propAtm";
			$arrayifType[198] = "voiceOverCable";
			$arrayifType[199] = "infiniband";
			$arrayifType[200] = "teLink";
			$arrayifType[201] = "q2931";
			$arrayifType[202] = "virtualTg";
			$arrayifType[203] = "sipTg";
			$arrayifType[204] = "sipSig";
			$arrayifType[205] = "docsCableUpstreamChannel";
			$arrayifType[206] = "econet";
			$arrayifType[207] = "pon155";
			$arrayifType[208] = "pon622";
			$arrayifType[209] = "bridge";
			$arrayifType[210] = "linegroup";
			$arrayifType[211] = "voiceEMFGD";
			$arrayifType[212] = "voiceFGDEANA";
			$arrayifType[213] = "voiceDID";
			$arrayifType[214] = "mpegTransport";
			$arrayifType[215] = "sixToFour";
			$arrayifType[216] = "gtp";
			$arrayifType[217] = "pdnEtherLoop1";
			$arrayifType[218] = "pdnEtherLoop2";
			$arrayifType[219] = "opticalChannelGroup";
			$arrayifType[220] = "homepna";
			$arrayifType[221] = "gfp";
			$arrayifType[222] = "ciscoISLvlan";
			$arrayifType[223] = "actelisMetaLOOP";
			$arrayifType[224] = "fcipLink";
			$arrayifType[225] = "rpr";
			$arrayifType[226] = "qam";
			$arrayifType[227] = "lmp";
			$arrayifType[228] = "cblVectaStar";
			$arrayifType[229] = "docsCableMCmtsDownstream";
			$arrayifType[230] = "adsl2";
			$arrayifType[231] = "macSecControlledIF";
			$arrayifType[232] = "macSecUncontrolledIF";
			$arrayifType[233] = "aviciOpticalEther";
			$arrayifType[234] = "atmbond";
			$arrayifType[235] = "voiceFGDOS";
			$arrayifType[236] = "mocaVersion1";
			$arrayifType[237] = "ieee80216WMAN";
			$arrayifType[238] = "adsl2plus";
			$arrayifType[239] = "dvbRcsMacLayer";
			$arrayifType[240] = "dvbTdm";
			$arrayifType[241] = "dvbRcsTdma";
			$arrayifType[242] = "x86Laps";
		
		for ($i=1;$i<$nb_slot+1;$i++)
		{
		?>
		<fieldset class="form"><legend><span style="position:relative;top:-10px;"><?php echo TXT_SLOT; ?> # </span><input type="text" name="name_slot_<?php echo $i; ?>" id="name_slot_<?php echo $i; ?>" value="<?php echo $i; ?>" size="3" maxsize="3" onKeyPress="return numbersonly(this, event)"></legend><span style="position:relative;top:-10px"><?php echo TXT_INTERFACE; ?> <?php echo TXT_DENSITY; ?></span> <select name="interface_density_<?php echo $i; ?>" id="interface_density_<?php echo $i; ?>" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxinterfacedensity&interface_id='+this.value+'&id=<?php echo $i; ?>','ajaxinterfacedensity_<?php echo $i; ?>');"> <option value="6">6 <?php echo TXT_PORTS; ?></option> <option value="12">12 <?php echo TXT_PORTS; ?></option> <option value="16">16 <?php echo TXT_PORTS; ?></option> <option value="24">24 <?php echo TXT_PORTS; ?></option> <option value="32">32 <?php echo TXT_PORTS; ?></option> <option value="48">48 <?php echo TXT_PORTS; ?></option> <option value="96">96 <?php echo TXT_PORTS; ?></option> <option value="other"><?php echo TXT_OTHER; ?>...</option></select> <span id="ajaxinterfacedensity_<?php echo $i; ?>"></span><span style="position:relative;top:-10px;margin-left: 15px;"><?php echo TXT_INTERFACE; ?> <?php echo TXT_TYPE; ?></span> <select name="interface_type_<?php echo $i; ?>" id="interface_type_<?php echo $i; ?>"><?php
		
		foreach ($arrayifType as $key => $arrayvalue)
		{
			if ($key == 6)
			{
				echo "<option value=\"$key\" selected>$arrayvalue</option>";
			}
			else
			{
				echo "<option value=\"$key\">$arrayvalue</option>";
			}
		}
		
		?></select> <span style="position:relative;top:-10px;margin-left: 15px;"><?php echo TXT_INTERFACE; ?> <?php echo TXT_SPEED; ?></span> <select name="interface_speed_<?php echo $i; ?>" id="interface_speed_<?php echo $i; ?>" onchange="javascript:urlredirectdiv('ajax_view.php?what=ajaxinterfacespeed&interface_id='+this.value+'&id=<?php echo $i; ?>','ajaxinterfacespeed_<?php echo $i; ?>');"> <option value="10">10 Mbps</option> <option value="100">10/100 Mbps</option> <option value="1000">10/100/1000 Mbps</option> <option value="1001">1000 Mbps</option> <option value="other"><?php echo TXT_OTHER; ?>...</option></select> <span id="ajaxinterfacespeed_<?php echo $i; ?>"></span> <input type="hidden" value="" id="nb_interface_slot_<?php echo $i; ?>" name="nb_interface_slot_<?php echo $i; ?>"></div></fieldset>
		<?php
		}
		break;
		
		case 'addslotsinterfaces':
		
		$arrayifType[1] = "other";
			$arrayifType[2] = "regular1822";
			$arrayifType[3] = "hdh1822";
			$arrayifType[4] = "ddnX25";
			$arrayifType[5] = "rfc877x25";
			$arrayifType[6] = "ethernetCsmacd";
			$arrayifType[7] = "iso88023Csmacd";
			$arrayifType[8] = "iso88024TokenBus";
			$arrayifType[9] = "iso88025TokenRing";
			$arrayifType[10] = "iso88026Man";
			$arrayifType[11] = "starLan";
			$arrayifType[12] = "proteon10Mbit";
			$arrayifType[13] = "proteon80Mbit";
			$arrayifType[14] = "hyperchannel";
			$arrayifType[15] = "fddi";
			$arrayifType[16] = "lapb";
			$arrayifType[17] = "sdlc";
			$arrayifType[18] = "ds1";
			$arrayifType[19] = "e1";
			$arrayifType[20] = "basicISDN";
			$arrayifType[21] = "primaryISDN";
			$arrayifType[22] = "propPointToPointSerial";
			$arrayifType[23] = "ppp";
			$arrayifType[24] = "softwareLoopback";
			$arrayifType[25] = "eon";
			$arrayifType[26] = "ethernet3Mbit";
			$arrayifType[27] = "nsip";
			$arrayifType[28] = "slip";
			$arrayifType[29] = "ultra";
			$arrayifType[30] = "ds3";
			$arrayifType[31] = "sip";
			$arrayifType[32] = "frameRelay";
			$arrayifType[33] = "rs232";
			$arrayifType[34] = "para";
			$arrayifType[35] = "arcnet";
			$arrayifType[36] = "arcnetPlus";
			$arrayifType[37] = "atm";
			$arrayifType[38] = "miox25";
			$arrayifType[39] = "sonet";
			$arrayifType[40] = "x25ple";
			$arrayifType[41] = "iso88022llc";
			$arrayifType[42] = "localTalk";
			$arrayifType[43] = "smdsDxi";
			$arrayifType[44] = "frameRelayService";
			$arrayifType[45] = "v35";
			$arrayifType[46] = "hssi";
			$arrayifType[47] = "hippi";
			$arrayifType[48] = "modem";
			$arrayifType[49] = "aal5";
			$arrayifType[50] = "sonetPath";
			$arrayifType[51] = "sonetVT";
			$arrayifType[52] = "smdsIcip";
			$arrayifType[53] = "propVirtual";
			$arrayifType[54] = "propMultiplexor";
			$arrayifType[55] = "ieee80212";
			$arrayifType[56] = "fibreChannel";
			$arrayifType[57] = "hippiInterface";
			$arrayifType[58] = "frameRelayInterconnect";
			$arrayifType[59] = "aflane8023";
			$arrayifType[60] = "aflane8025";
			$arrayifType[61] = "cctEmul";
			$arrayifType[62] = "fastEther";
			$arrayifType[63] = "isdn";
			$arrayifType[64] = "v11";
			$arrayifType[65] = "v36";
			$arrayifType[66] = "g703at64k";
			$arrayifType[67] = "g703at2mb";
			$arrayifType[68] = "qllc";
			$arrayifType[69] = "fastEtherFX";
			$arrayifType[70] = "channel";
			$arrayifType[71] = "ieee80211";
			$arrayifType[72] = "ibm370parChan";
			$arrayifType[73] = "escon";
			$arrayifType[74] = "dlsw";
			$arrayifType[75] = "isdns";
			$arrayifType[76] = "isdnu";
			$arrayifType[77] = "lapd";
			$arrayifType[78] = "ipSwitch";
			$arrayifType[79] = "rsrb";
			$arrayifType[80] = "atmLogical";
			$arrayifType[81] = "ds0";
			$arrayifType[82] = "ds0Bundle";
			$arrayifType[83] = "bsc";
			$arrayifType[84] = "async";
			$arrayifType[85] = "cnr";
			$arrayifType[86] = "iso88025Dtr";
			$arrayifType[87] = "eplrs";
			$arrayifType[88] = "arap";
			$arrayifType[89] = "propCnls";
			$arrayifType[90] = "hostPad";
			$arrayifType[91] = "termPad";
			$arrayifType[92] = "frameRelayMPI";
			$arrayifType[93] = "x213";
			$arrayifType[94] = "adsl";
			$arrayifType[95] = "radsl";
			$arrayifType[96] = "sdsl";
			$arrayifType[97] = "vdsl";
			$arrayifType[98] = "iso88025CRFPInt";
			$arrayifType[99] = "myrinet";
			$arrayifType[100] = "voiceEM";
			$arrayifType[101] = "voiceFXO";
			$arrayifType[102] = "voiceFXS";
			$arrayifType[103] = "voiceEncap";
			$arrayifType[104] = "voiceOverIp";
			$arrayifType[105] = "atmDxi";
			$arrayifType[106] = "atmFuni";
			$arrayifType[107] = "atmIma";
			$arrayifType[108] = "pppMultilinkBundle";
			$arrayifType[109] = "ipOverCdlc";
			$arrayifType[110] = "ipOverClaw";
			$arrayifType[111] = "stackToStack";
			$arrayifType[112] = "virtualIpAddress";
			$arrayifType[113] = "mpc";
			$arrayifType[114] = "ipOverAtm";
			$arrayifType[115] = "iso88025Fiber";
			$arrayifType[116] = "tdlc";
			$arrayifType[117] = "gigabitEthernet";
			$arrayifType[118] = "hdlc";
			$arrayifType[119] = "lapf";
			$arrayifType[120] = "v37";
			$arrayifType[121] = "x25mlp";
			$arrayifType[122] = "x25huntGroup";
			$arrayifType[123] = "trasnpHdlc";
			$arrayifType[124] = "interleave";
			$arrayifType[125] = "fast";
			$arrayifType[126] = "ip";
			$arrayifType[127] = "docsCableMaclayer";
			$arrayifType[128] = "docsCableDownstream";
			$arrayifType[129] = "docsCableUpstream";
			$arrayifType[130] = "a12MppSwitch";
			$arrayifType[131] = "tunnel";
			$arrayifType[132] = "coffee";
			$arrayifType[133] = "ces";
			$arrayifType[134] = "atmSubInterface";
			$arrayifType[135] = "l2vlan";
			$arrayifType[136] = "l3ipvlan";
			$arrayifType[137] = "l3ipxvlan";
			$arrayifType[138] = "digitalPowerline";
			$arrayifType[139] = "mediaMailOverIp";
			$arrayifType[140] = "dtm";
			$arrayifType[141] = "dcn";
			$arrayifType[142] = "ipForward";
			$arrayifType[143] = "msdsl";
			$arrayifType[144] = "ieee1394";
			$arrayifType[145] = "if-gsn";
			$arrayifType[146] = "dvbRccMacLayer";
			$arrayifType[147] = "dvbRccDownstream";
			$arrayifType[148] = "dvbRccUpstream";
			$arrayifType[149] = "atmVirtual";
			$arrayifType[150] = "mplsTunnel";
			$arrayifType[151] = "srp";
			$arrayifType[152] = "voiceOverAtm";
			$arrayifType[153] = "voiceOverFrameRelay";
			$arrayifType[154] = "idsl";
			$arrayifType[155] = "compositeLink";
			$arrayifType[156] = "ss7SigLink";
			$arrayifType[157] = "propWirelessP2P";
			$arrayifType[158] = "frForward";
			$arrayifType[159] = "rfc1483";
			$arrayifType[160] = "usb";
			$arrayifType[161] = "ieee8023adLag";
			$arrayifType[162] = "bgppolicyaccounting";
			$arrayifType[163] = "frf16MfrBundle";
			$arrayifType[164] = "h323Gatekeeper";
			$arrayifType[165] = "h323Proxy";
			$arrayifType[166] = "mpls";
			$arrayifType[167] = "mfSigLink";
			$arrayifType[168] = "hdsl2";
			$arrayifType[169] = "shdsl";
			$arrayifType[170] = "ds1FDL";
			$arrayifType[171] = "pos";
			$arrayifType[172] = "dvbAsiIn";
			$arrayifType[173] = "dvbAsiOut";
			$arrayifType[174] = "plc";
			$arrayifType[175] = "nfas";
			$arrayifType[176] = "tr008";
			$arrayifType[177] = "gr303RDT";
			$arrayifType[178] = "gr303IDT";
			$arrayifType[179] = "isup";
			$arrayifType[180] = "propDocsWirelessMaclayer";
			$arrayifType[181] = "propDocsWirelessDownstream";
			$arrayifType[182] = "propDocsWirelessUpstream";
			$arrayifType[183] = "hiperlan2";
			$arrayifType[184] = "propBWAp2Mp";
			$arrayifType[185] = "sonetOverheadChannel";
			$arrayifType[186] = "digitalWrapperOverheadChannel";
			$arrayifType[187] = "aal2";
			$arrayifType[188] = "radioMAC";
			$arrayifType[189] = "atmRadio";
			$arrayifType[190] = "imt";
			$arrayifType[191] = "mvl";
			$arrayifType[192] = "reachDSL";
			$arrayifType[193] = "frDlciEndPt";
			$arrayifType[194] = "atmVciEndPt";
			$arrayifType[195] = "opticalChannel";
			$arrayifType[196] = "opticalTransport";
			$arrayifType[197] = "propAtm";
			$arrayifType[198] = "voiceOverCable";
			$arrayifType[199] = "infiniband";
			$arrayifType[200] = "teLink";
			$arrayifType[201] = "q2931";
			$arrayifType[202] = "virtualTg";
			$arrayifType[203] = "sipTg";
			$arrayifType[204] = "sipSig";
			$arrayifType[205] = "docsCableUpstreamChannel";
			$arrayifType[206] = "econet";
			$arrayifType[207] = "pon155";
			$arrayifType[208] = "pon622";
			$arrayifType[209] = "bridge";
			$arrayifType[210] = "linegroup";
			$arrayifType[211] = "voiceEMFGD";
			$arrayifType[212] = "voiceFGDEANA";
			$arrayifType[213] = "voiceDID";
			$arrayifType[214] = "mpegTransport";
			$arrayifType[215] = "sixToFour";
			$arrayifType[216] = "gtp";
			$arrayifType[217] = "pdnEtherLoop1";
			$arrayifType[218] = "pdnEtherLoop2";
			$arrayifType[219] = "opticalChannelGroup";
			$arrayifType[220] = "homepna";
			$arrayifType[221] = "gfp";
			$arrayifType[222] = "ciscoISLvlan";
			$arrayifType[223] = "actelisMetaLOOP";
			$arrayifType[224] = "fcipLink";
			$arrayifType[225] = "rpr";
			$arrayifType[226] = "qam";
			$arrayifType[227] = "lmp";
			$arrayifType[228] = "cblVectaStar";
			$arrayifType[229] = "docsCableMCmtsDownstream";
			$arrayifType[230] = "adsl2";
			$arrayifType[231] = "macSecControlledIF";
			$arrayifType[232] = "macSecUncontrolledIF";
			$arrayifType[233] = "aviciOpticalEther";
			$arrayifType[234] = "atmbond";
			$arrayifType[235] = "voiceFGDOS";
			$arrayifType[236] = "mocaVersion1";
			$arrayifType[237] = "ieee80216WMAN";
			$arrayifType[238] = "adsl2plus";
			$arrayifType[239] = "dvbRcsMacLayer";
			$arrayifType[240] = "dvbTdm";
			$arrayifType[241] = "dvbRcsTdma";
			$arrayifType[242] = "x86Laps";
		
		?>
		<table class="list" width="100%" cellspacing="2" cellpadding="2">
			<tr class="list_title">
				<td width="1%" valign="top"><?php echo TXT_INDEX; ?></td>
				<td width="49%" valign="top"><?php echo TXT_NAME; ?></td>
				<td width="30%" valign="top"><?php echo TXT_TYPE; ?></td>
				<td width="20%" valign="top"><?php echo TXT_SPEED; ?></td>
			</tr>
		<?php
			for ($i = 1;$i < ($density+1);$i++)
			{
				?>
				<tr>
					<td width="1%" valign="top" align="center"><?php echo (($nb_interface+($i-1))-$density); ?></td>
					<td width="49%" valign="top"><?php
					
					if ((($speed == "10") || ($speed == "100")) && ($type == "6"))
					{
					?>
						<input type="text" size="70" name="slot_<?php echo $nb_slot; ?>_name_interface_<?php echo $i; ?>" style="margin:0px;" value="FastEthernet<?php echo $slot."/".$i; ?>">	<?php
					}
					else if (($speed == "1000") && ($type == "6"))
					{
					?>
						<input type="text" size="70" name="slot_<?php echo $nb_slot; ?>_name_interface_<?php echo $i; ?>" style="margin:0px;" value="GigabitEthernet<?php echo $slot."/".$i; ?>">				 <?php					
					}
					else
					{
					?>
						<input type="text" size="70" name="slot_<?php echo $nb_slot; ?>_name_interface_<?php echo $i; ?>" style="margin:0px;" value="<?php echo $slot."/".$i; ?>">				 <?php					
					}
					?></td>
					<td width="30%" valign="top"><select name="slot_<?php echo $nb_slot; ?>_type_interface_<?php echo $i; ?>" id="type_interface_<?php echo $i; ?>"><?php
		
					foreach ($arrayifType as $key => $arrayvalue)
					{
						if ($key == $type)
						{
							echo "<option value=\"$key\" selected>$arrayvalue</option>";
						}
						else
						{
							echo "<option value=\"$key\">$arrayvalue</option>";
						}
					}
					
					?></select></td>
					<td width="20%" valign="top"><select name="slot_<?php echo $nb_slot; ?>_speed_interface_<?php echo $i; ?>" id="speed_interface_<?php echo $i; ?>">
					<?php
						switch ($speed)
						{
							case '10':
							?>
							<option value="10" selected>10 Mbps</option>
							<option value="100">10/100 Mbps</option>
							<option value="1000">10/100/1000 Mbps</option>
							<?php
							break;
							
							case '100':
							?>
							<option value="10">10 Mbps</option>
							<option value="100" selected>10/100 Mbps</option>
							<option value="1000">10/100/1000 Mbps</option>
							<?php							
							break;
							
							case '1000':
							?>
							<option value="10">10 Mbps</option>
							<option value="100">10/100 Mbps</option>
							<option value="1000" selected>10/100/1000 Mbps</option>
							<?php							
							break;
						}
					?>
					</td>
				</tr>
				<?php
			}
			?>
			</select><input type="hidden" name="slot_<?php echo $nb_slot; ?>_density_slot_<?php echo $slot; ?>" id="density_slot_<?php echo $slot; ?>" value="<?php echo $density; ?>">
			<?php
		break;
		
		
		case 'addslotsinterfaces2':
		
		$arrayifType[1] = "other";
			$arrayifType[2] = "regular1822";
			$arrayifType[3] = "hdh1822";
			$arrayifType[4] = "ddnX25";
			$arrayifType[5] = "rfc877x25";
			$arrayifType[6] = "ethernetCsmacd";
			$arrayifType[7] = "iso88023Csmacd";
			$arrayifType[8] = "iso88024TokenBus";
			$arrayifType[9] = "iso88025TokenRing";
			$arrayifType[10] = "iso88026Man";
			$arrayifType[11] = "starLan";
			$arrayifType[12] = "proteon10Mbit";
			$arrayifType[13] = "proteon80Mbit";
			$arrayifType[14] = "hyperchannel";
			$arrayifType[15] = "fddi";
			$arrayifType[16] = "lapb";
			$arrayifType[17] = "sdlc";
			$arrayifType[18] = "ds1";
			$arrayifType[19] = "e1";
			$arrayifType[20] = "basicISDN";
			$arrayifType[21] = "primaryISDN";
			$arrayifType[22] = "propPointToPointSerial";
			$arrayifType[23] = "ppp";
			$arrayifType[24] = "softwareLoopback";
			$arrayifType[25] = "eon";
			$arrayifType[26] = "ethernet3Mbit";
			$arrayifType[27] = "nsip";
			$arrayifType[28] = "slip";
			$arrayifType[29] = "ultra";
			$arrayifType[30] = "ds3";
			$arrayifType[31] = "sip";
			$arrayifType[32] = "frameRelay";
			$arrayifType[33] = "rs232";
			$arrayifType[34] = "para";
			$arrayifType[35] = "arcnet";
			$arrayifType[36] = "arcnetPlus";
			$arrayifType[37] = "atm";
			$arrayifType[38] = "miox25";
			$arrayifType[39] = "sonet";
			$arrayifType[40] = "x25ple";
			$arrayifType[41] = "iso88022llc";
			$arrayifType[42] = "localTalk";
			$arrayifType[43] = "smdsDxi";
			$arrayifType[44] = "frameRelayService";
			$arrayifType[45] = "v35";
			$arrayifType[46] = "hssi";
			$arrayifType[47] = "hippi";
			$arrayifType[48] = "modem";
			$arrayifType[49] = "aal5";
			$arrayifType[50] = "sonetPath";
			$arrayifType[51] = "sonetVT";
			$arrayifType[52] = "smdsIcip";
			$arrayifType[53] = "propVirtual";
			$arrayifType[54] = "propMultiplexor";
			$arrayifType[55] = "ieee80212";
			$arrayifType[56] = "fibreChannel";
			$arrayifType[57] = "hippiInterface";
			$arrayifType[58] = "frameRelayInterconnect";
			$arrayifType[59] = "aflane8023";
			$arrayifType[60] = "aflane8025";
			$arrayifType[61] = "cctEmul";
			$arrayifType[62] = "fastEther";
			$arrayifType[63] = "isdn";
			$arrayifType[64] = "v11";
			$arrayifType[65] = "v36";
			$arrayifType[66] = "g703at64k";
			$arrayifType[67] = "g703at2mb";
			$arrayifType[68] = "qllc";
			$arrayifType[69] = "fastEtherFX";
			$arrayifType[70] = "channel";
			$arrayifType[71] = "ieee80211";
			$arrayifType[72] = "ibm370parChan";
			$arrayifType[73] = "escon";
			$arrayifType[74] = "dlsw";
			$arrayifType[75] = "isdns";
			$arrayifType[76] = "isdnu";
			$arrayifType[77] = "lapd";
			$arrayifType[78] = "ipSwitch";
			$arrayifType[79] = "rsrb";
			$arrayifType[80] = "atmLogical";
			$arrayifType[81] = "ds0";
			$arrayifType[82] = "ds0Bundle";
			$arrayifType[83] = "bsc";
			$arrayifType[84] = "async";
			$arrayifType[85] = "cnr";
			$arrayifType[86] = "iso88025Dtr";
			$arrayifType[87] = "eplrs";
			$arrayifType[88] = "arap";
			$arrayifType[89] = "propCnls";
			$arrayifType[90] = "hostPad";
			$arrayifType[91] = "termPad";
			$arrayifType[92] = "frameRelayMPI";
			$arrayifType[93] = "x213";
			$arrayifType[94] = "adsl";
			$arrayifType[95] = "radsl";
			$arrayifType[96] = "sdsl";
			$arrayifType[97] = "vdsl";
			$arrayifType[98] = "iso88025CRFPInt";
			$arrayifType[99] = "myrinet";
			$arrayifType[100] = "voiceEM";
			$arrayifType[101] = "voiceFXO";
			$arrayifType[102] = "voiceFXS";
			$arrayifType[103] = "voiceEncap";
			$arrayifType[104] = "voiceOverIp";
			$arrayifType[105] = "atmDxi";
			$arrayifType[106] = "atmFuni";
			$arrayifType[107] = "atmIma";
			$arrayifType[108] = "pppMultilinkBundle";
			$arrayifType[109] = "ipOverCdlc";
			$arrayifType[110] = "ipOverClaw";
			$arrayifType[111] = "stackToStack";
			$arrayifType[112] = "virtualIpAddress";
			$arrayifType[113] = "mpc";
			$arrayifType[114] = "ipOverAtm";
			$arrayifType[115] = "iso88025Fiber";
			$arrayifType[116] = "tdlc";
			$arrayifType[117] = "gigabitEthernet";
			$arrayifType[118] = "hdlc";
			$arrayifType[119] = "lapf";
			$arrayifType[120] = "v37";
			$arrayifType[121] = "x25mlp";
			$arrayifType[122] = "x25huntGroup";
			$arrayifType[123] = "trasnpHdlc";
			$arrayifType[124] = "interleave";
			$arrayifType[125] = "fast";
			$arrayifType[126] = "ip";
			$arrayifType[127] = "docsCableMaclayer";
			$arrayifType[128] = "docsCableDownstream";
			$arrayifType[129] = "docsCableUpstream";
			$arrayifType[130] = "a12MppSwitch";
			$arrayifType[131] = "tunnel";
			$arrayifType[132] = "coffee";
			$arrayifType[133] = "ces";
			$arrayifType[134] = "atmSubInterface";
			$arrayifType[135] = "l2vlan";
			$arrayifType[136] = "l3ipvlan";
			$arrayifType[137] = "l3ipxvlan";
			$arrayifType[138] = "digitalPowerline";
			$arrayifType[139] = "mediaMailOverIp";
			$arrayifType[140] = "dtm";
			$arrayifType[141] = "dcn";
			$arrayifType[142] = "ipForward";
			$arrayifType[143] = "msdsl";
			$arrayifType[144] = "ieee1394";
			$arrayifType[145] = "if-gsn";
			$arrayifType[146] = "dvbRccMacLayer";
			$arrayifType[147] = "dvbRccDownstream";
			$arrayifType[148] = "dvbRccUpstream";
			$arrayifType[149] = "atmVirtual";
			$arrayifType[150] = "mplsTunnel";
			$arrayifType[151] = "srp";
			$arrayifType[152] = "voiceOverAtm";
			$arrayifType[153] = "voiceOverFrameRelay";
			$arrayifType[154] = "idsl";
			$arrayifType[155] = "compositeLink";
			$arrayifType[156] = "ss7SigLink";
			$arrayifType[157] = "propWirelessP2P";
			$arrayifType[158] = "frForward";
			$arrayifType[159] = "rfc1483";
			$arrayifType[160] = "usb";
			$arrayifType[161] = "ieee8023adLag";
			$arrayifType[162] = "bgppolicyaccounting";
			$arrayifType[163] = "frf16MfrBundle";
			$arrayifType[164] = "h323Gatekeeper";
			$arrayifType[165] = "h323Proxy";
			$arrayifType[166] = "mpls";
			$arrayifType[167] = "mfSigLink";
			$arrayifType[168] = "hdsl2";
			$arrayifType[169] = "shdsl";
			$arrayifType[170] = "ds1FDL";
			$arrayifType[171] = "pos";
			$arrayifType[172] = "dvbAsiIn";
			$arrayifType[173] = "dvbAsiOut";
			$arrayifType[174] = "plc";
			$arrayifType[175] = "nfas";
			$arrayifType[176] = "tr008";
			$arrayifType[177] = "gr303RDT";
			$arrayifType[178] = "gr303IDT";
			$arrayifType[179] = "isup";
			$arrayifType[180] = "propDocsWirelessMaclayer";
			$arrayifType[181] = "propDocsWirelessDownstream";
			$arrayifType[182] = "propDocsWirelessUpstream";
			$arrayifType[183] = "hiperlan2";
			$arrayifType[184] = "propBWAp2Mp";
			$arrayifType[185] = "sonetOverheadChannel";
			$arrayifType[186] = "digitalWrapperOverheadChannel";
			$arrayifType[187] = "aal2";
			$arrayifType[188] = "radioMAC";
			$arrayifType[189] = "atmRadio";
			$arrayifType[190] = "imt";
			$arrayifType[191] = "mvl";
			$arrayifType[192] = "reachDSL";
			$arrayifType[193] = "frDlciEndPt";
			$arrayifType[194] = "atmVciEndPt";
			$arrayifType[195] = "opticalChannel";
			$arrayifType[196] = "opticalTransport";
			$arrayifType[197] = "propAtm";
			$arrayifType[198] = "voiceOverCable";
			$arrayifType[199] = "infiniband";
			$arrayifType[200] = "teLink";
			$arrayifType[201] = "q2931";
			$arrayifType[202] = "virtualTg";
			$arrayifType[203] = "sipTg";
			$arrayifType[204] = "sipSig";
			$arrayifType[205] = "docsCableUpstreamChannel";
			$arrayifType[206] = "econet";
			$arrayifType[207] = "pon155";
			$arrayifType[208] = "pon622";
			$arrayifType[209] = "bridge";
			$arrayifType[210] = "linegroup";
			$arrayifType[211] = "voiceEMFGD";
			$arrayifType[212] = "voiceFGDEANA";
			$arrayifType[213] = "voiceDID";
			$arrayifType[214] = "mpegTransport";
			$arrayifType[215] = "sixToFour";
			$arrayifType[216] = "gtp";
			$arrayifType[217] = "pdnEtherLoop1";
			$arrayifType[218] = "pdnEtherLoop2";
			$arrayifType[219] = "opticalChannelGroup";
			$arrayifType[220] = "homepna";
			$arrayifType[221] = "gfp";
			$arrayifType[222] = "ciscoISLvlan";
			$arrayifType[223] = "actelisMetaLOOP";
			$arrayifType[224] = "fcipLink";
			$arrayifType[225] = "rpr";
			$arrayifType[226] = "qam";
			$arrayifType[227] = "lmp";
			$arrayifType[228] = "cblVectaStar";
			$arrayifType[229] = "docsCableMCmtsDownstream";
			$arrayifType[230] = "adsl2";
			$arrayifType[231] = "macSecControlledIF";
			$arrayifType[232] = "macSecUncontrolledIF";
			$arrayifType[233] = "aviciOpticalEther";
			$arrayifType[234] = "atmbond";
			$arrayifType[235] = "voiceFGDOS";
			$arrayifType[236] = "mocaVersion1";
			$arrayifType[237] = "ieee80216WMAN";
			$arrayifType[238] = "adsl2plus";
			$arrayifType[239] = "dvbRcsMacLayer";
			$arrayifType[240] = "dvbTdm";
			$arrayifType[241] = "dvbRcsTdma";
			$arrayifType[242] = "x86Laps";
		
		?>
		<table class="list" width="100%" cellspacing="2" cellpadding="2">
			<tr class="list_title">
				<td width="1%" valign="top"><?php echo TXT_INDEX; ?></td>
				<td width="49%" valign="top"><?php echo TXT_NAME; ?></td>
				<td width="30%" valign="top"><?php echo TXT_TYPE; ?></td>
				<td width="20%" valign="top"><?php echo TXT_SPEED; ?></td>
			</tr>
		<?php
			for ($i = 1;$i < ($density+1);$i++)
			{
				?>
				<tr>
					<td width="1%" valign="top" align="center"><?php echo ($i); ?></td>
					<td width="49%" valign="top"><?php
					
					if ((($speed == "10") || ($speed == "100")) && ($type == "6"))
					{
					?>
						<input type="text" size="70" name="name_interface_<?php echo $i; ?>" style="margin:0px;" value="FastEthernet<?php echo $nb_slot."/".$i; ?>">	<?php
					}
					else if (($speed == "1000") && ($type == "6"))
					{
					?>
						<input type="text" size="70" name="name_interface_<?php echo $i; ?>" style="margin:0px;" value="GigabitEthernet<?php echo $nb_slot."/".$i; ?>">				 <?php					
					}
					else
					{
					?>
						<input type="text" size="70" name="name_interface_<?php echo $i; ?>" style="margin:0px;" value="<?php echo $nb_slot."/".$i; ?>">				 <?php					
					}
					?></td>
					<td width="30%" valign="top"><select name="type_interface_<?php echo $i; ?>" id="type_interface_<?php echo $i; ?>"><?php
		
					foreach ($arrayifType as $key => $arrayvalue)
					{
						if ($key == $type)
						{
							echo "<option value=\"$key\" selected>$arrayvalue</option>";
						}
						else
						{
							echo "<option value=\"$key\">$arrayvalue</option>";
						}
					}
					
					?></select></td>
					<td width="20%" valign="top"><select name="speed_interface_<?php echo $i; ?>" id="speed_interface_<?php echo $i; ?>">
					<?php
						switch ($speed)
						{
							case '10':
							?>
							<option value="10" selected>10 Mbps</option>
							<option value="100">10/100 Mbps</option>
							<option value="1000">10/100/1000 Mbps</option>
							<?php
							break;
							
							case '100':
							?>
							<option value="10">10 Mbps</option>
							<option value="100" selected>10/100 Mbps</option>
							<option value="1000">10/100/1000 Mbps</option>
							<?php							
							break;
							
							case '1000':
							?>
							<option value="10">10 Mbps</option>
							<option value="100">10/100 Mbps</option>
							<option value="1000" selected>10/100/1000 Mbps</option>
							<?php							
							break;
						}
					?>
					</td>
				</tr>
				<?php
			}
			?>
			</select><input type="hidden" name="density_slot_<?php echo $slot; ?>" id="density_slot_<?php echo $slot; ?>" value="<?php echo $density; ?>">
			<?php
		break;		
		
		case 'link':
		if ($value!="null")
		{
			if ($value=="1")
			{
				echo "<label>".TXT_RACK."</label>
				<select name='rack' onchange=\"urlredirectdiv('ajax_view.php?what=add_patch_panel&rack_id='+this.value+'&link=$link','patch_panel');\"><option value=\"null\">".TXT_SELECT_RACK."</option>";
				$request=mysql_query("SELECT name,id FROM $name_table_rack ORDER BY name ASC") or die ("ERROR!");

				while($tmp_request=mysql_fetch_array($request))
				{
					echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>\n";
				}
				echo "</select><div id=\"patch_panel\"></div>";
			}
			else if ($value=="2")
			{
				echo "<label>".TXT_DEVICE."</label>
				<select name='device' onchange=\"urlredirectdiv('ajax_view.php?what=add_slot&device_id='+this.value+'&link=$link','slot');\"><option value=\"null\">".TXT_SELECT_DEVICE."</option>";
				$request=mysql_query("SELECT name,id FROM $name_table_device ORDER BY name ASC") or die ("ERROR!");

				while($tmp_request=mysql_fetch_array($request))
				{
					echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>\n";
				}
				echo "</select><div id=\"slot\"></div>";				
			}
		}
		break;
		
		case 'add_patch_panel':
		echo "<label>".TXT_PATCH_PANEL."</label>
		<select name='patch_panel' onchange=\"urlredirectdiv('ajax_view.php?what=add_port&patch_panel_id='+this.value+'&link=$link','port');\"><option value=\"null\">".TXT_SELECT_PATCH_PANEL."</option>";
		$request=mysql_query("SELECT name,id FROM $name_table_patch_panel WHERE rack_id=$rack_id ORDER BY id,name ASC") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>\n";
		}
		echo "</select><div id=\"port\"></div>";
		break;
		
		case 'add_port':
		echo "<label>".TXT_PORT."</label>
		<select name='port_$link'><option value=\"null\">".TXT_SELECT_PORT."</option>";
		$request=mysql_query("SELECT name,id FROM $name_table_port WHERE patch_panel_id=$patch_panel_id ORDER BY id,name ASC") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>\n";
		}
		echo "</select>";
		break;		
		
		case 'add_slot':
		echo "<label>".TXT_SLOT."</label>
		<select name='slot' onchange=\"urlredirectdiv('ajax_view.php?what=add_interface&slot_id='+this.value+'&link=$link','interface');\"><option value=\"null\">".TXT_SELECT_SLOT."</option>";
		$request=mysql_query("SELECT number,id FROM $name_table_slot WHERE device_id=$device_id ORDER BY id,number ASC") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[number]</option>\n";
		}
		echo "</select><div id=\"interface\"></div>";
		break;		
		
		case 'add_interface':
		echo "<label>".TXT_INTERFACE."</label>
		<select name='interface_$link'><option value=\"null\">".TXT_SELECT_INTERFACE."</option>";
		$request=mysql_query("SELECT name,id FROM $name_table_interface WHERE slot_id=$slot_id ORDER BY id,name ASC") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>\n";
		}
		echo "</select>";
		break;

		case 'linkbetweendevices':
		?>
		<table class="sortable list" id="sortable" width="100%" cellspacing="2" cellpadding="3">
			<tr class="list_title">
				<td><?php echo TXT_IP_ADDRESS; ?></td>
				<td><?php echo TXT_NAME; ?></td>
				<td><?php echo TXT_DESCRIPTION; ?></td>
				<td class="unsortable" width="20%"><?php echo TXT_ACTION; ?></td>
			</tr>
		<?php
		$list1 = "list1"; 
		$list2 = "list2"; 
		$line_count = 0; 
	

		$request=mysql_query("SELECT * FROM $name_table_device WHERE id=\"$id\"") or die ("ERROR!");

		while($tmp_request=mysql_fetch_array($request))
		{
			$device_name = $tmp_request['name'];
			$snmpport = $tmp_request['snmp_port'];
			$snmpreadcommunity = $tmp_request['snmp_read_community'];
			$media_table = 	snmpwalk("$ipaddress:$snmpport","$snmpreadcommunity",".1.3.6.1.2.1.4.22.1.3","200000","3") or die("ERROR!");

			if ($media_table)
			{						
				foreach ($media_table as $arrayvalue)
				{
					$line_color = ($line_count % 2) ? $list1 : $list2;

					$net_address = str_replace ("IpAddress: ",'',$arrayvalue);
					if ($ipaddress != $net_address)
					{
						$request2=mysql_query("SELECT * FROM $name_table_ip_address WHERE ip=\"$net_address\"") or die ("ERROR!");
						$num_address = mysql_num_rows($request2);
						if ($num_address > 0)
						{
							while($tmp_request2=mysql_fetch_array($request2))
							{
								?>
									<tr class="<?php echo "$line_color"; ?>">
										<td valign="top"><?php 
										echo "<a href=\"index.php?include=mainview&page=ip_address&action=view&id=$tmp_request2[id]\">".$tmp_request2['ip']."</a>";
										?></td>
										<td valign="top"><?php 
										
										$request3=mysql_query("SELECT * FROM $name_table_device WHERE ip_address_id=\"$tmp_request2[id]\"") or die ("ERROR!");
										while($tmp_request3=mysql_fetch_array($request3))
										{
											$device_id = $tmp_request3['id'];
											$device_name = $tmp_request3['name'];
											$device_description = $tmp_request3['description'];
											
											echo "<a href=\"index.php?include=mainview&page=device&action=view&id=$device_id\">".$device_name."</a>";
										}
										?></td>
										<td valign="top"><?php echo "$device_description"; ?></td>
										<td valign="top" width="20%"><?php echo "[ <a href=\"index.php?include=mainview&page=device&action=view&id=$device_id\">".TXT_VIEW."</a> ] [ <a href=\"index.php?include=mainview&page=device&action=edit&id=$device_id\">".TXT_EDIT."</a> ] [ <a href=\"index.php?include=mainview&page=path&action=view&device1_id=$id&device2_id=$device_id\">View path</a> ]"; ?></td>
									</tr>
								<?php				
							}					
						}
						else
						{
							?>
								<tr class="<?php echo "$line_color"; ?>">
									<td valign="top"><?php echo "$net_address<br>"; ?></td>
									<td valign="top">Unknow</td>
									<td valign="top">Unknow</td>
									<td valign="top" width="12%">[ Add to ODCNMS]</td>
								</tr>
							<?php						
						}
						$line_count++;
					}
				}
			}
			else
			{
				echo "ERROR!";
			}
		}
		?>
		</table>
		<?php
			break;
			
		case 'subnetted':
			if ($value=="0")
			{
				?>
				<label><?php echo TXT_CUSTOMER; ?></label>
		<table border="0">
		<tr>
			<td>
			<select name="list1" multiple="multiple" size="10" onDblClick="opt.transferRight()">
			</select>
			</td>
			<td align="center" valign="middle">
				<input name="left" value="<?php echo TXT_ADD; ?> &lt;&lt;" ONCLICK="opt.transferLeft()" type="button"><br><br>
				<input name="left" value="<?php echo TXT_ADD; ?> <?php echo TXT_ALL; ?> &lt;&lt;" ONCLICK="opt.transferAllLeft()" type="button"><br><br>
				<input name="right" value="<?php echo TXT_REMOVE; ?> &gt;&gt;" ONCLICK="opt.transferRight()" type="button"><br><br>
				<input name="right" value="<?php echo TXT_REMOVE; ?> <?php echo TXT_ALL; ?> &gt;&gt;" ONCLICK="opt.transferAllRight()" type="button">
			</td>
			<td>
			<select name="list2" multiple="multiple" size="10" onDblClick="opt.transferLeft()">
			<?php
			$request=mysql_query("select name,id FROM $name_table_customer") or die ("ERROR!");

			while($tmp_request=mysql_fetch_array($request))
			{
				echo "<option value=\"$tmp_request[id]\">$tmp_request[name]</option>";
			}
			?>
			</select>
			</td>
		</tr>
		</table>
		<label><?php echo TXT_VLAN; ?></label>
		<div id="add_vlan" style="float:left;display:none;margin-right:5px;"> <input type="text" name="new_vlan_name" id="new_vlan_name" size="15" style="background-image:url(images/background_name.png);background-repeat:no-repeat;"> <input type="text" name="new_vlan_number" id="new_vlan_number" size="15" style="background-image:url(images/background_number.png);background-repeat:no-repeat;"> <input type="text" name="new_vlan_description" id="new_vlan_description" size="20"  style="background-image:url(images/background_description.png);background-repeat:no-repeat;"></div>
		<select name="vlan" id="vlan" size="1" style="float:left; margin-right:5px;">
			<?php
			$request=mysql_query("select id,name,number FROM $name_table_vlan") or die ("ERROR!");

			while($tmp_request=mysql_fetch_array($request))
			{
				echo "<option value=\"$tmp_request[id]\">$tmp_request[name] ($tmp_request[number])</option>";
			}
			?>
		</select>
		<input type="button" value="Add a new vlan" onclick="changedisabled('vlan');displayelement('add_vlan');displayelement('vlan'); if(document.getElementById('add_vlan').style.display=='none') this.value='Add a new vlan'; else {this.value='Select a vlan'; document.getElementById('new_vlan_name').value='';document.getElementById('new_vlan_number').value='';document.getElementById('new_vlan_description').value=''}">
				<?php
			}
		break;
    
    case 'ajaxheight':
      
      if ($height_id=="other")
      {
        ?>
          <input type="text" name="other_height" value="" size="3" maxlength="3" onKeyPress="return numbersonly(this, event)"> <span style="top: -10px;position:relative;">U</span>
        <?php
      }
      
    break;
    
    case 'ajaxportdensity':
      
      if ($port_id=="other")
      {
        ?>
          <input type="text" name="other_port_density" value="" size="3" maxlength="3" onKeyPress="return numbersonly(this, event)"> <span style="top: -10px;position:relative;"><?php echo TXT_PORTS; ?></span>
        <?php
      }
      
    break;    
    
    case 'ajaxinterfacedensity':
      
      if ($interface_id=="other")
      {
        ?>
          <input type="text" name="other_interface_density_<?php echo $id; ?>" value="" size="3" maxlength="3" onKeyPress="return numbersonly(this, event)"> <span style="top: -10px;position:relative;"><?php echo TXT_PORTS; ?></span>
        <?php
      }
      
    break;     
    
    case 'ajaxinterfacespeed':
      
      if ($interface_id=="other")
      {
        ?>
          <input type="text" name="other_interface_speed_<?php echo $id; ?>" value="" size="5" onKeyPress="return numbersonly(this, event)"> <span style="top: -10px;position:relative;"><?php echo TXT_MBPS; ?></span>
        <?php
      }
      
    break;   
    
    case 'ajaxinterfacespeed2':
      
      if ($interface_id=="other")
      {
        ?>
          <input type="text" name="other_interface_speed" value="" size="5" onKeyPress="return numbersonly(this, event)"> <span style="top: -10px;position:relative;"><?php echo TXT_MBPS; ?></span>
        <?php
      }
      
    break;       
    
	}
}
?>
Return current item: OpenDataCenter Network Management System