<?php
require("../../inc/header.inc");
require("logdb.inc");
require("function.php");
$DEBUG = 0;

if($DEBUG) echo "<br>正在调试中，给您的工作带来不便，请原谅！！：^_^";
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Configuration > <a href=\"JavaScript:backpage(1,'../overview/overview.php')\">Network</a>";
echo "> <a href=\"JavaScript:backpage(1,'./bssSpecific.php?bssid=$bssid')\">BSS Specific</a>";
echo ">DSP Card ";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<br>";

echo "<table width=\"100%\"border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
	echo "<tr>";
		echo "<td width=\"75%\"></td>";
		echo "<td width=\"15%\"></td>";
		echo "<td width=\"10%\"><a href=\"JavaScript:backpage(1,'./bssSpecific.php?bssid=$bssid')\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a><td>";//back
	echo "</tr>";
echo "</table>";
?>

<TABLE  border="1"  cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" width="100%">
<?php
$no_of_dsp=$dspnum;
//DSP (0~3)
echo "<tr>";
echo "<td width=\"20%\" bgcolor=\"#E6E6E6\"><b>DSP</b></td>";
echo "<td>";
			echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\">";
			echo "<tr bgcolor=\"#E6E6E6\">";
				echo "<td width=\"20%\">DSP_Num</td>";
				
				echo "<td width=\"20%\">AdminState</td>";
				echo "<td width=\"20%\">OperaState</td>";
				echo "<td width=\"20%\">AvailStatus</td>";
				echo "<td width=\"20%\">DSP Type</td>";
			echo "</tr>";//Half Rate=0;Full Rate=1;Enhanced Full Rate  =2
			$sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.0' and bssid=$bssid";
			    //echo $sqlstring . "<BR>";
				$result = mysqli_query($pubConn,$sqlstring) or
				die("Invalid query: $sqlstring\n" . mysqli_error($pubConn));
				
				while($row = mysqli_fetch_row($result))
				{
					list($type,$adminstate,$operstate,$availstatus) =$row;
				}
				if($type==0)$type="Half Rate";
				else if($type==1)$type="Full Rate";
				else if($type==2)$type="Enhanced Full Rate";
				if($adminstate==1)$adminstate="Locked";
				else if($adminstate==2)$adminstate="Unlocked";
				if($operstate==1)$operstate="Disable";
				else if($operstate==2)$operstate="Enable";
				if($availstatus==0)$availstatus="In_Test";
				else if($availstatus==1)$availstatus="Failed";
				else if($availstatus==2)$availstatus="Power_Off";
				else if($availstatus==3)$availstatus="Offline";
				else if($availstatus==4)$availstatus="Online";
				else if($availstatus==5)$availstatus="Dependency";
				else if($availstatus==6)$availstatus="Degraded";
				else if($availstatus==7)$availstatus="Not_Installed";

			echo "<tr>";//DSP 0
				echo "<td width=\"20%\"><a href=\"./objShow.php?language=$language&objectid=DSP.0.$cardnum.$dspnum.0&tablename=OMCR_TrauDsp&bssid=$bssid\";>0</a></td>";
				echo "<td width=\"20%\">$adminstate</td>";
				echo "<td width=\"20%\">$operstate</td>";
				echo "<td width=\"20%\">$availstatus</td>";
				echo "<td width=\"20%\">$type</td>";
				
			echo "</tr>";
			$sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.1' and bssid=$bssid";
			    //echo $sqlstring . "<BR>";
				$result = mysqli_query($pubConn,$sqlstring) or
				die("Invalid query: $sqlstring\n" . mysqli_error($pubConn));
				
				while($row = mysqli_fetch_row($result))
				{
					list($type,$adminstate,$operstate,$availstatus) =$row;
				}
				if($type==0)$type="Half Rate";
				else if($type==1)$type="Full Rate";
				else if($type==2)$type="Enhanced Full Rate";
				if($adminstate==1)$adminstate="Locked";
				else if($adminstate==2)$adminstate="Unlocked";
				if($operstate==1)$operstate="Disable";
				else if($operstate==2)$operstate="Enable";
				if($availstatus==0)$availstatus="In_Test";
				else if($availstatus==1)$availstatus="Failed";
				else if($availstatus==2)$availstatus="Power_Off";
				else if($availstatus==3)$availstatus="Offline";
				else if($availstatus==4)$availstatus="Online";
				else if($availstatus==5)$availstatus="Dependency";
				else if($availstatus==6)$availstatus="Degraded";
				else if($availstatus==7)$availstatus="Not_Installed";

			echo "<tr>";//DSP 1
				echo "<td width=\"20%\"><a href=\"./objShow.php?language=$language&objectid=DSP.0.$cardnum.$dspnum.1&tablename=OMCR_TrauDsp&bssid=$bssid\";>1</a></td>";
				echo "<td width=\"20%\">$adminstate</td>";
				echo "<td width=\"20%\">$operstate</td>";
				echo "<td width=\"20%\">$availstatus</td>";
				echo "<td width=\"20%\">$type</td>";
				
			echo "</tr>";
			$sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.2' and bssid=$bssid";
			    //echo $sqlstring . "<BR>";
				$result = mysqli_query($pubConn,$sqlstring) or
				die("Invalid query: $sqlstring\n" . mysqli_error($pubConn));
				
				while($row = mysqli_fetch_row($result))
				{
					list($type,$adminstate,$operstate,$availstatus) =$row;
				}
				if($type==0)$type="Half Rate";
				else if($type==1)$type="Full Rate";
				else if($type==2)$type="Enhanced Full Rate";
				if($adminstate==1)$adminstate="Locked";
				else if($adminstate==2)$adminstate="Unlocked";
				if($operstate==1)$operstate="Disable";
				else if($operstate==2)$operstate="Enable";
				if($availstatus==0)$availstatus="In_Test";
				else if($availstatus==1)$availstatus="Failed";
				else if($availstatus==2)$availstatus="Power_Off";
				else if($availstatus==3)$availstatus="Offline";
				else if($availstatus==4)$availstatus="Online";
				else if($availstatus==5)$availstatus="Dependency";
				else if($availstatus==6)$availstatus="Degraded";
				else if($availstatus==7)$availstatus="Not_Installed";

			echo "<tr>";//DSP 2
				echo "<td width=\"20%\"><a href=\"./objShow.php?language=$language&objectid=DSP.0.$cardnum.$dspnum.2&tablename=OMCR_TrauDsp&bssid=$bssid\";>2</a></td>";
				echo "<td width=\"20%\">$adminstate</td>";
				echo "<td width=\"20%\">$operstate</td>";
				echo "<td width=\"20%\">$availstatus</td>";
				echo "<td width=\"20%\">$type</td>";
				
			echo "</tr>";
			$sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.3' and bssid=$bssid";
			    //echo $sqlstring . "<BR>";
				$result = mysqli_query($pubConn,$sqlstring) or
				die("Invalid query: $sqlstring\n" . mysqli_error($pubConn));
				
				while($row = mysqli_fetch_row($result))
				{
					list($type,$adminstate,$operstate,$availstatus) =$row;
				}
				if($type==0)$type="Half Rate";
				else if($type==1)$type="Full Rate";
				else if($type==2)$type="Enhanced Full Rate";
				if($adminstate==1)$adminstate="Locked";
				else if($adminstate==2)$adminstate="Unlocked";
				if($operstate==1)$operstate="Disable";
				else if($operstate==2)$operstate="Enable";
				if($availstatus==0)$availstatus="In_Test";
				else if($availstatus==1)$availstatus="Failed";
				else if($availstatus==2)$availstatus="Power_Off";
				else if($availstatus==3)$availstatus="Offline";
				else if($availstatus==4)$availstatus="Online";
				else if($availstatus==5)$availstatus="Dependency";
				else if($availstatus==6)$availstatus="Degraded";
				else if($availstatus==7)$availstatus="Not_Installed";

			echo "<tr>";//DSP 3
				echo "<td width=\"20%\"><a href=\"./objShow.php?language=$language&objectid=DSP.0.$cardnum.$dspnum.3&tablename=OMCR_TrauDsp&bssid=$bssid\";>3</a></td>";
				echo "<td width=\"20%\">$adminstate</td>";
				echo "<td width=\"20%\">$operstate</td>";
				echo "<td width=\"20%\">$availstatus</td>";
				echo "<td width=\"20%\">$type</td>";
				echo "</table>";
			echo "</tr>";
echo "</td>";
echo "</tr>";
echo "</table>";
