<?php
	require_once ("php_telnet.php");
	require_once("msql_tt.php");
	require_once ("switch.php");
	$id=$_GET['id'];
	$result = get_eqip_brand ($id);
	if ( $result <> '0') {
		$equip = mysqli_fetch_assoc ($result);
		$brand = $equip['brand'];
		$model = $equip['model'];
		if ( $brand == 'D-Link') {
			$output = shell_exec('./dlink.sh '.$_GET['ip']);
			cr_table_ports ($output);
			// echo get_mac_ports (3, '10.0.200.11');
		} elseif ( $brand == 'Eltex ' ) {
				if (strpos($model, 'LTP') !== false) {
					echo 'PON!!';
				} 
				if ($model !== "LTP-4x"){ 
					echo 'NEPON';
				}
		} else {
				echo "Оборудование пока не поддерживается";
		}
	} else {
		echo "Нет данных!";
	}
	echo '<br><a href=/monitor/>Вернуться назад</a>';
?>