init web ems all

This commit is contained in:
agtuser committed 2024-09-27 17:13:36 +08:00
1 parent 81c97acbe9
commit 5cc56f8078
4263 files changed
+798779

No files matched your search

+701
View File
@@ -0,0 +1,701 @@
<?php
require("../../inc/header.inc");
?>
<script LANGUAGE="JavaScript">
function goPage(numberOfRec){
var pageUrl,bgnNo,numberPerPage;
pageNo=document.selectform.pageNo.value;
numberPerPage='<?php echo "$numberPerPage";?>';
numberPerPage=100;
bgnNo=numberPerPage*(pageNo-1);
var selSysTypeNo=document.selectform.selSysTypeNo.value;
var selAlarmLevel=document.selectform.selAlarmLevel.value;
baseUrl='<?php echo "$PHP_SELF?$basePageLink";?>';
pageUrl="&bgnNo="+bgnNo+"&numberOfRecords="+numberOfRec+"&selSysTypeNo="+selSysTypeNo+"&selAlarmLevel="+selAlarmLevel;
window.location.href=baseUrl+pageUrl;
}
</script>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('down');" onresize="javascript:adjust_frame('down');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
//&bgnNo=$bgnNo&numberOfRecords=numberOfRecords$basePageLink=$_REQUEST['basePageLink'];
$bgnNo=$_REQUEST['bgnNo'];
$numberOfRecords=$_REQUEST['numberOfRecords'];
$selSysTypeNo=$_REQUEST['selSysTypeNo'];
$selAlarmLevel=$_REQUEST['selAlarmLevel'];
$nextPageLink=$_REQUEST['nextPageLink'];
$prePageLink=$_REQUEST['prePageLink'];
$actMode=$_REQUEST['actMode'];
echo "<meta http-equiv=\"refresh\" content=\"10; url=$PHP_SELF?selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&noop=$noop&nolog=1\">";
adjust_head_frame("down");
adjust_title_head_frame("down");
adjust_title_tail_frame("down");
adjust_content_head_frame("down");
echo "<br>";
//*****
//$url_temp=$_SERVER["REQUEST_URI"];
//echo "This page URL:$url_temp<br>";
/*********************************************************
程序说明:
功能说明:告警查询的下部页面,查询显示
调用关系:
变量说明:
作者:
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
$DEBUG = 0;
//if(!isset($selSysTypeNo)) $selSysTypeNo='all';
//==========================================================
//变量定义
//==========================================================
$dbName = 'OMC_PUB';
$defTable = 'sysAlarmConf';
$logTable = 'sysAlarmLog';
$numberPerPage = 100; //每页纪录数
$orderByStr = "alarmTime DESC,sysTypeNo,sysNo,subSysNo";//排序顺序
//确定告警内容显示语言种类
if($language=='chn'){
$alarmDesc = alarmDesc_1; //chinese
}else{
$alarmDesc = alarmDesc_2;
}
//初始化设备名和设备编号数组,
//由于三张表一起查时,速度太慢,占用系统资源太大。
//所以系统类型编号对应的系统类型名称不从数据库中直接取。
//将数据到如数组,显示时,从数组中来取。
$device_sql ="SELECT sysTypeNo,sysTypeName
FROM $sysconf_table
WHERE needHeartBeat >'0'
ORDER BY sysTypeNo
";
$device_result = @mysqli_query($pubConn,$device_sql);
$device_rows = @mysqli_fetch_array($device_result);
echo mysqli_error($pubConn);
if($DEBUG)echo "<br>device_sql:$device_sql";
$i=0;
do{
$sysTypeDef[$i][sysTypeNo] = $device_rows[sysTypeNo];
$sysTypeDef[$i][sysTypeName]= $device_rows[sysTypeName];
$i++;
}while($device_rows = mysqli_fetch_array($device_result));
//需要被查询的字段名
$selectFieldList="$logTable.sysTypeNo,sysNo,subSysNo,$logTable.compCode,$logTable.alarmCode,alarmLevel,$alarmDesc ,alarmTime,clearTime,clearMode,clearInfo";
//显示列表时的表头标题
$noop=0;
if($noop!=1)
{
if ($selectedLanguage == 'eng')
$showFieldArr=array('System','Alarm level','Events','Alarm time','Clear time','Clear');
elseif ($selectedLanguage == 'chn')
$showFieldArr=array('系统号','告警等级','描述','告警时间','清除时间','清除');
}
else
{
if ($selectedLanguage == 'eng')
$showFieldArr=array('System','Alarm level','Events','Alarm time','Clear time');
elseif ($selectedLanguage == 'chn')
$showFieldArr=array('系统号','告警等级','描述','告警时间','清除时间');
}
//==========================================================
//输入变量
//==========================================================
//==========================================================
//数据处理
//==========================================================
//告警手动清除
if($actMode == 'clear')
{
$compCode=$_REQUEST['compCode'];
$alarmCode=$_REQUEST['alarmCode'];
$alarmTime=$_REQUEST['alarmTime'];
$alarmLevel=$_REQUEST['alarmLevel'];
$sysTypeNo=$_REQUEST['sysTypeNo'];
$sysNo=$_REQUEST['sysNo'];
$subSysNo=$_REQUEST['subSysNo'];
//告警清除时需要的变量
if($DEBUG) echo "<br>actMode = $actMode";
if($DEBUG) echo "<br>sysTypeNo = $sysTypeNo";
if($DEBUG) echo "<br>sysNo = $sysNo";
if($DEBUG) echo "<br>subSysNo = $subSysNo";
if($DEBUG) echo "<br>compCode = $compCode";
if($DEBUG) echo "<br>alarmCode = $alarmCode";
if($DEBUG) echo "<br>alarmTime = $alarmTime";
if($DEBUG) echo "<br>clearMode = $clearMode";
//上部页面传入的变量
if($DEBUG) echo "<br>selAlarmLevel = $selAlarmLevel";
if($DEBUG) echo "<br>selSysTypeNo = $selSysTypeNo";
//翻页或选择页面时传入的变量,需要包含上部页面传入的变量
if($DEBUG) echo "<br>bgnNo = $bgnNo";
if($DEBUG) echo "<br>numberOfRecords= $numberOfRecords";
$bssDbConn=mysqli_connect($$OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "BssOmcDb");
if($sysTypeNo == 500)
{
// Clear this alarm in OMCR_ALARMEVENT and OMCR_BSSTREE
$sqlstring = "UPDATE OMCR_ALARMEVENT SET Severity=0, ClearTime=NOW()" .
" WHERE bssid=$sysNo" .
" AND ObjectId='$rmObjectid'" .
" AND EventTime='$alarmTime'";
//echo $sqlstring . "<BR><br>";
$result=mysqli_query($bssDbConn,$sqlstring);
$sqlstring = "SELECT min(Severity) FROM OMCR_ALARMEVENT" .
" WHERE bssid=$sysNo" .
" AND ObjectId='$Objectid'" .
" AND Severity>0 AND Severity<=3";
//echo $sqlstring . "<BR>";
$result=mysqli_query($bssDbConn,$sqlstring);
$row = mysqli_fetch_row($result);
if ( $row[0] == null ) // All alarm cleared
$row[0] = 0;
$sqlstring = "UPDATE OMCR_BSSTREE SET MaxSeverity=" . $row[0] .
" WHERE bssid=$sysNo" .
" AND ObjectId='$rmObjectid'";
//echo $sqlstring . "<BR>";
$result=mysqli_query($pubConn,$sqlstring);
}
else
{
$clearAlarmSql=" UPDATE $logTable
SET clearTime=CURRENT_TIMESTAMP,clearMode='1',clearBy='$userInfo[ID]'
WHERE sysTypeNo = '$sysTypeNo'
AND sysNo = '$sysNo'
AND subSysNo = '$subSysNo'
AND compCode = '$compCode'
AND alarmCode = '$alarmCode'
AND alarmTime = '$alarmTime'
";
if($DEBUG)
echo "<br>clearAlarmSql=$clearAlarmSql";
$result=mysqli_query($pubConn ,$clearAlarmSql);
echo mysqli_error($pubConn);
}
/*
echo "\n<script language=\"JavaScript\">\n";
echo "parent.header.document.getElementById(\"searchID\").click();\n";
echo "</script>\n";
*/
}
if($selSysTypeNo==500)
{
//echo "selSysTypeNo:$selSysTypeNo<br>";
$dbName = 'BssOmcDb';
$defTable = 'BssOmcDb.OMCR_ALARMCODE';
$logTable = 'BssOmcDb.OMCR_ALARMEVENT';
$orderByStr = "EventTime DESC,bssid";//排序顺序
$numberPerPage = 100; //每页纪录数
$whereStr = "";
if($selAlarmLevel == 'all'){
$whereStr .="(1)";
}elseif( $selAlarmLevel == 'unclear'){
if(strlen($whereStr) > 0){
$whereStr .=" AND (ClearTime is null or ClearTime='0')";
}else{
$whereStr .=" (ClearTime is null or ClearTime='0')";
}
}elseif( $selAlarmLevel == 'cleared'){
if(strlen($whereStr) > 0){
$whereStr .=" AND ClearTime > '0' ";
}else{
$whereStr .=" ClearTime > '0' ";
}
}else{
if(strlen($whereStr) > 0){
$whereStr .=" AND AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0')";
}else{
$whereStr .=" AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0')";
}
}
//echo "selAlarmLevel:$selAlarmLevel<br>";
//echo "logTable:$logTable<br>";
if($DEBUG) echo "<br>whereStr=$whereStr";
//首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。
if(!$numberOfRecords){
$bgnNo=0;
$countSql="SELECT count(*) as totalNum FROM $logTable WHERE $whereStr";
if($DEBUG) echo "<br>countSql=$countSql";
$result=mysqli_query($bssDbConn,$countSql);
echo mysqli_error($bssDbConn);
$record = @mysqli_fetch_array($result);
$numberOfRecords = $record[0];
if($DEBUG) echo "<br>numberOfRecords=$numberOfRecords";
//插入日志
insertLog("Veiw Alarm Log");
}
$thisPageOtherNum = $numberOfRecords;
//找到需要显示的纪录
//$selectFieldList="bssid,AlarmLevel,EventInfo ,alarmTime,clearTime,clearMode,clearInfo";
$selectFieldList="500 as sysTypeNo,bssid as sysNo,0 as subSysNo,Severity as alarmLevel,EventInfo as $alarmDesc ,EventTime as alarmTime,ClearTime as clearTime,0 as clearMode,ObjectId";
if($numberOfRecords > 0){
$showSql=" SELECT $selectFieldList FROM $logTable WHERE $whereStr
ORDER BY $orderByStr LIMIT $bgnNo, $numberPerPage ";
if($DEBUG) echo "<br>showSql=$showSql";
$result=@mysqli_query($bssDbConn,$showSql);
echo mysqli_error($bssDbConn);
$rows=@mysqli_fetch_array($result);
//下面是控制分页显示需要传递的变量传递变量
if ($numberOfRecords >= 1) {
$nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目
if ($nextBgnNo > $numberOfRecords){
$nextBgnNo = $numberOfRecords;
}
$t1 = $bgnNo + 1;
$prevBgnNo = $bgnNo - $numberPerPage;
if ($prevBgnNo < 0) {
$prevBgnNo = 0;
}
$basePageLink ="selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&numberOfRecords=$numberOfRecords";
$prePageLink ="bgnNo=$prevBgnNo";
$nextPageLink ="bgnNo=$nextBgnNo";
}
$showBgnNo=$bgnNo+1;
}
}
else
{
//根据上部页面传来的变量,生成查询条件
if( strlen($selSysTypeNo) > 0){
if( $selSysTypeNo != 'all'){
$whereStr .=" $logTable.sysTypeNo = '$selSysTypeNo'";
}
if($selAlarmLevel == 'all'){
$whereStr .=" ";
}elseif( $selAlarmLevel == 'unclear'){
if(strlen($whereStr) > 0){
$whereStr .=" AND clearTime = '0000-00-00 00:00:00' ";
}else{
$whereStr .=" clearTime = '0000-00-00 00:00:00' ";
}
}elseif( $selAlarmLevel == 'cleared'){
if(strlen($whereStr) > 0){
$whereStr .=" AND clearTime <> '0000-00-00 00:00:00' ";
}else{
$whereStr .=" clearTime <> '0000-00-00 00:00:00' ";
}
}else{
if(strlen($whereStr) > 0){
$whereStr .=" AND alarmLevel = '$selAlarmLevel' AND clearTime = '0000-00-00 00:00:00'";
}else{
$whereStr .=" alarmLevel = '$selAlarmLevel' AND clearTime = '0000-00-00 00:00:00'";
}
}
}else{
if(strlen($whereStr) < 1){
$whereStr =" clearTime = '0000-00-00 00:00:00' ";
}
}
if($DEBUG) echo "<br>whereStr=$whereStr";
//查询基本条件
if(strlen($whereStr) > 10){
$bascWhereStr ="
AND $logTable.sysTypeNo = $defTable.sysTypeNo
AND $logTable.compCode = $defTable.compCode
AND $logTable.alarmCode = $defTable.alarmCode
";
}else{
$bascWhereStr ="
$logTable.sysTypeNo = $defTable.sysTypeNo
AND $logTable.compCode = $defTable.compCode
AND $logTable.alarmCode = $defTable.alarmCode
";
}
//首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。
if($selSysTypeNo=='all' || !isset($selSysTypeNo)|| strlen($selSysTypeNo)==0)
{//get $bssWhereStr
$bssDB = 'BssOmcDb';
$bssLogTable = 'BssOmcDb.OMCR_ALARMEVENT';
$bssOrderByStr = "EventTime DESC,bssid";//排序顺序
$bssWhereStr = "";
if($selAlarmLevel == 'all'){
$bssWhereStr .="(1)";
}elseif( strlen($selAlarmLevel)==0 || $selAlarmLevel == 'unclear'){
if(strlen($bssWhereStr) > 0){
$bssWhereStr .=" AND (ClearTime is null or ClearTime='0000-00-00 00:00:00')";
}else{
$bssWhereStr .=" (ClearTime is null or ClearTime='0000-00-00 00:00:00')";
}
}elseif( $selAlarmLevel == 'cleared'){
if(strlen($bssWhereStr) > 0){
$bssWhereStr .=" AND ClearTime <> '0000-00-00 00:00:00' ";
}else{
$bssWhereStr .=" ClearTime <> '0000-00-00 00:00:00' ";
}
}else{
if(strlen($bssWhereStr) > 0){
$bssWhereStr .=" AND AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0000-00-00 00:00:00')";
}else{
$bssWhereStr .=" AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0000-00-00 00:00:00')";
}
}
if($DEBUG) echo "<br>bssWhereStr=$bssWhereStr";
}//end get $bssWhereStr
if(!$numberOfRecords){
if(!isset($bgnNo))
$bgnNo=0;
$countSql="SELECT count(*) as totalNum
FROM $logTable,$defTable
WHERE $whereStr
$bascWhereStr
";
if($DEBUG) echo "<br>countSql=$countSql";
$result=mysqli_query($pubConn,$countSql);
echo mysqli_error($pubConn);
$record = @mysqli_fetch_array($result);
$numberOfRecords = $record[0];
if($DEBUG)
echo "<br>numberOfRecords=$numberOfRecords";
if($selSysTypeNo=='all' || !isset($selSysTypeNo)|| strlen($selSysTypeNo)==0)
{
if(!$numberofBSS){
//$bgnNo=0;
$countSql="SELECT count(*) as totalNum FROM $bssLogTable WHERE $bssWhereStr";
if($DEBUG) echo "<br>countBSSSql=$countSql";
$bssResult=mysqli_query($pubConn,$countSql);
echo mysqli_error($pubConn);
$bssRecord = @mysqli_fetch_array($bssResult);
$numberofBSS = $bssRecord[0];
}
$numberOfRecords +=$numberofBSS;
}
if($DEBUG) echo "<br>numberofBSS=$numberofBSS";
//插入日志
if($nolog != 1)
insertLog("View Alarm Log");
}
//找到需要显示的纪录
if($numberOfRecords > 0){
$showSql=" SELECT $selectFieldList
FROM $logTable,$defTable
WHERE $whereStr
$bascWhereStr
ORDER BY $orderByStr
LIMIT $bgnNo, $numberPerPage
";
if($DEBUG) echo "<br>showSql=$showSql";
$result=@mysqli_query($pubConn,$showSql);
echo mysqli_error($pubConn);
$thisPageOtherNum = @mysqli_num_rows($result);
$rows=@mysqli_fetch_array($result);
if($DEBUG)echo "<br>thisPageOtherNum:$thisPageOtherNum";
if($selSysTypeNo=='all' || !isset($selSysTypeNo)|| strlen($selSysTypeNo)==0)
if($thisPageOtherNum==0 || $thisPageOtherNum< $numberPerPage)
{
//echo "$thisPageOtherNum< $numberPerPage";
$countSql="SELECT count(*) as totalNum
FROM $logTable,$defTable
WHERE $whereStr
$bascWhereStr
";
if($DEBUG) echo "<br>countSql=$countSql";
$cntResult=mysqli_query($pubConn,$countSql);
echo mysqli_error($pubConn);
$record = @mysqli_fetch_array($cntResult);
$otherTotalNum = $record[0];
$bssBgnNo = $bgnNo+$thisPageOtherNum-$otherTotalNum;
$selectFieldList="500 as sysTypeNo,bssid as sysNo,0 as subSysNo,Severity as alarmLevel,EventInfo as $alarmDesc ,EventTime as alarmTime,ClearTime as clearTime,0 as clearMode,ObjectId";
$showSql=" SELECT $selectFieldList FROM $bssLogTable WHERE $bssWhereStr
ORDER BY $bssOrderByStr LIMIT $bssBgnNo, $numberPerPage ";
if(0)
echo "<br>bssShowSql=$showSql";
$bss_Result=@mysqli_query($pubConn,$showSql);
echo mysqli_error($pubConn);
$thisPageBSSNum = @mysqli_num_rows($bss_Result);
$bss_Rows=@mysqli_fetch_array($bss_Result);
}
//下面是控制分页显示需要传递的变量传递变量
if ($numberOfRecords >= 1) {
$nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目
if ($nextBgnNo > $numberOfRecords){
$nextBgnNo = $numberOfRecords;
}
$t1 = $bgnNo + 1;
$prevBgnNo = $bgnNo - $numberPerPage;
if ($prevBgnNo < 0) {
$prevBgnNo = 0;
}
$basePageLink ="selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&numberOfRecords=$numberOfRecords";
$prePageLink ="bgnNo=$prevBgnNo";
$nextPageLink ="bgnNo=$nextBgnNo";
}
$showBgnNo=$bgnNo+1;
}
}//end else.
//==========================================================
//输出并显示数据
//==========================================================
?>
<form name="selectform" action="./alarmList_down.php" method="post">
<?php
echo "<input type=\"hidden\" value=\"$selSysTypeNo\" name=\"selSysTypeNo\">";
echo "<input type=\"hidden\" value=\"$selAlarmLevel\" name=\"selAlarmLevel\">";
echo "<input type=\"hidden\" value=\"$noop\" name=\"noop\">";
if($numberOfRecords == 0){
echo "<br><font size =\"3\" color=\"#000000\">Currently there is no alarm!</font>";
exit();
}
?>
<TABLE border="0" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF">
<TR>
<TD >
<?php
echo "$strDisplayRecords<FONT color=#0000ff>&nbsp;$showBgnNo - $nextBgnNo</FONT>, ";
echo "($strTotal:$numberOfRecords)";
?>
</TD>
<TD align="right">
<?php
// NEW: Display a link for the previous set of records.
if ($bgnNo != 0) {
echo "<a href=\"$PHP_SELF?$basePageLink&$prePageLink\">";
echo "Previous&nbsp;<IMG alt=$strPreviousPage align=absBottom border=0 src=../../images/left.gif ></a>&nbsp;";
}else{
echo "<font color=\"#808080\">Previous&nbsp;</font><IMG alt=$strPreviousPage align=absBottom border=0 src=../../images/left_1.gif ></a>&nbsp;";
}
//根据纪录条数,算出页码数,本页页码
if($numberOfRecords > 0){
$totalPageNum = ceil($numberOfRecords / $numberPerPage );
$pageNo = $bgnNo / $numberPerPage + 1;
}
echo "<SELECT size=\"1\" name=\"pageNo\" onChange=\"javasript:goPage($numberOfRecords)\">";
for($i=1;$i<=$totalPageNum;$i++){
if($i== $pageNo){
echo "<option selected value=\"$i\" >$i</option>";
}else{
echo "<option value=\"$i\">$i</option>";
}
}
echo "</SELECT>";
// NEW: Display a link for the next set of records.
if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) {
echo "<a href=\"$PHP_SELF?$basePageLink&$nextPageLink\">";
echo "<IMG alt=$strNextPage align=absBottom border=0 src=../../images/right.gif>&nbsp;Next</a>";
}else{
echo "<IMG alt=$strNextPage align=absBottom border=0 src=../../images/right_1.gif ><font color=\"#808080\">&nbsp;Next</font>";
}
?>
</TD>
</TR>
</TABLE>
<table border="1" width="100%" cellpadding="1" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF">
<tr bgcolor="#E6E6E6">
<?php
$i=0;
for($i=0;$i<sizeof($showFieldArr);$i++){
echo "<td align=\"center\">";
echo "$showFieldArr[$i]";
echo "</td>";
}
?>
</tr>
<?php
if($thisPageOtherNum>0)
do
{
if($selSysTypeNo==500)
{
$sysName = "BSS_".$rows[sysNo]."_".$rows[subSysNo];
}
else
{
for($i=0; $i < sizeof($sysTypeDef); $i++){
if($rows[sysTypeNo] == $sysTypeDef[$i][sysTypeNo]){
$sysName=$sysTypeDef[$i][sysTypeName].'_'.$rows[sysNo].'_'.$rows[subSysNo];
$sysId=$rows[sysTypeName].'_'.$rows[sysNo].'_'.$rows[subSysNo];
break;
}
}
if(strlen($sysName) < 3){
$sysName='unknown';
//continue;
}
}
$sysTypeNo =$rows[sysTypeNo];
$sysNo =$rows[sysNo];
$subSysNo =$rows[subSysNo];
$compCode =$rows[compCode];
$alarmCode =$rows[alarmCode];
$alarmLevel =$rows[alarmLevel];
$descript =$rows[$alarmDesc];
$alarmTime =$rows[alarmTime];
$clearTime =$rows[clearTime];
$clearMode =$rows[clearMode];
$sysName=getSystemNameBySysTypeNo($sysTypeNo).'_'.$rows[sysNo].'_'.$rows[subSysNo];;
echo "<tr>";
echo "<td align=\"right\">";
echo "&nbsp; $sysName";
echo "</td>";
echo "<td align=\"left\">";
$alarmLevelRemark=$alarmLevelDefArr[$alarmLevel][remark];
echo "<font color=\"{$alarmLevelDefArr[$alarmLevel][color]}\">&nbsp; $alarmLevelRemark</font>";
echo "</td>";
echo "<td align=\"left\">";
echo "&nbsp; $descript";
echo "</td>";
echo "<td align=\"right\">";
echo "&nbsp; $alarmTime";
echo "</td>";
echo "<td align=\"right\">";
echo "&nbsp; $clearTime";
echo "</td>";
if($noop!=1)
{
echo "<td align=\"center\">";
if($clearTime == "0000-00-00 00:00:00"){
if($sysTypeNo==500){
echo "<a href=\"$PHP_SELF?actMode=clear&sysTypeNo=$sysTypeNo&sysNo=$sysNo&subSysNo=$subSysNo";
echo "&compCode=$compCode&alarmCode=$alarmCode&alarmTime=$alarmTime&alarmLevel=$alarmLevel";
echo "&selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&bgnNo=$bgnNo&rmObjectid=$rows[ObjectId]";
echo "\"><img src=\"../../images/delete.gif\" border=\"0\"></a>";
}else{
echo "<a href=\"$PHP_SELF?actMode=clear&sysTypeNo=$sysTypeNo&sysNo=$sysNo&subSysNo=$subSysNo";
echo "&compCode=$compCode&alarmCode=$alarmCode&alarmTime=$alarmTime&alarmLevel=$alarmLevel";
echo "&selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&bgnNo=$bgnNo";
echo "\"><img src=\"../../images/delete.gif\" border=\"0\"></a>";
}
}elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 1){
echo "--";
}elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 0){
echo "--";
}
echo "</td>";
}
echo "</tr>";
}while($rows=mysqli_fetch_array($result));
if($thisPageBSSNum>0)
do
{
$sysName = "BSS_".$bss_Rows[sysNo]."_".$bss_Rows[subSysNo];
$sysTypeNo =$bss_Rows[sysTypeNo];
$sysNo =$bss_Rows[sysNo];
$subSysNo =$bss_Rows[subSysNo];
$compCode =$bss_Rows[compCode];
$alarmCode =$bss_Rows[alarmCode];
$alarmLevel =$bss_Rows[alarmLevel];
$descript =$bss_Rows[$alarmDesc];
$alarmTime =$bss_Rows[alarmTime];
$clearTime =$bss_Rows[clearTime];
$clearMode =$bss_Rows[clearMode];
echo "<tr>";
echo "<td align=\"right\">";
echo "&nbsp; $sysName";
echo "</td>";
echo "<td align=\"left\">";
$alarmLevelRemark=$alarmLevelDefArr[$alarmLevel][remark];
echo "<font color=\"{$alarmLevelDefArr[$alarmLevel][color]}\">&nbsp; $alarmLevelRemark</font>";
echo "</td>";
echo "<td align=\"left\">";
echo "&nbsp; $descript";
echo "</td>";
echo "<td align=\"right\">";
echo "&nbsp; $alarmTime";
echo "</td>";
echo "<td align=\"right\">";
echo "&nbsp; $clearTime";
echo "</td>";
if($noop!=1)
echo "<td align=\"center\">";
if($clearTime == '0000-00-00 00:00:00' && $noop!=1){
if($sysTypeNo==500){
echo "<a href=\"$PHP_SELF?actMode=clear&sysTypeNo=$sysTypeNo&sysNo=$sysNo&subSysNo=$subSysNo";
echo "&compCode=$compCode&alarmCode=$alarmCode&alarmTime=$alarmTime&alarmLevel=$alarmLevel";
echo "&selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&bgnNo=$bgnNo&rmObjectid=$bss_Rows[ObjectId]";
echo "\"><img src=\"../../images/delete.gif\" border=\"0\"></a>";
}else{
echo "<a href=\"$PHP_SELF?actMode=clear&sysTypeNo=$sysTypeNo&sysNo=$sysNo&subSysNo=$subSysNo";
echo "&compCode=$compCode&alarmCode=$alarmCode&alarmTime=$alarmTime&alarmLevel=$alarmLevel";
echo "&selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&bgnNo=$bgnNo";
echo "\"><img src=\"../../images/delete.gif\" border=\"0\"></a>";
}
}elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 1 && $noop!=1){
echo "--";
}elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 0 && $noop!=1){
echo "--";
}
echo "</td>";
echo "</tr>";
}while($bss_Rows=@mysqli_fetch_array($bss_Result));
?>
</table>
</form>
<?php
adjust_content_tail("down");
?>
</body>
</html>
+28
View File
@@ -0,0 +1,28 @@
<?php
require("../../inc/header.inc");
?>
<frameset framespacing="0" border="0" rows="75,*" frameborder="0">
<?php
if(isset($selAlarmLevel) && $selSysTypeNo=='all' && $noop==1)
{
echo "<frame name=\"header\" scrolling=\"no\" noresize target=\"main\" src=\"alarmList_up.php?selAlarmLevel=$selAlarmLevel&selSysTypeNo=all&noop=1\">";
echo "<frame name=\"main\" src=\"alarmList_down.php?selAlarmLevel=$selAlarmLevel&selSysTypeNo=all&noop=1\" scrolling=\"auto\">";
}
else
{
echo "<frame name=\"header\" scrolling=\"no\" noresize target=\"main\" src=\"alarmList_up.php\">";
echo "<frame name=\"main\" src=\"alarmList_down.php\" scrolling=\"auto\">";
}
?>
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>
+98
View File
@@ -0,0 +1,98 @@
<?php
/*********************************************************
程序说明:
功能说明:告警查询的上部页面
调用关系:
变量说明:
返回值:无
作者:
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
require("../../inc/header.inc");
$db='OMC_PUB';
$pageTitle = "$strLog&nbsp;>&nbsp;$strLogAlarm";
$device_sql ="SELECT sysTypeNo,sysTypeName
FROM $sysconf_table
WHERE needHeartBeat >'0'
ORDER BY sysTypeNo
";
$device_result = @mysqli_query($pubConn,$device_sql);
$device_rows = @mysqli_fetch_array($device_result);
echo mysqli_error($pubConn);
?>
<base target="main">
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<form method="post" name="theform" id="theform" action="alarmList_down.php" >
<?php
adjust_head_frame("up");
adjust_title_head_frame("up");
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"70%\" align=\"left\">";
echo "$pageTitle";
echo "</td>";
echo "<td align=\"right\" title=\"Help\">";
$helpId = "4.1";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\">";
echo "$strSysType";
echo "<select size=\"1\" name=\"selSysTypeNo\"> ";
echo "<option value=\"all\">$strAll</option>";
do{
echo "<option value=\"$device_rows[sysTypeNo]\" >";
echo "$device_rows[sysTypeName]";
echo "</option>";
}while($device_rows = mysqli_fetch_array($device_result));
echo "<option value=\"500\" >BSS</option>";
echo "</select>&nbsp;";
echo "$strAlamState";
echo "&nbsp;<select name=\"selAlarmLevel\" size=\"1\">";
echo "<option value=\"unclear\">$strNotCleared</option>";
echo "<option value=\"cleared\">$strCleared</option>";
echo "<option value=\"all\">$strAll</option>";
echo "<option value=\"unclear\">--Level--</option>";
for($i=1;$i<sizeof($alarmLevelDefArr);$i++){
$alarmLevelRemark=$alarmLevelDefArr[$i][remark];
$alarmLevelValue=$alarmLevelDefArr[$i][value];
if($alarmLevelValue == $selAlarmLevel)
echo "<option selected value=\"$alarmLevelValue\">$alarmLevelRemark</option>";
else
echo "<option value=\"$alarmLevelValue\">$alarmLevelRemark</option>";
}
echo "</select>&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=\"hidden\" value=$noop name=\"noop\">";
?>
<span id='searchID' onClick="javascript:document.theform.submit();" style="cursor:hand">
<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
</span>
<?php
echo "</td>";
echo "<td align=\"right\">";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail_frame("up");
adjust_content_head_frame("up");
adjust_content_tail_frame("up");
?>
</form>
</body>
</html>
+126
View File
@@ -0,0 +1,126 @@
<?php
/*********************************************************
程序说明:
功能说明:告警查询的下部页面,查询显示
调用关系:
变量说明:
作者:
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
require("../../inc/header.inc");
$DEBUG = 0;
getSerial();//get serial number
//==========================================================
//变量定义
//==========================================================
$dbName = 'OMC_PUB';
$defTable = 'sysAlarmConf';
$logTable = 'sysAlarmLog';
$alarmNumArr[1][number] =0;
$alarmNumArr[1][title] ="Critical Alarm";
$alarmNumArr[1][bgcolor]="#FF0000";
//$alarmNumArr[1][bgcolor]="#FF9900";
$alarmNumArr[2][number] =0;
$alarmNumArr[2][title] ="Major Alarm";
$alarmNumArr[2][bgcolor]="#FF9900";
//$alarmNumArr[2][bgcolor]="#FFCC99";
$alarmNumArr[3][number] =0;
$alarmNumArr[3][title] ="Minor Alarm";
$alarmNumArr[3][bgcolor]="#FFFF99";
$alarmNumArr[4][number] =0;
$alarmNumArr[4][title] ="Warning";
$alarmNumArr[4][bgcolor]="#CCFFFF";
$alarmNumArr[5][number] =0;
$alarmNumArr[5][title] ="Undefined Alarm";
$alarmNumArr[5][bgcolor]="#99CCFF";
//==========================================================
//输入变量
//==========================================================
//==========================================================
//数据处理
//==========================================================
$showSql=" SELECT t2.alarmLevel,count(*) as number
FROM $logTable as t1,$defTable as t2
WHERE t1.clearTime = '0000-00-00 00:00:00'
AND t1.sysTypeNo = t2.sysTypeNo
AND t1.compCode = t2.compCode
AND t1.alarmCode = t2.alarmCode
GROUP BY t2.alarmLevel
";
if($DEBUG) echo "<br>showSql=$showSql";
$result=@mysqli_query($pubConn,$showSql);
echo mysqli_error($pubConn);
while($rows=@mysqli_fetch_array($result)){
$alarmNumArr[$rows[alarmLevel]][number]=$rows[number];
}
//==========================================================
//输出并显示数据
//==========================================================
?>
<script language="JavaScript">
function refreshpage()
{
setInterval(ref,10000);
}
function ref()
{
window.location.href="./alarmNumList.php";
}
</script>
<body leftmargin="0" topmargin="0" onload="javascript:refreshpage();">
<style type="text/css">
<!--
A:link {text-decoration: none; color: #000000}
A:visited {text-decoration: none; color: #000000}
A:hover {text-decoration: none; color: #FFFFFF}
-->
</style>
<meta http-equiv="refresh" content="10 url=<?php echo "$PHP_SELF"; ?>">
<meta http-equiv="pragma" content="no-cache">
<div align="right">
<table border="0" width="100%">
<tr>
<td width="55%" title="Serial Number">
<?php
echo "SN:<font color=\"$ttlSrlClr\">$ttlSerial</font>";
?>
</td>
<td width="45%">
<TABLE border="1" width="100%" cellpadding="1" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<?
//echo "<a href=\"../../fault/alarmList/alarmList_index.php\" >{$alarmNumArr[$i][number]}</a>";
echo "<tr align=\"center\">";
for($i=1;$i<=sizeof($alarmNumArr);$i++){
echo "\n <td width=\"15%\" bgcolor=\"{$alarmNumArr[$i][bgcolor]}\" title=\"{$alarmNumArr[$i][title]}\">";
echo "<b>{$alarmNumArr[$i][number]}</b>";
echo "</td>";
}
echo "</tr>";
?>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
+83
View File
@@ -0,0 +1,83 @@
<?php
/*********************************************************
程序说明:
功能说明:告警查询的下部页面,查询显示
调用关系:
变量说明:
作者:
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
require("../../inc/header.inc");
$DEBUG = 0;
//==========================================================
//变量定义
//==========================================================
$dbName = 'OMC_PUB';
$defTable = 'sysAlarmConf';
$logTable = 'sysAlarmLog';
$numberPerPage = 100; //每页纪录数
$orderByStr = "alarmTime DESC,sysTypeNo,sysNo,subSysNo";//排序顺序
//确定告警内容显示语言种类
if($language=='chn'){
$alarmDesc = alarmDesc_1; //chinese
}else{
$alarmDesc = alarmDesc_2;
}
//初始化设备名和设备编号数组,
//由于三张表一起查时,速度太慢,占用系统资源太大。
//所以系统类型编号对应的系统类型名称不从数据库中直接取。
//将数据到如数组,显示时,从数组中来取。
$device_sql ="SELECT sysTypeNo,sysTypeName
FROM $sysconf_table
WHERE needHeartBeat >'0'
ORDER BY sysTypeNo
";
$device_result = @mysqli_query($pubConn,$device_sql);
$device_rows = @mysqli_fetch_array($device_result);
echo mysqli_error($pubConn);
$i=0;
do{
$sysTypeDef[$i][sysTypeNo] = $device_rows[sysTypeNo];
$sysTypeDef[$i][sysTypeName]= $device_rows[sysTypeName];
$i++;
}while($device_rows = mysqli_fetch_array($device_result));
//需要被查询的字段名
$selectFieldList="$logTable.sysTypeNo,sysNo,subSysNo,$logTable.compCode,$logTable.alarmCode,alarmLevel,$alarmDesc ,alarmTime,clearTime,clearMode,clearInfo";
//显示列表时的表头标题
if ($selectedLanguage == 'eng')
$showFieldArr=array('System','Alarm code','Alarm level','Events','Alarm time','Clear time','Clear');
elseif ($selectedLanguage == 'chn')
$showFieldArr=array('系统号','告警代码','告警等级','描述','告警时间','清除时间','清除');
//==========================================================
//输入变量
//==========================================================
//上部页面传入的变量
if($DEBUG) echo "<br>selSysTypeNo = $selSysTypeNo";
if($DEBUG) echo "<br>selAlarmLevel = $selAlarmLevel";
if($DEBUG) echo "<br>selAlarmCode = $selAlarmCode";
if($DEBUG) echo "<br>Clr = $Clr";
if($DEBUG) echo "<br>Gen = $Gen";
omcProgressBar(100,100);
omcProgressBar(100,80);
omcProgressBar(100,60);
omcProgressBar(100,40);
omcProgressBar(100,20);
omcProgressBar(100,$selAlarmCode);
?>
+17
View File
@@ -0,0 +1,17 @@
<?php
require("../../inc/header.inc");
?>
<frameset framespacing="0" border="0" rows="75,*" frameborder="0">
<frame name="header" scrolling="no" noresize target="main" src="alarmgen_up.php">
<frame name="main" src="alarmgen_down.php" scrolling="auto">
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>
+105
View File
@@ -0,0 +1,105 @@
<?php
/*********************************************************
程序说明:
功能说明:告警产生页面
调用关系:
变量说明:
返回值:无
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
require("../../inc/header.inc");
$DEBUG = 0;
$helpId = "4.1";
$db='OMC_PUB';
$pageTitle = "$strLog&nbsp;>&nbsp;$strLogAlarm>&nbsp;Generator";
$device_sql ="SELECT sysTypeNo,sysTypeName
FROM $sysconf_table
WHERE needHeartBeat >'0'
ORDER BY sysTypeNo
";
$device_result = @mysqli_query($pubConn,$device_sql);
$device_rows = @mysqli_fetch_array($device_result);
echo mysqli_error($pubConn);
?>
<base target="main">
<body leftmargin="12" topmargin="5">
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$pageTitle";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<form method="post" name="theform" id="theform" action="alarmgen_down.php?a=" >
<table border="0" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr >
<td align="right">
<nobr>
<?php
echo "Devices&nbsp;&nbsp;";
echo "<select size=\"1\" name=\"selSysTypeNo\"> ";
echo "<option value=\"all\">$strAll</option>";
do{
echo "<option value=\"$device_rows[sysTypeNo]\" >";
echo "$device_rows[sysTypeName]";
echo "</option>";
}while($device_rows = mysqli_fetch_array($device_result));
echo "</select>&nbsp;&nbsp;&nbsp;&nbsp;";
echo "Alarm Severity&nbsp;&nbsp;";
echo "&nbsp;<select name=\"selAlarmLevel\" size=\"1\">";
echo "<option value=\"all\">$strAll</option>";
for($i=1;$i<sizeof($alarmLevelDefArr);$i++){
$alarmLevelRemark=$alarmLevelDefArr[$i][remark];
$alarmLevelValue=$alarmLevelDefArr[$i][value];
echo "<option value=\"$alarmLevelValue\">$alarmLevelRemark</option>";
}
echo "</select>&nbsp;&nbsp;&nbsp;&nbsp;";
echo "Alarm Code&nbsp;&nbsp;";
echo "&nbsp;<select name=\"selAlarmCode\" size=\"1\">";
echo "<option value=\"all\">$strAll</option>";
for($i=1;$i<sizeof($alarmLevelDefArr);$i++){
$alarmLevelRemark=$alarmLevelDefArr[$i][remark];
$alarmLevelValue=$alarmLevelDefArr[$i][value];
echo "<option value=\"$alarmLevelValue\">$alarmLevelRemark</option>";
}
echo "</select>&nbsp;&nbsp;&nbsp;&nbsp;";
?>
</nobr>
</td>
<td>
<?php
echo "<input type=\"submit\" name=\"Gen\" value=\"Generate\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
?>
</td>
<td>
<?php
echo "<input type=\"submit\" name=\"Clr\" value=\"Clear\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
?>
</td>
<td width="50%"></td>
</tr>
</table>
</form>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
sn=
+67
View File
@@ -0,0 +1,67 @@
<?php
require("../../inc/header.inc");
$dbName = 'OMC_PUB';
$defTable = 'sysAlarmConf';
$logTable = 'sysAlarmLog';
$showSql=" SELECT t2.alarmLevel,count(*) as number
FROM $logTable as t1,$defTable as t2
WHERE t1.clearTime = '0'
mysqli_fetch_array(
AND t1.sysTypeNo = t2.sysTypeNo
AND t1.compCode = t2.compCode
AND t1.alarmCode = t2.alarmCode
GROUP BY t2.alarmLevel
";mysqli_fetch_array(
if($DEBUG) echo "<br>showSql=$showSql";
$result=@mysqli_query($pubConn,$showSql);
echo mysqli_error($pubConn);
while($rows=@mysql_fetch_array($result))
{
$alarmNumArr[$rows[alarmLevel]][number]=$rows[number];
}
$selSql = "SELECT AlarmLevel as alarmLevel,count(*) as numbe
FROM BssOmcDb.OMCR_ALARMEVENT WHERE ClearTime = '0' GROUP BY alarmLevel";
$result=@mysqli_query($pubConn,$showSql);
echo mysqli_error($pubConn);
while($rows=@mysql_fetch_array($result))
{
$alarmNumArr[$rows[alarmLevel]][number]+=$rows[number];
}
?>
BIN
View File
Binary file not shown.
+402
View File
@@ -0,0 +1,402 @@
<?php
/*********************************************************
文件说明:
功能说明:显示所有BSC的基本状态
1.显示状态内容:显示一个bsc和连接到这个bsc上的Abis状态
2.取状态的方法:从BssOmcDb的各个表取出各种参数
3.定时发送get命令,从而更新各个对象的状态信息
调用关系:调用:header.inc
被调用:
变量说明:
作者:
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
require("../../inc/header.inc");
$DEBUG=0;
global $pubConn,$OMC_server;
//==========================================================
//变量定义
//==========================================================
$bssDb = "BssOmcDb";
$bssConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "BssOmcDb");
$pubDb = "OMC_PUB";
//$bscSysTypeNo=omc_sys_type2code(BSC);
$bscSysTypeNo='510';
$bssSysTypeNo='500';
$redColor = "#FF0000";
$blueColor = "#0000FF";
$yellowColor = "#FFFF00";
//确定显示语言种类
if($language == 'chn'){
$ClockOperState = array('初始化','自行运行','获取同步信号','延时','同步信号有效','获取成功','时钟已同步');
$ClockReference = array('第一时钟参考','第二时钟参考','连接','无参考');
$AvailState = array('测试中','故障','电源中断','离线','在线','相关模块未激活','不完全工作','未安装');
$AvailStateColor = array($yellowColor,$redColor,$redColor,$redColor,$blueColor,$yellowColor,$yellowColor,$redColor);
$UsageState = array('空闲','运行','忙');
$AlarmLevel= array('无告警','一级告警','二级告警','三级告警','低级警告','系统信息');
$AdminState=array('无效值','加锁','解锁');
$OperState=array('无效值','不可用','可用');
}else{
$ClockOperState = array('Init','Free run','Acquire SYNC','Holdover','Acquire qual','Acquire','Track');
$ClockReference = array('Primary_ref','Second_ref','Connector','None_ref');
$AvailState = array('In test','Failed','Power off','Offline','Online','Dependency','Degraded','Not installed');
$AvailStateColor = array($yellowColor,$redColor,$redColor,$redColor,$blueColor,$yellowColor,$yellowColor,$redColor);
$UsageState = array('Idle','Active','Busy');
$AlarmLevel= array('no alarm1','Critical','Major','Minor','Warning','Information');
$AdminState=array('unknown','Locked','Unlocked');
$OperState=array('unknown','Disabled','Enabled');
}
//nmi命令定义数组,在显示信息之后,需要发送命令来更新数据库
$nmiCommArr = array(
array('oid Bsc.0','get','0'),
array('oid Card.0.17','get','0'),
array('oid ALink.0.0.0','get','0'),
array('oid ALink.0.0.1','get','0'),
array('oid ALink.0.0.2','get','0'),
array('oid ALink.0.0.3','get','0')
);
//根据需要显示的信息定义结构体,方便信息的存放和显示
/*
$bscInfo[i]=array(
"bssId"=>'',
"alias"=>'',
"status"=>'',
"ALink_0_stat"=>'',
"ALink_0_slot"=>'',
"ALink_0_port"=>'',
"ALink_1_stat"=>'',
"ALink_1_slot"=>'',
"ALink_1_port"=>'',
"ALink_2_stat"=>'',
"ALink_2_slot"=>'',
"ALink_2_port"=>'',
"ALink_3_stat"=>'',
"ALink_3_slot"=>'',
"ALink_3_port"=>'',
"ClockOperStat"=>'',
"ClockReference"=>'',
"refreshTime"=>''
);
*/
//==========================================================
//输入变量
//==========================================================
//清除一个BSC的状态时,需传入的变量
if($DEBUG) echo "<br>actMode=$actMode";
if($DEBUG) echo "<br>sysTypeNo=$bscSysTypeNo";
if($DEBUG) echo "<br>sysNo=$sysNo";
if($DEBUG) echo "<br>subSysNo=$subSysNo";
//==========================================================
//数据处理
//==========================================================
//清除一个BSC的状态
if($actMode == 'clear'){
$clrSql="DELETE FROM sysStat
WHERE sysTypeNo='$bscSysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'
";
if($DEBUG) echo "<br>clrSql=$clrSql";
mysqli_query($pubConn,$clrSql);
echo mysqli_error($pubConn);
}
$listSql = "SELECT a.bssid,a.ip,b.Label as name,a.connected FROM BssOmcDb.OMCR_BSSTABLE as a, BssOmcDb.OMCR_BssFunc as b" .
" WHERE a.ip!='' AND a.bssid=b.bssid ORDER BY bssid";
if($DEBUG) echo "<br>listSql = $listSql<br>";
$listResult = mysqli_query($bssConn,$listSql);
$i=0;
while($listRows=@mysqli_fetch_array($listResult)){
//get installed bsc id, alias,updateTime form sysInfo table
$updateTimeSql = "SELECT updateTime FROM sysStat
WHERE sysTypeNo='$bscSysTypeNo'
AND sysNo='$listRows[bssid]'
";
if($DEBUG)
echo "<br>updateTimeSql = $updateTimeSql";
$result = mysqli_query($pubConn,$updateTimeSql);
echo mysqli_error($pubConn);
//if(mysqli_num_rows($result) <= 0){
// echo "<br>$strNotFoundAnyBSC";
// exit();
//}
$rows = mysqli_fetch_array($result);
$bscInfo[$i][bscId]=$listRows[bssid];
$bscInfo[$i][alias]=$listRows[name];
$bscInfo[$i][refreshTime]=$rows[updateTime];
if($DEBUG) echo "<br>===================";
if($DEBUG) echo "<br>bscInfo[$i][bscId]={$bscInfo[$i][bscId]}";
if($DEBUG) echo "<br>bscInfo[$i][alias]={$bscInfo[$i][alias]}";
if($DEBUG) echo "<br>bscInfo[$i][refreshTime]={$bscInfo[$i][refreshTime]}";
$i++;
}
$bscNum = $i;
//echo "<br>bscNum=$bscNum";
//get system alias
//$sysAlias=
for($i=0; $i<$bscNum; $i++){
//Bsc status --> Bsc.bsc_id
$ObjectId = 'Bsc.0';
$Bsc_sql="SELECT t1.AdminState,t1.OperState,t1.AvailStatus,t1.UsageState,t2.Presence
FROM OMCR_Bsc as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '{$bscInfo[$i][bscId]}'
AND t2.bssid = '{$bscInfo[$i][bscId]}'
AND t1.ObjectId = '$ObjectId'
AND t1.ObjectId = t2.ObjectId
";
if($DEBUG) echo "<br><br>Bsc_sql = $Bsc_sql";
$result = mysqli_query($bssConn,$Bsc_sql);
echo mysqli_error($bssConn);
$rows = mysqli_fetch_array($result);
$bscInfo[$i][bscStatus]= $AvailState[$rows[AvailStatus]];
$bscInfo[$i][bscStatusColor]= $AvailStateColor[$rows[AvailStatus]];
//clock module->Card.0.10
$ObjectId = 'Card.0.17';
$clock_module_sql = "SELECT t1.CurrentOperationalState,t1.CurrentClockReference,t2.Presence
FROM OMCR_ClockMod as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '{$bscInfo[$i][bscId]}'
AND t2.bssid = '{$bscInfo[$i][bscId]}'
AND t1.ObjectId = '$ObjectId'
AND t1.ObjectId = t2.ObjectId
ORDER BY t1.ObjectId
";
if($DEBUG) echo "<br><br>clock_module_sql = $clock_module_sql";
$result = mysqli_query($bssConn,$clock_module_sql);
echo mysqli_error($bssConn);
$rows = mysqli_fetch_array($result);
$bscInfo[$i][ClockOperStat]=$ClockOperState[$rows[CurrentOperationalState]];
$bscInfo[$i][ClockReference]=$ClockReference[$rows[CurrentClockReference]];
//get ALink status -> ALink.Bsc_id.0.n
$ObjectId = 'ALink.0.0.%';
$ALink_sql = " SELECT t1.AvailStatus,t1.UsageState,t1.e1Slots,t1.e1Framer,t1.e1Channel,t2.Presence
FROM OMCR_ALink as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '{$bscInfo[$i][bscId]}'
AND t2.bssid = '{$bscInfo[$i][bscId]}'
AND t1.ObjectId = t2.ObjectId
";
if($DEBUG) echo "<br>ALink_sql = $ALink_sql";
$result = mysqli_query($bssConn,$ALink_sql);
echo mysqli_error($bssConn);
$AlinkNum=mysqli_num_rows($result);
for($k=0;$k<$AlinkNum;$k++){
$rows = mysqli_fetch_array($result);
if($rows[Presence] > 0){
$bscInfo[$i]["ALink_".$k."_stat"]=$AvailState[$rows[AvailStatus]];
$bscInfo[$i]["ALink_".$k."_statColor"]=$AvailStateColor[$rows[AvailStatus]];
$bscInfo[$i]["ALink_".$k."_slot"]=$rows[e1Slots];
$bscInfo[$i]["ALink_".$k."_port"]=$rows[e1Framer];
}else{
$bscInfo[$i]["ALink_".$k."_stat"]='--';
$bscInfo[$i]["ALink_".$k."_slot"]='--';
$bscInfo[$i]["ALink_".$k."_port"]='--';
}
}
if($DEBUG) echo "<br>===================";
if($DEBUG) echo "<br>bscInfo[$i][bscId]={$bscInfo[$i][bscId]}";
if($DEBUG) echo "<br>bscInfo[$i][alias]={$bscInfo[$i][alias]}";
if($DEBUG) echo "<br>bscInfo[$i][refreshTime]={$bscInfo[$i][refreshTime]}";
if($DEBUG) echo "<br>bscInfo[$i][bscStatus]= {$bscInfo[$i][bscStatus]}";
if($DEBUG) echo "<br>bscInfo[$i][ClockOperStat]={$bscInfo[$i][ClockOperStat]}";
if($DEBUG) echo "<br>bscInfo[$i][ClockReference]={$bscInfo[$i][ClockReference]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_0_stat]={$bscInfo[$i][ALink_0_stat]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_0_slot]={$bscInfo[$i][ALink_0_slot]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_0_port]={$bscInfo[$i][ALink_0_port]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_1_stat]={$bscInfo[$i][ALink_1_stat]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_1_slot]={$bscInfo[$i][ALink_1_slot]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_1_port]={$bscInfo[$i][ALink_1_port]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_2_stat]={$bscInfo[$i][ALink_2_stat]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_2_slot]={$bscInfo[$i][ALink_2_slot]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_2_port]={$bscInfo[$i][ALink_2_port]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_3_stat]={$bscInfo[$i][ALink_3_stat]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_3_slot]={$bscInfo[$i][ALink_3_slot]}";
if($DEBUG) echo "<br>bscInfo[$i][ALink_3_port]={$bscInfo[$i][ALink_3_port]}";
}
//==========================================================
//输出并显示数据
//==========================================================
?>
<meta http-equiv="refresh" content="20 url=<?php echo "$PHP_SELF?sysId=$sysId";?>">
<BODY topmargin="5" leftmargin="12">
<?php
echo "<table boder=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strSysStatus > $strCentralOffice > BSC";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
$helpId="1.2.6.1";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<form method="POST" name=status action="<?php echo "$PHP_SELF";?>" >
<table border="0" width="100%">
<tr><td align="center">
<font size="2" color="#0000ff"><?php echo "BSC $strStatusInformation"; ?></font></td></tr></table>
<table border="1" width="100%" cellpadding="1" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr bgcolor="#E6E6E6">
<td rowspan="2" ><?php echo "$strName"; ?></td>
<td rowspan="2" >ID</td>
<td colspan="3" >ALINK 0</td>
<td colspan="3" >ALINK 1</td>
<td colspan="3" >ALINK 2</td>
<td colspan="3" >ALINK 3</td>
<td rowspan="2"><?php $tempStatus=strtolower($strStatus); echo "BSC $tempStatus"; ?></td>
<td colspan="2" ><?php echo "$strClock"; ?></td>
<td rowspan="2" ><?php echo "$strRefreshTime"; ?></td>
</tr>
<tr bgcolor="#E6E6E6">
<td><?php echo "$strStatus"; ?></td>
<td><?php echo "$strSlot"; ?></td>
<td><?php echo "$strPort"; ?></td>
<td><?php echo "$strStatus"; ?></td>
<td><?php echo "$strSlot"; ?></td>
<td><?php echo "$strPort"; ?></td>
<td><?php echo "$strStatus"; ?></td>
<td><?php echo "$strSlot"; ?></td>
<td><?php echo "$strPort"; ?></td>
<td><?php echo "$strStatus"; ?></td>
<td><?php echo "$strSlot"; ?></td>
<td><?php echo "$strPort"; ?></td>
<td><?php echo "$strOperationMode"; ?></td>
<td><?php echo "$strReference"; ?></td>
</tr>
<?php
for($i=0; $i<$bscNum; $i++){
echo "<tr>";
$tmpBscName=urldecode($bscInfo[$i][alias]);
echo "<td>&nbsp;$tmpBscName</td>";
echo "<td>{$bscInfo[$i][bscId]}</td>";
echo "<td><font color=\"{$bscInfo[$i][ALink_0_statColor]}\">{$bscInfo[$i][ALink_0_stat]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_0_slot]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_0_port]}</font></td>";
echo "<td><font color=\"{$bscInfo[$i][ALink_1_statColor]}\">{$bscInfo[$i][ALink_1_stat]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_1_slot]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_1_port]}</font></td>";
echo "<td><font color=\"{$bscInfo[$i][ALink_2_statColor]}\">{$bscInfo[$i][ALink_2_stat]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_2_slot]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_2_port]}</font></td>";
echo "<td><font color=\"{$bscInfo[$i][ALink_3_statColor]}\">{$bscInfo[$i][ALink_3_stat]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_3_slot]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ALink_3_port]}</font></td>";
echo "<td><font color=\"{$bscInfo[$i][bscStatusColor]}\">{$bscInfo[$i][bscStatus]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ClockOperStat]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][ClockReference]}</font></td>";
echo "<td><font color=\"#0000FF\">{$bscInfo[$i][refreshTime]}</font></td>";
echo "</tr>";
}
?>
</table>
</form>
<table border="0" width="100%" cellpadding="0" cellspacing="1">
<tr>
<td>
<?php echo $strRemark; ?>: &nbsp; &nbsp;
<font color=#0000FF>Y</font> = <?php echo $strNormal; ?>, &nbsp; &nbsp;
<font color=#FF0000>N</font> = <?php echo $strAbnormal; ?>,&nbsp; &nbsp;
-- = <?php echo $strUninstalled; ?>.
</td>
<td align="right">
<?php
echo "<a href=\"../networkStatus/mapStatus.php?showingPageType=$src_page_type&pageNum=$src_page_num\" target=\"contents\">";
echo "<img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">";
echo "$strBack</a>";
?>
</td>
</tr>
</table>
<?php
//----------------------------------Alarm list-----------------------------------------
//get alarm from OMCR_BSSTREE
$Alarm_sql = "SELECT bssid,ObjectId,Severity,EventInfo,EventTime
FROM OMCR_ALARMEVENT
WHERE EventTime > 0 AND Severity > 0
";
if($DEBUG) echo "<br>Alarm_sql = $Alarm_sql";
$result = mysqli_query($bssConn,$Alarm_sql);
echo mysqli_error($bssConn);
if(mysqli_num_rows($result)){
echo "<br><font color=\"blue\">BSS Alarm List</font>";
echo "<table border='1' width='100%' cellpadding='1' cellspacing='0' bordercolor='#666666' bordercolordark='#FFFFFF' bgcolor='#FFFFFF'>";
echo " <tr bgcolor='E6E6E6' align='center'>";
echo "<td>BSS ID</td>";
echo "<td>Object name</td>";
echo "<td>Alarm level</td>";
echo "<td>Alarm info</td>";
echo "<td>Alarm Time</td>";
echo "</tr> ";
while($rows = mysqli_fetch_array($result)){
echo "<tr align=\"center\">";
echo "<td align=\"left\">$rows[bssid]</td>";
echo "<td align=\"left\">$rows[ObjectId]</font></td>";
$tmpLevel=$rows[Severity];
echo "<td>$AlarmLevel[$tmpLevel]</td>";
echo "<td align=\"left\">$rows[EventInfo]</td>";
echo "<td>$rows[EventTime]</td>";
echo "</tr>";
}
echo "</table>";
}
//==========================================================
//发送NMI命令,读出数据,更新数据库
//==========================================================
$getCommNoSql = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 ORDER BY seqNum ASC LIMIT 0,1";
if($DEBUG)
echo "<br>getCommNoSql=$getCommNoSql";
$result = mysqli_query($bssConn,$getCommNoSql);
$rows= mysqli_fetch_array($result);
$bgn_row_num = $rows['row_no'];
for($j=0;$j<$bscNum;$j++){
for($i=0;$i<sizeof($nmiCommArr);$i++){
$nmi_command = $nmiCommArr[$i][0];
$Oid_sql = "REPLACE INTO OMCR_COMMAND
VALUES('$bgn_row_num','{$bscInfo[$j][bscId]}','$nmi_command',null,'255','-1',null,null,null)";
if($DEBUG)
echo "<br>set Oid_sql = $Oid_sql";
$result = mysqli_query($bssConn,$Oid_sql);
echo mysqli_error($bssConn);
$bgn_row_num++;
$nmi_command = $nmiCommArr[$i][1];
$Command_sql = "REPLACE INTO OMCR_COMMAND
VALUES('$bgn_row_num','{$bscInfo[$j][bscId]}','$nmi_command',null,'255','-1',null,null,null)";
if($DEBUG)
echo "<br>Commnad_sql = $Command_sql";
$result = mysqli_query($bssConn,$Command_sql);
echo mysqli_error($bssConn);
$bgn_row_num++;
}
}
?>
</body></html>
+477
View File
@@ -0,0 +1,477 @@
<?php
/*********************************************************
文件说明:
功能说明:显示所有BTS的基本状态
1.显示状态内容:显示一个bsc和连接到这个bsc上的Abis状态
2.取状态的方法:从BssOmcDb的各个表取出各种参数
3.定时发送get命令,从而更新各个对象的状态信息
调用关系:调用:header.inc
被调用:
变量说明:
作者:
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
require("../../inc/header.inc");
$helpId = "1.2.6.2";
$DEBUG=0;
//==========================================================
//变量定义
//==========================================================
$bssDb = "BssOmcDb";
$pubDb ="OMC_PUB";
$bssSysTypeNo ='500';
$bscSysTypeNo ='510';
$btsSysTypeNo ='520';//BTS
$redColor = "#FF0000";
$blueColor = "#0000FF";
$yellowColor = "#FFFF00";
if($default_language == 'chn'){
$ClockOperState = array('初始化','自行运行','获取同步信号','延时','同步信号有效','获取成功','时钟已同步');
$ClockReference = array('第一时钟参考','第二时钟参考','连接','无参考');
$AvailState = array('测试中','故障','电源中断','离线','在线','相关模块未激活','不完全工作','未安装');
$AvailStateColor = array($yellowColor,$redColor,$redColor,$redColor,$blueColor,$yellowColor,$yellowColor,$redColor);
$UsageState = array('空闲','运行','忙');
$AlarmLevel= array('无告警','一级告警','二级告警','三级告警','低级警告','系统信息');
$AdminState=array('无效值','加锁','解锁');
$OperState=array('无效值','不可用','可用');
}else{
$ClockOperState = array('Init','Free run','Acquire SYNC','Holdover','Acquire qual','Acquire','Track');
$ClockReference = array('Primary_ref','Second_ref','Connector','None_ref');
$AvailState = array('In test','Failed','Power off','Offline','Online','Dependency','Degraded','Not installed');
$AvailStateColor = array($yellowColor,$redColor,$redColor,$redColor,$blueColor,$yellowColor,$yellowColor,$redColor);
$UsageState = array('Idle','Active','Busy');
$AlarmLevel= array('no alarm1','Critical','Major','Minor','Warning','Information');
$AdminState=array('unknown','Locked','Unlocked');
$OperState=array('unknown','Disabled','Enabled');
}
/*
$btsInfo[$i]=array(
'bscId'=>'',
'btsId'=>'',
'name'=>'',
'status'=>'',
'AbisStatus'=>'',
'AbisSlot'=>'',
'AbisPort'=>'',
'AbisChannel'=>'',
'Trx2_stat'=>'',
'Trx4_stat'=>'',
'Trx6_stat'=>'',
"ClockOperStat"=>'',
"ClockReference"=>'',
"refreshTime"=>''
);
*/
//==========================================================
//输入变量
//==========================================================
//清除一个BTS的状态时,需传入的变量
if($DEBUG) echo "<br>actMode=$actMode";
if($DEBUG) echo "<br>sysTypeNo=$sysTypeNo";
if($DEBUG) echo "<br>sysNo=$sysNo";
if($DEBUG) echo "<br>subSysNo=$subSysNo";
//==========================================================
//数据处理
//==========================================================
//清除一个BTS的状态
if($actMode == 'clear'){
$clrSql="DELETE FROM sysStat
WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='($subSysNo-1)'
";
if($DEBUG) echo "<br>clrSql=$clrSql";
mysqli_query($pubConn,$clrSql);
echo mysqli_error($pubConn);
}
$listSql = "SELECT a.bssid,a.ip,b.Label as name,a.connected FROM BssOmcDb.OMCR_BSSTABLE as a, BssOmcDb.OMCR_BssFunc as b" .
" WHERE a.ip!='' AND a.bssid=b.bssid ORDER BY bssid";
if($DEBUG) echo "<br>listSql = $listSql<br>";
$listResult = mysqli_query($pubConn,$listSql);
$i=0;
while($listRows=@mysqli_fetch_array($listResult)){
//get installed bsc id, alias,updateTime form sysInfo table
$updateTimeSql = "SELECT updateTime FROM sysStat
WHERE sysTypeNo='$bscSysTypeNo'
AND sysNo='$listRows[bssid]'
";
if($DEBUG)
echo "<br>updateTimeSql = $updateTimeSql";
$result = mysqli_query($pubConn,$updateTimeSql);
echo mysqli_error($pubConn);
//if(mysqli_num_rows($result) <= 0){
// echo "<br>$strNotFoundAnyBSC";
// exit();
//}
$rows = mysqli_fetch_array($result);
$bscInfo[$i][bscId]=$listRows[bssid];
$bscInfo[$i][refreshTime]=$rows[updateTime];
if($DEBUG) echo "<br>===================";
if($DEBUG) echo "<br>bscInfo[$i][bscId]={$bscInfo[$i][bscId]}";
if($DEBUG) echo "<br>bscInfo[$i][refreshTime]={$bscInfo[$i][refreshTime]}";
$i++;
}
$bscNum = $i;
if($DEBUG)
echo "<br>bscNum=$bscNum";
$j = 0;
/*
//get installed BTS's
for($i=0;$i<$bscNum;$i++){
$bscId=$bscInfo[$i][bscId];
//Bts refreshTime
$Bts_sql="SELECT subSysNo,updateTime
FROM sysStat
WHERE sysTypeNo='$btsSysTypeNo' AND sysNo='$bscId'
";
if($DEBUG) echo "<br><br>Bts_sql = $Bts_sql";
$result = mysqli_query($pubConn,$Bts_sql);
echo mysqli_error($pubConn);
$k=0;
while($rows = mysqli_fetch_array($result)){
$refreshTimeArr[$k][btsId]=$rows[subSysNo] + 1;
$refreshTimeArr[$k][refreshTime]=$rows[updateTime];
$k++;
}
//Bts status --> Bts.$btsId.0
$ObjectId = "Bts.".$btsId.".0";
//echo "<br>ObjectId=$ObjectId";
$Bts_sql="SELECT ObjectId
FROM OMCR_BSSTREE
WHERE bssid = '$bscId' AND ObjectId like 'Bts.%.0' AND Presence > '0'
";
//if($DEBUG)
echo "<br><br>Bts_sql = $Bts_sql";
$result = mysqli_query($pubConn,$Bts_sql);
echo mysqli_error($pubConn);
while($rows = mysqli_fetch_array($result)){
$btsInfo[$j][bscId]=$bscId;
$tmpObjArr=explode('.',$rows[ObjectId]);
$tmpBtsId=$tmpObjArr[1];
$btsInfo[$j][btsId]=$tmpBtsId;
for($k=0;$k<sizeof($refreshTimeArr);$k++){
if($refreshTimeArr[$k][btsId] == $tmpBtsId){
$btsInfo[$j][refreshTime]=$refreshTimeArr[$k][refreshTime];
break;
}
if($k == (sizeof($refreshTimeArr) - 1)){
$btsInfo[$j][refreshTime]=$bscInfo[$i][refreshTime];
}
}
if($DEBUG) echo "<br>===================";
if($DEBUG) echo "<br>btsInfo[$j][bscId]={$btsInfo[$j][bscId]}";
if($DEBUG) echo "<br>btsInfo[$j][btsId]={$btsInfo[$j][btsId]}";
if($DEBUG) echo "<br>btsInfo[$j][refreshTime]={$btsInfo[$j][refreshTime]}";
$j++;
}
}
*/
//get installed BTS's
$j=0;
for($i=0;$i<$bscNum;$i++){
$bscId=$bscInfo[$i][bscId];
$Bts_sql="SELECT subSysNo,updateTime
FROM sysStat
WHERE sysTypeNo='$btsSysTypeNo' AND sysNo='$bscId'
";
if($DEBUG) echo "<br><br>Bts_sql = $Bts_sql";
$result = mysqli_query($pubConn,$Bts_sql);
echo mysqli_error($pubConn);
while($rows = mysqli_fetch_array($result)){
$btsInfo[$j][bscId]=$bscId;
$btsInfo[$j][btsId]=$rows[subSysNo];
$btsInfo[$j][refreshTime]=$rows[updateTime];
if($DEBUG) echo "<br>===================";
if($DEBUG) echo "<br>btsInfo[$j][bscId]={$btsInfo[$j][bscId]}";
if($DEBUG) echo "<br>btsInfo[$j][btsId]={$btsInfo[$j][btsId]}";
if($DEBUG) echo "<br>btsInfo[$j][refreshTime]={$btsInfo[$j][refreshTime]}";
$j++;
}
}
$btsNum=$j;
if($DEBUG) echo "<br>btsNum=$btsNum";
for($j=0;$j<$btsNum;$j++){
$bscId=$btsInfo[$j][bscId];
$btsId=$btsInfo[$j][btsId];
//Bts status --> Bts.$btsId.0
$ObjectId = "Bts.".$btsId.".0";
$Bts_sql="SELECT t1.AdminState,t1.OperState,t1.AvailStatus,t1.UsageState,t2.Presence,t1.Label
FROM OMCR_Bts as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId'
AND t1.ObjectId = '$ObjectId' AND t2.ObjectId = '$ObjectId'
";
if($DEBUG)
echo "<br><br>Bts_sql = $Bts_sql";
$result = mysqli_query($pubConn,$Bts_sql);
echo mysqli_error($pubConn);
$rows = mysqli_fetch_array($result);
$btsInfo[$j][status] = $AvailState[$rows[AvailStatus]];
$btsInfo[$j][statusColor] = $AvailStateColor[$rows[AvailStatus]];
$btsInfo[$j][name] = $rows[Label];
//clock module->BtsMgr_Shelf_Card.$btsId.0.10
$ObjectId = "BtsMgr_Shelf_Card.".$btsId.".0.17";
$clock_module_sql = "SELECT t1.CurrentOperationalState,t1.CurrentClockReference,t2.Presence
FROM OMCR_ClockMod as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId'
AND t1.ObjectId = '$ObjectId' AND t1.ObjectId = t2.ObjectId
";
if($DEBUG) echo "<br><br>clock_module_sql = $clock_module_sql";
$result = mysqli_query($pubConn,$clock_module_sql);
echo mysqli_error($pubConn);
if(mysqli_num_rows($result) > 0){
$rows = mysqli_fetch_array($result);
$btsInfo[$j][ClockOperStat] = $ClockOperState[$rows[CurrentOperationalState]];
$btsInfo[$j][ClockReference]= $ClockReference[$rows[CurrentClockReference]];
}else{
$btsInfo[$j][ClockOperStat] = '--';
$btsInfo[$j][ClockReference]= '--';
}
//get Abis status -> AbisMgr.$btsId.0
$ObjectId = "AbisMgr.".$btsId.".0";
$Abis_sql="SELECT t1.AvailStatus,t1.UsageState,t1.e1Slot,t1.e1Port,t1.e1Chan,t2.Presence
FROM OMCR_AbisMgr as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId'
AND t1.ObjectId = '$ObjectId' AND t1.ObjectId = t2.ObjectId
";
if($DEBUG) echo "<br><br>Abis_sql = $Abis_sql";
$result = mysqli_query($pubConn,$Abis_sql);
echo mysqli_error($pubConn);
$rows = mysqli_fetch_array($result);
if($rows[Presence] > 0){
$btsInfo[$j][AbisStatus] = $AvailState[$rows[AvailStatus]];
$btsInfo[$j][AbisStatusColor] = $AvailStateColor[$rows[AvailStatus]];
$btsInfo[$j][AbisSlot] = $rows[e1Slot];
$btsInfo[$j][AbisPort] = $rows[e1Port];
$btsInfo[$j][AbisChannel] = $rows[e1Chan];
}else{
$btsInfo[$j][AbisStatus] = '--';
$btsInfo[$j][AbisSlot] = '--';
$btsInfo[$j][AbisPort] = '--';
$btsInfo[$j][AbisChannel] = '--';
}
//TRX status --> Trx.bts_id.0.n
$ObjectId = "Trx.".$btsId.".0.%";
$Trx_sql="SELECT t1.ObjectId,t1.AvailStatus,t1.UsageState,t2.Presence
FROM OMCR_Trx as t1,OMCR_BSSTREE as t2
WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId'
AND t1.ObjectId like '$ObjectId' AND t1.ObjectId = t2.ObjectId
";
if($DEBUG) echo "<br><br>Trx_sql = $Trx_sql";
$result = mysqli_query($pubConn,$Trx_sql);
echo mysqli_error($pubConn);
while($rows = mysqli_fetch_array($result)){
$tmpStr=explode('.',$rows[ObjectId]);
$p=$tmpStr[3] - 0;
if($rows[Presence] > 0){
$btsInfo[$j]["Trx".$p."_stat"]=$AvailState[$rows[AvailStatus]];
}else{
$btsInfo[$j]["Trx".$p."_stat"]='--';
}
}
if($DEBUG) echo "<br>==============";
if($DEBUG) echo "<br>btsInfo[$j][bscId] ={$btsInfo[$j][bscId]}";
if($DEBUG) echo "<br>btsInfo[$j][btsId] ={$btsInfo[$j][btsId]}";
if($DEBUG) echo "<br>btsInfo[$j][name] ={$btsInfo[$j][name]}";
if($DEBUG) echo "<br>btsInfo[$j][status] ={$btsInfo[$j][status]}";
if($DEBUG) echo "<br>btsInfo[$j][AbisStatus]={$btsInfo[$j][AbisStatus]}";
if($DEBUG) echo "<br>btsInfo[$j][AbisSlot] ={$btsInfo[$j][AbisSlot]}";
if($DEBUG) echo "<br>btsInfo[$j][AbisPort] ={$btsInfo[$j][AbisPort]}";
if($DEBUG) echo "<br>btsInfo[$j][AbisChannel]={$btsInfo[$j][AbisChannel]}";
if($DEBUG) echo "<br>btsInfo[$j][Trx2_stat] ={$btsInfo[$j][Trx2_stat]}";
if($DEBUG) echo "<br>btsInfo[$j][Trx4_stat] ={$btsInfo[$j][Trx4_stat]}";
if($DEBUG) echo "<br>btsInfo[$j][Trx6_stat] ={$btsInfo[$j][Trx6_stat]}";
if($DEBUG) echo "<br>btsInfo[$j][ClockOperStat] ={$btsInfo[$j][ClockOperStat]}";
if($DEBUG) echo "<br>btsInfo[$j][ClockReference]={$btsInfo[$j][ClockReference]}";
if($DEBUG) echo "<br>btsInfo[$j][refreshTime] ={$btsInfo[$j][refreshTime]}";
}
//==========================================================
//输出并显示数据
//==========================================================
?>
<BODY topmargin="5" leftmargin="12">
<?php
echo "<table boder=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strSysStatus > BTS";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<table border="0" width="100%">
<tr><td align="center">
<font size="2" color="#0000ff"><?php echo "BTS $strStatusInformation"; ?></font>
</td></tr>
</table>
<table border="1" width="100%" cellpadding="1" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr bgcolor="#E6E6E6">
<td rowspan="2"><?php echo "$strName"; ?></td>
<td align="center" colspan="2">ID</td>
<td align="center" colspan="4">ABIS</td>
<td align="center" colspan="1">BTS</td>
<td align="center" colspan="2"><?php echo "$strClock"; ?></td>
<td align="center" rowspan="2"><?php echo "$strRefreshTime"; ?></td>
</tr>
<tr bgcolor="#E6E6E6">
<td>BSC</td>
<td>BTS</td>
<td><?php echo "$strStatus"; ?></td>
<td><?php echo "$strSlot"; ?></td>
<td><?php echo "$strPort"; ?></td>
<td><?php echo "$strChannel"; ?></td>
<td><?php echo "$strStatus"; ?></td>
<!--<td>TRX2</td>
<td>TRX4</td>
<td>TRX6</td>-->
<td><?php echo "$strOperationMode"; ?></td>
<td><?php echo "$strReference"; ?></td>
</tr>
<?php
for($j=0;$j<$btsNum;$j++){
echo "<tr>";
$tmpBtsName=urldecode($btsInfo[$j][name]);
echo "<td>&nbsp;$tmpBtsName</td>";
echo "<td>{$btsInfo[$j][bscId]}</td>";
echo "<td>{$btsInfo[$j][btsId]}</td>";
echo "<td><font color=\"{$btsInfo[$j][AbisStatusColor]}\">&nbsp;{$btsInfo[$j][AbisStatus]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][AbisSlot]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][AbisPort]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][AbisChannel]}</font></td>";
echo "<td><font color=\"{$btsInfo[$j][statusColor]}\">&nbsp;{$btsInfo[$j][status]}</font></td>";
/*
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][Trx2_stat]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][Trx4_stat]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][Trx6_stat]}</font></td>";
*/
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][ClockOperStat]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][ClockReference]}</font></td>";
echo "<td><font color=\"#0000FF\">&nbsp;{$btsInfo[$j][refreshTime]}</font></td>";
echo "</tr>";
}
?>
<!--
<tr>
<td>00_00</td>
<td>NY BTS1</td>
<td><font color="#0000FF">Online</font></td>
<td><font color="#0000FF">1</font></td>
<td><font color="#0000FF">1</font></td>
<td><font color="#0000FF">16</font></td>
<td><font color="#FF0000">Fail</font></td>
<td><font color="#0000FF">--</font></td>
<td><font color="#0000FF">--</font></td>
<td><font color="#0000FF">OK</font></td>
<td><font color="#0000FF">Free Run</font></td>
<td><font color="#0000FF">--</font></td>
<td><font color="#FF0000">2003-01-23 16:39:04</font></td>
</tr>
-->
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="1">
<tr>
<td>
<?php echo $strRemark; ?>: &nbsp; &nbsp;
<font color=#0000FF>Y</font> = <?php echo $strNormal; ?>, &nbsp; &nbsp;
<font color=#FF0000>N</font> = <?php echo $strAbnormal; ?>,&nbsp; &nbsp;
-- = <?php echo $strUninstalled; ?>.
</td>
<td align="right">
<?php
echo "<a href=\"../networkStatus/mapStatus.php?showingPageType=$src_page_type&pageNum=$src_page_num\" target=\"contents\">";
echo "<img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">";
echo "$strBack</a>";
?>
</td>
</tr>
</table>
<?php
//==========================================================
//发送NMI命令,读出数据,更新数据库
//==========================================================
for($j=0;$j<$btsNum;$j++){
$btsId=$btsInfo[$j][btsId];
//nmi命令定义数组,在显示信息之后,需要发送命令来更新数据库
$BtsOid = 'Bts.'.$btsId.'.0';
$ClockModuleOid = 'BtsMgr_Shelf_Card.'.$btsId.'.0.10';
$AbisOid = 'AbisMgr.'.$btsId.'.0';
$Trx2Oid = 'Trx.'.$btsId.'.0.2';
$Trx4Oid = 'Trx.'.$btsId.'.0.4';
$Trx6Oid = 'Trx.'.$btsId.'.0.6';
/*
$nmiCommArr = array(
array('oid '.$BtsOid,'get','0'),
array('oid '.$ClockModuleOid,'get','0'),
array('oid '.$AbisOid,'get','0'),
array('oid '.$Trx2Oid,'get','0'),
array('oid '.$Trx4Oid,'get','0'),
array('oid '.$Trx6Oid,'get','0')
);
*/
$nmiCommArr = array(
array('oid '.$BtsOid,'get','0'),
array('oid '.$ClockModuleOid,'get','0'),
array('oid '.$AbisOid,'get','0')
);
for($i=0;$i<sizeof($nmiCommArr);$i++){
$nmi_command = $nmiCommArr[$i][0];
$Oid_sql = "REPLACE INTO OMCR_COMMAND
VALUES('$bgn_row_num','{$btsInfo[$j][bscId]}','$nmi_command',null,'255','-1',null,null,null)";
if($DEBUG)
echo "<br>set Oid_sql = $Oid_sql";
$result = mysqli_query($pubConn,$Oid_sql);
echo mysqli_error($pubConn);
$bgn_row_num++;
$nmi_command = $nmiCommArr[$i][1];
$Command_sql = "REPLACE INTO OMCR_COMMAND
VALUES('$bgn_row_num','{$btsInfo[$j][bscId]}','$nmi_command',null,'255','-1',null,null,null)";
if($DEBUG)
echo "<br>Commnad_sql = $Command_sql";
$result = mysqli_query($pubConn,$Command_sql);
echo mysqli_error($pubConn);
$bgn_row_num++;
}
}
?>
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
# This file conf the total plat definition
PlatSysTypeNo=200
[0]
PlatformName="EMS"
PlatformID=0
PlatformNo=2
[8]
PlatformName="VSS"
PlatformID=8
PlatformNo=10
[9]
PlatformName="MSS"
PlatformID=9
PlatformNo=2
[18]
PlatformName="RCM"
PlatformID=18
PlatformNo=2
+385
View File
@@ -0,0 +1,385 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strSysStatus > Platform";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
foreach($config as $key => $val)
{
if($config[$key][PlatformID] == $platID)
{
$thisconfig=$config[$key];
break;
}
}
$tmpconf[PlatNo]=$platID;
$plat=GetPlatInfo($tmpconf,$subSysNo);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
echo "<br><center><font color=\"blue\">{$thisconfig[PlatformName]}_$subSysNo platform information</font></center>";
echo "<table width=100% border=1 cellpadding=1 cellspacing=0 bordercolor=#666666 bordercolordark=#FFFFFF bgcolor=\"#ffffff\">";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Status</td>";
echo "<td>";
//platform Status
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Refresh Time</td>";
echo "<td>";
//Refresh Time
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Start Time</td>";
echo "<td>";
//Start Time
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>CPU Usage</td>";
echo "<td>";
//CPU Usage PN
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
//CPU Usage Rate
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Physical Memory</td>";
echo "<td>";
//Physical Memory Used/Total
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
echo "(Used/Total)";
echo "<br>";
//Physical Memory Used/Swap
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
echo "(Used/Swap)";
echo "<br>";
$id=AssignID();
echo "Buffers:";
echo "&nbsp;";
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo ";&nbsp;";
$id=AssignID();
echo "Cached:";
echo "&nbsp;";
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "<br>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Harddisk Space</td>";
echo "<td>";
//Harddisk, support 16 harddisk
for($i=0;$i<16;$i++)
{
$id=AssignID();
if($i==0)
echo "<span id=\"{$id}\">";
else
echo "<span id=\"{$id}\" style=\"display:none;\">";
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "<br>";
echo "</span>";
}
echo "</td>";
echo "</tr>";
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(platID,subSysNo)
{
var fixurl="./plat_status_detail_update.php?platID="+platID+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+platID+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
function GetLabel(pn)
{
switch(pn)
{
case '0':
case 0:
return '';
case '1':
case 1:
return '??';
case '2':
case 2:
return '????';
case '3':
case 3:
return '??????';
case '4':
case 4:
return '????????';
case '5':
case 5:
return '??????????';
case '6':
case 6:
return '????????????';
case '7':
case 7:
return '??????????????';
case '8':
case 8:
return '????????????????';
case '9':
case 9:
return '??????????????????';
case '10':
case 10:
return '????????????????????';
}
return '';
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$platID','$subSysNo');\n";
echo "</script>\n";
?>
+181
View File
@@ -0,0 +1,181 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
foreach($config as $key => $val)
{
if($config[$key][PlatformID] == $platID)
{
$thisconfig=$config[$key];
break;
}
}
$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo ";
//echo "$sql<br>";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
exit();
$tmpconf[PlatNo]=$platID;
$plat=GetPlatInfo($tmpconf,$subSysNo);
//platform Status
$id=AssignID();
$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo ";
//echo "$sql<br>";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num != 1)
{
$baseStat=0;
}
else
{
$row=@mysqli_fetch_array($res);
$baseStat=$row[baseStat]+0;
}
$refresh_time=$row[updateTime];
$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y")));
$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y")));
if($refresh_time < $due_date || $refresh_time > $ove_date)
{
$valid_time=0;
}
else
{
$valid_time=1;
}
if($valid_time == 0 || $baseStat == 0)
$total_response.="$id,block,N,#ff0000;";
else
$total_response.="$id,block,Y,#0000ff;";
//Refresh Time
$id=AssignID();
if($valid_time)
$total_response.="$id,block,$refresh_time,#0000ff;";
else
$total_response.="$id,block,$refresh_time,#ff0000;";
//Start Time
$id=AssignID();
if(trim($plat[StartTime][Value]) == "")
$total_response.="$id,block,--,#000000;";
else
$total_response.="$id,block,{$plat[StartTime][Value]},#0000ff;";
//CPU Usage PN
$id=AssignID();
$message="{$id},{$plat[CPURatePN][Display]},{$plat[CPURatePN][Value]},{$plat[CPURatePN][Color]};";
$total_response.=$message;
//CPU Usage
$id=AssignID();
$message="{$id},{$plat[CPURate][Display]},{$plat[CPURate][Value]},{$plat[CPURate][Color]};";
$total_response.=$message;
//Physical Memory
$id=AssignID();
$message="{$id},{$plat[PMTotalRatePN][Display]},{$plat[PMTotalRatePN][Value]},{$plat[PMTotalRatePN][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMTotalRate][Display]},{$plat[PMTotalRate][Value]},{$plat[PMTotalRate][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMTotalRateV][Display]},{$plat[PMTotalRateV][Value]},{$plat[PMTotalRateV][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMSwapRatePN][Display]},{$plat[PMSwapRatePN][Value]},{$plat[PMSwapRatePN][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMSwapRate][Display]},{$plat[PMSwapRate][Value]},{$plat[PMSwapRate][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMSwapRateV][Display]},{$plat[PMSwapRateV][Value]},{$plat[PMSwapRateV][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMBuffers][Display]},{$plat[PMBuffers][Value]},{$plat[PMBuffers][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMCached][Display]},{$plat[PMCached][Value]},{$plat[PMCached][Color]};";
$total_response.=$message;
//Harddisk
for($i=0;$i<16;$i++)
{
if($i<$plat[HDNum])
{
$id=AssignID();
$message="{$id},layerShow,no,no;";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][PN][Display]},{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][Rate][Display]},{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][V][Display]},{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][Path][Display]},{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};";
$total_response.=$message;
}
else
{
$id=AssignID();
$message="{$id},layerHide,no,no;";
$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};";
//$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};";
//$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};";
//$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};";
//$total_response.=$message;
}
}
echo "$total_response";
?>
+763
View File
@@ -0,0 +1,763 @@
<?php
/*********************************************************
Create:
Function: CSU status
Invoke: header.inc
Author: Li Long
Date: 2004-5-27
Modification:
[No.1]
Name£ºCui Ticun
Time£º2005-5-20
Description£ºAdd the HWaddr of E1 card
*********************************************************/
require("../../inc/header.inc");
$helpId = "1.2.1";
?>
<script LANGUAGE="JavaScript">
function get_fresh(flag){
var base_url,url,y;
base_url='<?php echo "$PHP_SELF?sys_id=$sys_id&backpage=$backpage";?>';
x = document.body.scrollLeft;
y = document.body.scrollTop;
url=base_url+'&scroll_y='+y;
if(flag) {
window.location=url;
}
Timer = setTimeout("get_fresh(1)",10000);
}
</script>
<?php
if($scroll_y > 0){
echo "<body topmargin=\"5\" leftmargin=\"12\" onLoad='get_fresh(0);self.scrollBy(0,$scroll_y)'>";
}else{
echo "<body topmargin=\"5\" leftmargin=\"12\" onLoad='get_fresh(0);'>";
}
$DEBUG = 0;
$db = $omc_db;
$dueDate = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y")));
//==test
//echo "heatbeat_overtime:$heatbeat_overtime<br>";
//$url_temp=$_SERVER["REQUEST_URI"];
//echo "This page URL:$url_temp<br>";
//echo "backpage:$backpage<br>";
/******************************8KE1 status*************************/
$sysTypeNo_1 = 150;
$sysType = "8KE1";
$sysTypeNo = omc_sys_type2code($sysType);
$sysNo = omc_sys_id_info($sys_id,sys_num);
$subSysNo = omc_sys_id_info($sys_id,subsys_num);
$sysId = $sysType."_".$sysNo."_".$subSysNo;
$sysTypeNo_2= 112;
//begin bit
$ver_bgn = 18; //version
$typ_bgn = 21; //subsys type
$ins_bgn = 22; //e1 installed
$inl_bgn = 23; //e1 layer2 installed
$phy_bgn = 24; //e1 layer1(physical layer)
$tra_bgn = 25; //e1 layer2(transport layer)
$can_bgn = 26; //echo canceller status
$cpu_bgn = 27; //cpu loading
$loc_bgn = 28; //lock status
$fre_bgn = 29; //frequency
$pow_bgn = 30; //power card and master clock
$pra_bgn = 31; //E1 FRAMER status
$ch_bgn = 31;
$att_bgn = 39;
$HWaddr_bgn = 17;
//subsys type
$arrayType=array(
array('num' => '0', 'remark' => 'SS7', 'color' => '#0000FF'),
array('num' => '1', 'remark' => 'ISDN', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'PCR', 'color' => '#0000FF')
);
//e1 install
$arrayIns=array(
array('num' => '0', 'remark' => '--', 'color' => '#000000'),
array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF')
);
//e1 layer1
$arrayPhy=array(
array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'),
array('num' => '1', 'remark' => 'N', 'color' => '#FF0000'),
array('num' => '2', 'remark' => '--', 'color' => '#000000')
);
//e1 layer2
$arrayTra=array(
array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'),
array('num' => '2', 'remark' => '--', 'color' => '#000000')
);
//echo canceller status
$arrayCan=array(
array('num' => '0', 'remark' => '--', 'color' => '#000000'),
array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF')
);
//lock status
$arrayLock=array(
array('num' => '0', 'remark' => 'Init', 'color' => '#0000FF'),
array('num' => '1', 'remark' => 'Search', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'Locked', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'Threshold', 'color' => '#0000FF'),
array('num' => '4', 'remark' => 'Adjust', 'color' => '#0000FF'),
array('num' => '5', 'remark' => 'Hold over', 'color' => '#0000FF'),
array('num' => '6', 'remark' => 'Stop At 0ppm', 'color' => '#0000FF'),
array('num' => '7', 'remark' => 'Idle', 'color' => '#0000FF')
);
//master clock
$arrayMaster=array(
array('num' => '0', 'remark' => 'Slave', 'color' => '#0000FF'),
array('num' => '1', 'remark' => 'Master', 'color' => '#0000FF')
);
if($clear){
$delSql = " Delete FROM OMC_PUB.sysStat
WHERE
(sysTypeNo='$sysTypeNo' OR sysTypeNo='$sysTypeNo_1') AND (sysNo='0' OR sysNo='1')
";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
$delSql = " Delete FROM OMC_PUB.sysStat
WHERE
sysTypeNo='$sysTypeNo_2'
";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
$delSql = " Delete FROM OMC_PUB.sysInfo where sysTypeNo!='500'";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
}
$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE
(sysTypeNo='$sysTypeNo' OR sysTypeNo='$sysTypeNo_1') AND (sysNo='0' OR sysNo='1')
";
if($DEBUG)
echo "<br>selSql=$selSql";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do{
$sysTypeNo = $selRow[sysTypeNo];
$sysNo = $selRow[sysNo];
$subSysNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
if(!$selRow)
break;
if($selRow)
$showArr[$sysNo][$subSysNo] = 1;
$refreshTime[$sysNo][$subSysNo][0] = $selRow[updateTime];
if($refreshTime[$sysNo][$subSysNo][0] > $dueDate){
$refreshTime[$sysNo][$subSysNo][1] = "#0000FF";
}else{
$refreshTime[$sysNo][$subSysNo][1] = "#FF0000";
$noBasicStatus[$sysNo][$subSysNo]=1;
}
$bin_mes='';
for($i=0;$i<strlen($hex_mes);$i++){
$sig_hex_mes=substr($hex_mes,$i,1);
$sig_dec_mes=HexDec($sig_hex_mes);
$sig_bin_mes=DecBin($sig_dec_mes);
$sig_bin_mes=omc_keep_length($sig_bin_mes,0,4);
$bin_mes.=$sig_bin_mes;
}
if($DEBUG)echo "<br>bin_mes=$bin_mes";
//version
$bin_ver_0=substr($bin_mes,$ver_bgn*8,8);
$dec_ver_0=BinDec($bin_ver_0);
$bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8);
$dec_ver_1=BinDec($bin_ver_1);
$dec_ver_1=omc_keep_length($dec_ver_1,0,2);
$bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8);
$dec_ver_2=BinDec($bin_ver_2);
$dec_ver_2=omc_keep_length($dec_ver_2,0,2);
$versionArr[$sysNo][$subSysNo][0] = $version = $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2;
$versionArr[$sysNo][$subSysNo][1] = $color_version = "#0000FF";
$verNum[$sysNo] = $subSysNo;
//echo "version:$version<hr>";
if($DEBUG) echo "<br>verNum[$sysNo]=$verNum[$sysNo]";
if($DEBUG)
echo "<br>versionArr[$sysNo][$subSysNo][0]={$versionArr[$sysNo][$subSysNo][0]}";
//subsys type
$bin_typ = substr($bin_mes,$typ_bgn*8,8);
$subTypeArr[$sysNo][$subSysNo][0] = $dec_typ = BinDec($bin_typ);
if($DEBUG) echo "<br>subTypeArr[$sysNo][$subSysNo][0] = {$subTypeArr[$sysNo][$subSysNo][0]}";
//e1 install
for($i=0;$i<8;$i++){
$bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1);
$eInstallArr[$sysNo][$subSysNo][$i]=BinDec($bin_ins);
if($DEBUG)
echo "<br>eInstallArr[$sysNo][$subSysNo][$i]={$eInstallArr[$sysNo][$subSysNo][$i]}";
}
//e1 layer2 install
for($i=0;$i<8;$i++)
{
$bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1);
$eL2InsArr[$sysNo][$subSysNo][$i]=BinDec($bin_inl);
if($DEBUG)
echo "<br>eL2InsArr[$sysNo][$subSysNo][$i]={$eL2InsArr[$sysNo][$subSysNo][$i]}";
}
//e1 layer1
for($i=0;$i<8;$i++){
$bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1);
$eL1StatusArr[$sysNo][$subSysNo][$i] = BinDec($bin_phy);
if($DEBUG)
echo "<br>eL1StatusArr[$sysNo][$subSysNo][$i]={$eL1StatusArr[$sysNo][$subSysNo][$i]}";
if($eInstallArr[$sysNo][$subSysNo][$i] == 0){
$eL1StatusArr[$sysNo][$subSysNo][$i]=2;
}
if($eL1StatusArr[$sysNo][$subSysNo][$i] == 1){
$noBasicStatus[$sysNo][$subSysNo]=1;
}
}
//e1 layer2
for($i=0;$i<8;$i++) {
$bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1);
$eL2StatusArr[$sysNo][$subSysNo][$i]=BinDec($bin_tra);
if($eInstallArr[$sysNo][$subSysNo][$i] == 0 || $eL2InsArr[$sysNo][$subSysNo][$i] == 0){
$eL2StatusArr[$sysNo][$subSysNo][$i]=2;
}
if($DEBUG)
echo "<br>eL2StatusArr[$sysNo][$subSysNo][$i]={$eL2StatusArr[$sysNo][$subSysNo][$i]}";
if($eL2StatusArr[$sysNo][$subSysNo][$i] == 0){
$noBasicStatus[$sysNo][$subSysNo]=1;
}
}
//echo canceller status
for($i=0;$i<8;$i++){
$bin_can=substr($bin_mes,$can_bgn*8+7-$i,1);
$canStatusArr[$sysNo][$subSysNo][$i]=BinDec($bin_can);
if($eInstallArr[$sysNo][$subSysNo][$i] == 0){
$canStatusArr[$sysNo][$subSysNo][$i] = 0;
}
if($DEBUG) echo "<br>canStatusArr[$sysNo][$subSysNo][$i]={$canStatusArr[$sysNo][$subSysNo][$i]}";
}
//cpu loading
$bin_cpu=substr($bin_mes,$cpu_bgn*8,8);
$dec_cpu=BinDec($bin_cpu);
if($DEBUG) echo "<br>dec_cpu=$dec_cpu";
$cpu_load=change2point($dec_cpu/126);
if($cpu_load>100){
$cpu_load=100;
}
elseif($cpu_load<0){
$cpu_load=0;
}
if($DEBUG) echo "<br>cpu_load=$cpu_load";
if($cpu_load>90){
$noBasicStatus[$sysNo][$subSysNo] = 1;
$cpuLoadArr[$sysNo][$subSysNo][1] = "#FF0000";
}else{
$cpuLoadArr[$sysNo][$subSysNo][1] = "#0000FF";
}
$cpuLoadArr[$sysNo][$subSysNo][0] = $cpu_load."%";
$bin_loc = substr($bin_mes,$loc_bgn*8,8);
$lockStatusArr[$sysNo][$subSysNo] = BinDec($bin_loc);
if($DEBUG) echo "<br>lockStatusArr[$sysNo][$subSysNo]={$lockStatusArr[$sysNo][$subSysNo]}";
//frequency
$bin_fre=substr($bin_mes,$fre_bgn*8,8);
$dec_fre=BinDec($bin_fre);
$freqArr[$sysNo][$subSysNo][0] = omc_keep_length($dec_fre,0,3);
if($dec_loc==7){
$freqArr[$sysNo][$subSysNo][0] = '--';
$freqArr[$sysNo][$subSysNo][1] = "#000000";
}else{
$freqArr[$sysNo][$subSysNo][1] = "#0000FF";
}
if($DEBUG) echo "<br>freqArr[$sysNo][$subSysNo][0]={$freqArr[$sysNo][$subSysNo][0]}";
//master clock
//echo "bin_mes:$bin_mes<br>";
$bin_mas = substr($bin_mes,$pow_bgn*8+7,1);
$masClockArr[$sysNo][$subSysNo] = BinDec($bin_mas);
if($DEBUG) echo "<br>masClockArr[$sysNo][$subSysNo]=$masClockArr[$sysNo][$subSysNo]";
if($sysTypeNo == '150')
{
$pcrcArr[$sysNo][$subSysNo] = 1;
$chNum = $subSysNo*8;
for($i=0;$i<8;$i++)
{
$chArr[$sysNo][$chNum+$i] = HexDec(substr($hex_mes,($ch_bgn+$i)*2,2));
if($DEBUG) echo "<br>chArr[$sysNo][$chNum+$i]={$chArr[$sysNo][$chNum+$i]}";
$attArr[$sysNo][$chNum+$i] = HexDec(substr($hex_mes,($att_bgn+$i)*2,2));
if($DEBUG) echo "<br>attArr[$sysNo][$chNum+$i]={$attArr[$sysNo][$chNum+$i]}";
}
}
}while($selRow = @mysqli_fetch_array($selRes));
$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE
sysTypeNo='$sysTypeNo_2'
";
if($DEBUG)
echo "<br>selSql=$selSql";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do{
$sysTypeNo = $selRow[sysTypeNo];
$sysNo = $selRow[sysNo];
$subSysNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
if(!$selRow)
break;
if($selRow)
$HWaddrArr[$sysNo][$subSysNo] = substr($hex_mes,$HWaddr_bgn*2,12);
}while($selRow = @mysqli_fetch_array($selRes));
/******************************MSC status*************************/
$sysType = $DEFAULT_SYS;
$sysTypeNo = omc_sys_type2code($sysType);
$sysNo = omc_sys_id_info($sysId,sys_num);
$subSysNo = omc_sys_id_info($sysId,subsys_num);
$sysId = $sysType."_".$sysNo."_".$subSysNo;
$array_main_server_status=array(
array('num'=> '0','remark' => $strNormal, 'color' => '#0000FF'),
array('num'=> '1','remark' => $strRestart, 'color' => '#0000FF'),
array('num'=> '2','remark' => $strInitialize, 'color' => '#0000FF'),
array('num'=> '3','remark' => $strSuspend, 'color' => '#0000FF'),
array('num'=> '4','remark' => $strStop, 'color' => '#FF0000')
);
//E1 status
$arrayDefineStatus=array(
array('num'=> '0','remark' => 'TUP', 'color' => '#0000FF'),
array('num'=> '1','remark' => 'ISUP', 'color' => '#0000FF'),
array('num'=> '2','remark' => 'AIF', 'color' => '#0000FF'),
array('num'=> '3','remark' => 'ISDN NT', 'color' => '#0000FF'),
array('num'=> '4','remark' => 'ISDN LT', 'color' => '#0000FF'),
array('num'=> '5','remark' => 'CI-CNF', 'color' => '#0000FF'),
array('num'=> '6','remark' => 'CI-INT', 'color' => '#0000FF'),
array('num'=> '7','remark' => '--', 'color' => '#FF0000')
);
//begin bit
$msc_bgn_byt=19;
if($DEBUG)echo "<br>msc_len_dec=$msc_len_dec";
$selSql = " SELECT sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE
sysTypeNo='$sysTypeNo' AND (sysNo='0' OR sysNo='1')
";
if($DEBUG)
echo "<br>selSql=$selSql";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do
{
$sysNo = $selRow[sysNo];
$subSysNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
if(!$selRow)
break;
$bin_mes='';
for($i=0;$i<strlen($hex_mes);$i++){
$sig_hex_mes=substr($hex_mes,$i,1);
$sig_dec_mes=HexDec($sig_hex_mes);
$sig_bin_mes=DecBin($sig_dec_mes);
$sig_bin_mes=omc_keep_length($sig_bin_mes,0,4);
$bin_mes.=$sig_bin_mes;
}
if($DEBUG)echo "<br>bin_mes=$bin_mes";
//Field01(3bytes,18-20):Version Information
$version_0=substr($hex_mes,($msc_bgn_byt+1)*2,2);
$version_1=substr($hex_mes,($msc_bgn_byt+2)*2,2);
$version_1=omc_keep_length($version_1,0,2);
$version_2=substr($hex_mes,($msc_bgn_byt+3)*2,2);
$version_2=omc_keep_length($version_2,0,2);
$mscVersionArr[$sysNo][$subSysNo]=$version_0.".".$version_1.".".$version_2;
if($DEBUG)
echo "<br>mscVersionArr[$sysNo][$subSysNo]={$mscVersionArr[$sysNo][$subSysNo]}";
//main server status£¨0/1/2/3/4=normal/restart/initialize/suspend/stop£©
$hex_main_server_status=substr($hex_mes,($msc_bgn_byt+4)*2,2);
$serStatArr[$sysNo][$subSysNo] = HexDec($hex_main_server_status);
if($DEBUG)echo "<br>serStatArr[$sysNo][$subSysNo]={$serStatArr[$sysNo][$subSysNo]}";
for($i=0;$i<128;$i++)
{
if($DEBUG)echo "<br>i=$i";
$BinStatus=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8,3);
$DecStatus=BinDec($BinStatus);
if($DEBUG)echo "<br>DecStatus=$DecStatus";
$BinAttribute=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8+3,5);
$DecAttribute=BinDec($BinAttribute);
if($DEBUG)echo "<br>DecAttribute=$DecAttribute";
$arrayDefineE1[$sysNo][$subSysNo][$i][0]=$arrayDefineStatus[$DecStatus][remark];
$arrayDefineE1[$sysNo][$subSysNo][$i][1]=$arrayDefineStatus[$DecStatus][color];
if($arrayDefineE1[$sysNo][$subSysNo][$i][0]=='--'){
$arrayDefineE1[$sysNo][$subSysNo][$i][2]='--';
$arrayDefineE1[$sysNo][$subSysNo][$i][3]='#000000';
}else{
$arrayDefineE1[$sysNo][$subSysNo][$i][2]=$DecAttribute;
$arrayDefineE1[$sysNo][$subSysNo][$i][3]='#0000FF';
}
if($DEBUG) echo "<br>arrayDefineE1[$sysNo][$subSysNo][$i][0]={$arrayDefineE1[$sysNo][$subSysNo][$i][0]}";
if($DEBUG) echo "<br>arrayDefineE1[$sysNo][$subSysNo][$i][2]={$arrayDefineE1[$sysNo][$subSysNo][$i][2]}";
}
}while($selRow = @mysqli_fetch_array($selRes));
?>
<base target="contents">
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
if($backpage=='overview')
echo "Configuration > <a href=\"../../element/overview/overview.php\">Network</a> > $strServer";
else
echo "$strSysStatus > $strCentralOffice > MSC-CSC";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<table border=\"0\" width=100%>";
echo "<tr>";
echo "<td>";
echo "<td>";
if($backpage=='overview')
echo "<p align=\"right\"><a href=\"../../element/overview/overview.php\" target=\"contents\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
else
echo "<p align=\"right\"><a href=\"$returnRoute\" target=\"contents\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<a href=\"$PHP_SLEF?clear=1\" target=\"_self\"><img align=absBottom border=0 src=\"../../images/delete.gif\" width=\"14\" height=\"14\">$strClear</a>";
echo "</p>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<table border=\"0\" width=100%>";
echo "<tr>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">CSC0-8K E1/T1 Card $strStatusInfo</font></p></td>";
echo "<td width=2%>&nbsp;</td>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">CSC1-8K E1/T1 Card $strStatusInfo</font></p></td>";
echo "</tr>";
//<!-- START::show csc 0 and csc 1 main status -->
echo "<tr>";
//<!-- left CSC 0 status -->
echo "<td width=49% height=\"1\">";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=2%>ID</td>";
echo "<td width=5%>$strBasicStatus</td>";
echo "<td width=17%>$strRefreshTime</td>";
echo "<td width=9%>Clock/Sync</td>";
echo "<td width=7%>Version</td>";
echo "<td width=9%>HWaddr</td>";
echo "</tr>";
for($i=0;$i<16;$i++)
{
$showId = omc_keep_length($i,0,2);
echo "<tr><td>$showId</td>";
if($showArr[0][$i]){
echo "<td>";
if($noBasicStatus[0][$i])
echo "<font color=\"#FF0000\">N</font>";
else
echo "<font color=\"#0000FF\">Y</font>";
echo "</td>";
echo "<td>";
if($showArr[0][$i])
echo "<font color=\"{$refreshTime[0][$i][1]}\">{$refreshTime[0][$i][0]}</font>";
echo "</td>";
echo "<td>";
echo "<font color=\"{$arrayMaster[$masClockArr[0][$i]][color]}\">{$arrayMaster[$masClockArr[0][$i]][remark]}/{$arrayLock[$lockStatusArr[0][$i]][remark]}</font>";
echo "</td>";
echo "<td>";
echo "<font color=\"{$arrayLock[$lockStatusArr[0][$i]][color]}\">{$versionArr[0][$i][0]}</font>";
echo "</td>";
if($HWaddrArr[0][$i])
echo "<td><font color=\"#0000FF\">{$HWaddrArr[0][$i][0]}{$HWaddrArr[0][$i][1]}:{$HWaddrArr[0][$i][2]}{$HWaddrArr[0][$i][3]}:{$HWaddrArr[0][$i][4]}{$HWaddrArr[0][$i][5]}:{$HWaddrArr[0][$i][6]}{$HWaddrArr[0][$i][7]}:{$HWaddrArr[0][$i][8]}{$HWaddrArr[0][$i][9]}:{$HWaddrArr[0][$i][10]}{$HWaddrArr[0][$i][11]}</font></td>";
else
echo "<td>--</td>";
}else{
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</td>";
//<!-- Center space -->
echo "<td width=2%>&nbsp;</td>";
//<!-- Right CSC 1 status -->
echo "<td width=49% height=\"1\">";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=2%>ID</td>";
echo "<td width=5%>$strBasicStatus</td>";
echo "<td width=17%>$strRefreshTime</td>";
echo "<td width=9%>Clock/Sync</td>";
echo "<td width=7%>Version</td>";
echo "<td width=9%>HWaddr</td>";
echo "</tr>";
for($i=0;$i<16;$i++)
{
$showId = omc_keep_length($i,0,2);
echo "<tr><td>$showId</td>";
if($showArr[1][$i]){
echo "<td>";
if($noBasicStatus[1][$i])
echo "<font color=\"#FF0000\">N</font>";
else
echo "<font color=\"#0000FF\">Y</font>";
echo "</td>";
echo "<td>";
if($showArr[1][$i])
echo "<font color=\"{$refreshTime[1][$i][1]}\">{$refreshTime[1][$i][0]}</font>";
echo "</td>";
echo "<td>";
echo "<font color=\"{$arrayMaster[$masClockArr[1][$i]][color]}\">";
echo "{$arrayMaster[$masClockArr[1][$i]][remark]}/{$arrayLock[$lockStatusArr[1][$i]][remark]}</font>";
echo "</td>";
echo "<td>";
echo "<font color=\"{$arrayLock[$lockStatusArr[1][$i]][color]}\">{$versionArr[1][$i][0]}</font>";
echo "</td>";
if($HWaddrArr[1][$i])
echo "<td><font color=\"#0000FF\">{$HWaddrArr[1][$i][0]}{$HWaddrArr[1][$i][1]}:{$HWaddrArr[1][$i][2]}{$HWaddrArr[1][$i][3]}:{$HWaddrArr[1][$i][4]}{$HWaddrArr[1][$i][5]}:{$HWaddrArr[1][$i][6]}{$HWaddrArr[1][$i][7]}:{$HWaddrArr[1][$i][8]}{$HWaddrArr[1][$i][9]}:{$HWaddrArr[1][$i][10]}{$HWaddrArr[1][$i][11]}</font></td>";
else
echo "<td>--</td>";
}else{
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
//<!-- END::show csc 0 and csc 1 main status -->
echo "<tr>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">$strPane0Status</font></p></td>";
echo "<td width=2%>&nbsp;</td>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">$strPane1Status</font></td>";
echo "</tr>";
//<!-- START::show csc 0 and csc 1 e1 details -->
echo "<tr>";
//<!-- left CSC 0 details -->
echo "<td width=49%>";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
for($i=0;$i<128;$i++)
{
if($i % 8 == 0)
{
echo "<tr bgcolor=\"#C0C0C0\">";
echo "<td width=6%>Slot</td>";
echo "<td width=6%>Port</td>";
echo "<td width=6% title=\"Enable\">EN</td>";
echo "<td width=6% title=\"Physical layer\">L1</td>";
echo "<td width=6% title=\"Transport\">L2</td>";
echo "<td width=6% title=\"Echo canceller\">EC</td>";
echo "<td width=6% title=\"Channel\">CH</td>";
echo "<td width=7% title=\"Port type\">TY</td>";
echo "</tr>";
}
$slotNum = floor($i/8);
$portNum = $i%8;
echo "<tr>";
echo "<td>$slotNum</td>";
echo "<td>$portNum</td>";
if($showArr[0][$slotNum]){
echo "<td title=\"Enable\"><font color=\"{$arrayIns[$eInstallArr[0][$slotNum][$portNum]][color]}\">{$arrayIns[$eInstallArr[0][$slotNum][$portNum]][remark]}</font></td>";
echo "<td title=\"Physical layer\"><font color=\"{$arrayPhy[$eL1StatusArr[0][$slotNum][$portNum]][color]}\">{$arrayPhy[$eL1StatusArr[0][$slotNum][$portNum]][remark]}</font></td>";
echo "<td title=\"Physical layer\"><font color=\"{$arrayTra[$eL2StatusArr[0][$slotNum][$portNum]][color]}\">{$arrayTra[$eL2StatusArr[0][$slotNum][$portNum]][remark]}</font></td>";
echo "<td title=\"Physical layer\"><font color=\"{$arrayCan[$canStatusArr[0][$slotNum][$portNum]][color]}\">{$arrayCan[$canStatusArr[0][$slotNum][$portNum]][remark]}</font></td>";
//echo "<td title=\"Crc4\">--</td>";
if(strlen($chArr[0][$i]) > 0)
echo "<td title=\"Channel\"><font color=\"#0000FF\">{$chArr[0][$i]}</font></td>";
elseif(isset($arrayDefineE1[0][0][$i][2]))
echo "<td title=\"Channel\"><font color=\"{$arrayDefineE1[0][0][$i][3]}\">{$arrayDefineE1[0][0][$i][2]}</font></td>";
else
echo "<td>--</td>";
if($attArr[0][$i] < 7 && strlen($attArr[0][$i]) > 0)
echo "<td title=\"Port type\"><font color=\"{$arrayDefineStatus[$attArr[0][$i]][color]}\">{$arrayDefineStatus[$attArr[0][$i]][remark]}</font></td>";
elseif(isset($arrayDefineE1[0][0][$i][0]))
echo "<td title=\"Port type\"><font color=\"{$arrayDefineE1[0][0][$i][1]}\">{$arrayDefineE1[0][0][$i][0]}</font></td>";
else
echo "<td>--</td>";
}else{
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</td>";
//<!-- Central space -->
echo "<td width=2%></td>";
//<!-- Right CSC 1 status -->
echo "<td width=49%>";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
for($i=0;$i<128;$i++){
if($i % 8 == 0){
echo "<tr bgcolor=\"#C0C0C0\">";
echo "<td width=6%>Slot</td>";
echo "<td width=6%>Port</td>";
echo "<td width=6% title=\"Enable\">EN</td>";
echo "<td width=6% title=\"Physical layer\">L1</td>";
echo "<td width=6% title=\"Transport\">L2</td>";
echo "<td width=6% title=\"Echo canceller\">EC</td>";
echo "<td width=6% title=\"Channel\">CH</td>";
echo "<td width=7% title=\"Port type\">TY</td>";
echo "</tr>";
}
$slotNum = floor($i/8);
$portNum = $i%8;
echo "<tr>";
echo "<td>$slotNum</td>";
echo "<td>$portNum</td>";
if($showArr[1][$slotNum]){
echo "<td title=\"Enable\"><font color=\"{$arrayIns[$eInstallArr[1][$slotNum][$portNum]][color]}\">{$arrayIns[$eInstallArr[1][$slotNum][$portNum]][remark]}</font></td>";
echo "<td title=\"Physical layer\"><font color=\"{$arrayPhy[$eL1StatusArr[1][$slotNum][$portNum]][color]}\">{$arrayPhy[$eL1StatusArr[1][$slotNum][$portNum]][remark]}</font></td>";
echo "<td title=\"Physical layer\"><font color=\"{$arrayTra[$eL2StatusArr[1][$slotNum][$portNum]][color]}\">{$arrayTra[$eL2StatusArr[1][$slotNum][$portNum]][remark]}</font></td>";
echo "<td title=\"Physical layer\"><font color=\"{$arrayCan[$canStatusArr[1][$slotNum][$portNum]][color]}\">{$arrayCan[$canStatusArr[1][$slotNum][$portNum]][remark]}</font></td>";
if(strlen($chArr[1][$i]) > 0)
echo "<td title=\"Channel\"><font color=\"#0000FF\">{$chArr[1][$i]}</font></td>";
elseif(isset($arrayDefineE1[1][0][$i][2]))
echo "<td title=\"Channel\"><font color=\"{$arrayDefineE1[1][0][$i][3]}\">{$arrayDefineE1[1][0][$i][2]}</font></td>";
else
echo "<td>--</td>";
if($attArr[1][$i] < 7 && strlen($attArr[1][$i]) > 0 )
echo "<td title=\"Port type\"><font color=\"{$arrayDefineStatus[$attArr[1][$i]][color]}\">{$arrayDefineStatus[$attArr[1][$i]][remark]}</font></td>";
elseif(isset($arrayDefineE1[1][0][$i][0]))
echo "<td title=\"Port type\"><font color=\"{$arrayDefineE1[1][0][$i][1]}\">{$arrayDefineE1[1][0][$i][0]}</font></td>";
else
echo "<td>--</td>";
}else{
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
//<!-- END::show csc 0 and csc 1 e1 details -->
echo "</table>";
echo "<table border=\"0\" width=100%>";
echo "<tr>";
echo "<td>";
echo "<p><nobr>$strRemark:&nbsp;&nbsp;";
echo "<font color=\"#0000FF\">Y</font> = $strNormal, &nbsp; &nbsp;";
echo "<font color=#FF0000>N</font> = $strAbnormal,&nbsp; &nbsp;-- = $strNothing.</nobr>";
echo "</td>";
echo "<td>";
echo "<p align=\"right\"><a href=\"$returnRoute\" target=\"contents\">";
echo "<img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<a href=\"$PHP_SLEF?clear=1\" target=\"_self\">";
echo "<img align=absBottom border=0 src=\"../../images/delete.gif\" width=\"14\" height=\"14\">$strClear</a>";
echo "</p>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<input type=\"hidden\" name=\"backpage\" value=\"$backpage\"";
?>
</body>
</html>
+611
View File
@@ -0,0 +1,611 @@
<?php
//Include the head file
require("../../inc/header.inc");
?>
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;background: url(--.gif); border: 0px; height: 16px;}
-->
</style>
<body>
<?php
//when refresh the page,it only refresh the 1/6 of the page
if(!isset($refresh_flag))
$refresh_flag=0;
else
$refresh_flag=$refresh_flag;
$refresh_flag=($refresh_flag+1)%6;
//echo "refresh_flag:$refresh_flag<br>";
echo "<form name=myform>";
echo "<input type=hidden name=refresh_flag value=$refresh_flag>";
echo "</form>";
echo "<meta http-equiv=\"refresh\" content=\"10; url=$PHP_SELF?refresh_flag=$refresh_flag\">";
//================================data define===============================================
//$card_status[platNo][cardNo] due to: refresh time,Layer1,Layer2,cpuLoad,0-normal 1-abnormal
//$card_refreshTime[platNo][cardNo]
//$card_clock[platNo][cardNo]
//$card_sync[platNo][cardNo]
//$card_version[platNo][cardNo]
//$card_HWaddr[platNo][cardNo]
//$card_type[platNo][cardNo]
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
$card_status[$i][$j]="--";
$card_refreshTime[$i][$j]="--";
$card_refreshTime_full[$i][$j]="--";
$card_clock[$i][$j]="--";
$card_sync[$i][$j]="--";
$card_version[$i][$j]="--";
$card_HWaddr[$i][$j]="--";
$card_type[$i][$j]="--";
}
}
//$port_e1Install[platNo][cardNo][portNo] port enable or disable
//$port_layer1[platNo][cardNo][portNo]
//$port_layer2[platNo][cardNo][portNo]
//$port_echoCanceller[platNo][cardNo][portNo]
//$port_channel[platNo][cardNo][portNo]
//$port_type[platNo][cardNo][portNo]
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
$port_layer1[$i][$j][$k]="--";
$port_layer2[$i][$j][$k]="--";
$port_echoCanceller[$i][$j][$k]="--";
$port_channel[$i][$j][$k]="--";
$port_type[$i][$j][$k]="--";
$port_e1Install[$i][$j][$k]="--";
$port_e1L2Install[$i][$j][$k]="--";
}
}
}
//===============================initial==================================================
$database=$omc_db;
$table_name="sysStat";
$dueDate = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y")));
//echo "heatbeat_overtime:$heatbeat_overtime<br>";
//echo "$database--$table_name--$dueDate<br>";
//begin bit
$ver_bgn = 18; //version
$typ_bgn = 21; //subsys type
$ins_bgn = 22; //e1 installed
$inl_bgn = 23; //e1 layer2 installed
$phy_bgn = 24; //e1 layer1(physical layer)
$tra_bgn = 25; //e1 layer2(transport layer)
$can_bgn = 26; //echo canceller status
$cpu_bgn = 27; //cpu loading
$loc_bgn = 28; //lock status
$fre_bgn = 29; //frequency
$pow_bgn = 30; //power card and master clock
$pra_bgn = 31; //E1 FRAMER status
$ch_bgn = 31;
$att_bgn = 39;
$HWaddr_bgn = 17;
$msc_bgn_byt=19;
//========================Get the data from database sysTypeNo=111============================
$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE sysTypeNo=111 AND (sysNo='0' OR sysNo='1')";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do{
//If there is not any card,then break
if(!$selRow)
break;
$platNo = $selRow[sysNo];
$cardNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
$bin_mes='';
if($DEBUG) echo "<br>hex_mes=$hex_mes";
for($i=0;$i<strlen($hex_mes);$i++){
$sig_hex_mes=substr($hex_mes,$i,1);
$sig_dec_mes=HexDec($sig_hex_mes);
$sig_bin_mes=DecBin($sig_dec_mes);
$sig_bin_mes=omc_keep_length($sig_bin_mes,0,4);
$bin_mes.=$sig_bin_mes;
}
if($DEBUG) echo "<br>bin_mes=$bin_mes";
//=============card status===============
$card_status[$platNo][$cardNo] = 0;
//==============card refresh time==============
$card_refreshTime[$platNo][$cardNo]=$selRow[updateTime];
$card_refreshTime_full[$platNo][$cardNo]=$selRow[updateTime];
if($card_refreshTime[$platNo][$cardNo] <= $dueDate)
{
$card_status[$platNo][$cardNo]=1;
}
//================version===============
$bin_ver_0=substr($bin_mes,$ver_bgn*8,8);
$dec_ver_0=BinDec($bin_ver_0);
$bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8);
$dec_ver_1=BinDec($bin_ver_1);
$dec_ver_1=omc_keep_length($dec_ver_1,0,2);
$bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8);
$dec_ver_2=BinDec($bin_ver_2);
$dec_ver_2=omc_keep_length($dec_ver_2,0,2);
$card_version[$platNo][$cardNo]= $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2;
//===============card type==================
$bin_typ = substr($bin_mes,$typ_bgn*8,8);
$card_type[$platNo][$cardNo]= BinDec($bin_typ);
//==================e1 install===============
for($i=0;$i<8;$i++){
$bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1);
$port_e1Install[$platNo][$cardNo][$i]=BinDec($bin_ins);
}
//==============e1 layer2 install==============
for($i=0;$i<8;$i++)
{
$bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1);
$port_e1L2Install[$platNo][$cardNo][$i]=BinDec($bin_inl);
}
//================e1 layer1=============
for($i=0;$i<8;$i++){
$bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1);
$port_layer1[$platNo][$cardNo][$i] = BinDec($bin_phy);
if($port_e1Install[$platNo][$cardNo][$i] == 0){
$port_layer1[$platNo][$cardNo][$i]=2;
}
if($port_layer1[$platNo][$cardNo][$i] == 1){
$card_status[$platNo][$cardNo]=1;
}
}
//=============e1 layer2================
for($i=0;$i<8;$i++) {
$bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1);
$port_layer2[$platNo][$cardNo][$i]=BinDec($bin_tra);
if($port_e1Install[$platNo][$cardNo][$i] == 0 || $port_e1L2Install[$platNo][$cardNo][$i] == 0){
$port_layer2[$platNo][$cardNo][$i]=2;
}
if($port_layer2[$platNo][$cardNo][$i] == 0){
$card_status[$platNo][$cardNo]=1;
}
}
//===========echo canceller status=========
for($i=0;$i<8;$i++){
$bin_can=substr($bin_mes,$can_bgn*8+7-$i,1);
$port_echoCanceller[$platNo][$cardNo][$i]=BinDec($bin_can);
if($port_e1Install[$platNo][$cardNo][$i] == 0){
$port_echoCanceller[$platNo][$cardNo][$i] = 0;
}
}
//============cpu loading===============
$bin_cpu=substr($bin_mes,$cpu_bgn*8,8);
$dec_cpu=BinDec($bin_cpu);
if($DEBUG) echo "<br>dec_cpu=$dec_cpu";
$cpu_load=change2point($dec_cpu/126);
if($cpu_load>100){
$cpu_load=100;
}
elseif($cpu_load<0){
$cpu_load=0;
}
if($DEBUG) echo "<br>cpu_load=$cpu_load";
if($cpu_load>90){
$card_status[$platNo][$cardNo] = 1;
}
//===========card sync================
$bin_loc = substr($bin_mes,$loc_bgn*8,8);
$card_sync[$platNo][$cardNo] = BinDec($bin_loc);
//===========master clock=============
$bin_mas = substr($bin_mes,$pow_bgn*8+7,1);
$card_clock[$platNo][$cardNo] = BinDec($bin_mas);
}while($selRow = @mysqli_fetch_array($selRes));
//==========================Get the data from database sysTypeNo=112=========================
$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE sysTypeNo=112";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do{
if(!$selRow)
break;
$platNo = $selRow[sysNo];
$cardNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
$card_HWaddr[$platNo][$cardNo] = substr($hex_mes,$HWaddr_bgn*2,12);
}while($selRow = @mysqli_fetch_array($selRes));
//===========================Get the data from database sysTypeNo=320=======================
$selSql = " SELECT sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE sysTypeNo=320 AND (sysNo='0' OR sysNo='1')";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do
{
if(!$selRow)
break;
$platNo = $selRow[sysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
$bin_mes='';
for($i=0;$i<strlen($hex_mes);$i++){
$sig_hex_mes=substr($hex_mes,$i,1);
$sig_dec_mes=HexDec($sig_hex_mes);
$sig_bin_mes=DecBin($sig_dec_mes);
$sig_bin_mes=omc_keep_length($sig_bin_mes,0,4);
$bin_mes.=$sig_bin_mes;
}
if($DEBUG)echo "<br>bin_mes=$bin_mes";
for($i=0;$i<128;$i++)
{
$cardNo = floor($i/8);
$portNo=$i%8;
//=================port type========================
if($DEBUG)echo "<br>i=$i";
$BinStatus=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8,3);
$DecStatus=BinDec($BinStatus);
if($DEBUG)echo "<br>DecStatus=$DecStatus";
$port_type[$platNo][$cardNo][$portNo]=$DecStatus;
//===============port channel======================
$BinAttribute=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8+3,5);
$DecAttribute=BinDec($BinAttribute);
if($DEBUG)
echo "<br>DecAttribute=$DecAttribute";
if($port_e1Install[$platNo][$cardNo][$portNo]=="--")
{
$port_channel[$platNo][$cardNo][$portNo]="--";
}
else
$port_channel[$platNo][$cardNo][$portNo]=$DecAttribute;
}
}while($selRow = @mysqli_fetch_array($selRes));
//==============================format the data======================================
$card_status_format=array(0=>"Y",1=>"N","--"=>"--");
$card_clock_format=array(0=>"Slave",1=>"Master","--"=>"--");
$card_sync_format=array(0=>"Init",1=>"Search",2=>"Locked",3=>"Threshold",4=>"Adjust",5=>"HoldOver",6=>"StopAtOppm",7=>"Idle","--"=>"--");
$card_type_format=array(0=>"E1",1=>"T1","--"=>"--");
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
$card_status[$i][$j]=$card_status_format[$card_status[$i][$j]];
$card_clock[$i][$j]=$card_clock_format[$card_clock[$i][$j]];
$card_sync[$i][$j]=$card_sync_format[$card_sync[$i][$j]];
if(strlen($card_refreshTime[$i][$j])>5)
$card_refreshTime[$i][$j]=substr($card_refreshTime[$i][$j],11,8);
if(strlen($card_refreshTime[$i][$j])<3)
{
$card_HWaddr[$i][$j]="--";
}
else
{
if(strlen($card_HWaddr[$i][$j])>5)
{
$temp="";
for($z=0;$z<5;$z++)
{
$temp.=substr($card_HWaddr[$i][$j],$z*2,2);
$temp.=":";
}
$temp.=substr($card_HWaddr[$i][$j],10,2);
$card_HWaddr[$i][$j]=$temp;
}
}
$card_type[$i][$j]=$card_type_format[$card_type[$i][$j]];
}
}
$port_enable_format=array(0=>"--",1=>"Y","--"=>"--");
$port_layer1_format=array(0=>"Y",1=>"N",2=>"--","--"=>"--");
$port_layer2_format=array(0=>"N",1=>"Y",2=>"--","--"=>"--");
$port_echoCanceller_format=array(0=>"--",1=>"Y","--"=>"--");
$port_type_format=array(0=>"TUP",1=>"ISUP",2=>"AIF",3=>"ISDN-NT",4=>"ISDN-LT",5=>"CI-CNF",6=>"CI-INT",7=>"--","--"=>"--");
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
if($card_status[$i][$j] == "--")
{
$port_e1Install[$i][$j][$k]="--";
$port_layer1[$i][$j][$k]="--";
$port_layer2[$i][$j][$k]="--";
$port_echoCanceller[$i][$j][$k]="--";
$port_type[$i][$j][$k]="--";
}
else
{
$port_e1Install[$i][$j][$k]=$port_enable_format[$port_e1Install[$i][$j][$k]];
$port_layer1[$i][$j][$k]=$port_layer1_format[$port_layer1[$i][$j][$k]];
$port_layer2[$i][$j][$k]=$port_layer2_format[$port_layer2[$i][$j][$k]];
$port_echoCanceller[$i][$j][$k]=$port_echoCanceller_format[$port_echoCanceller[$i][$j][$k]];
$port_type[$i][$j][$k]=$port_type_format[$port_type[$i][$j][$k]];
}
}
}
}
//==========================test the data===================================================
/*
echo "==================card attribute=================<br>";
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
echo "CSC-$i-Card-$j-status:{$card_status[$i][$j]}<br>";
echo "CSC-$i-Card-$j-refreshTime:{$card_refreshTime[$i][$j]}<br>";
echo "CSC-$i-Card-$j-clock:{$card_clock[$i][$j]}<br>";
echo "CSC-$i-Card-$j-sync:{$card_sync[$i][$j]}<br>";
echo "CSC-$i-Card-$j-version:{$card_version[$i][$j]}<br>";
echo "CSC-$i-Card-$j-HWaddr:{$card_HWaddr[$i][$j]}<br>";
echo "CSC-$i-Card-$j-type:{$card_type[$i][$j]}<br>";
}
}
echo "==================port attribute=================<br>";
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
//echo "CSC-$i-Card-$j-Port-$k-enable:{$port_e1Install[$i][$j][$k]}<br>";
//echo "CSC-$i-Card-$j-Port-$k-layer1:{$port_layer1[$i][$j][$k]}<br>";
//echo "CSC-$i-Card-$j-Port-$k-layer2:{$port_layer2[$i][$j][$k]}<br>";
//echo "CSC-$i-Card-$j-Port-$k-echoCanceller:{$port_echoCanceller[$i][$j][$k]}<br>";
echo "CSC-$i-Card-$j-Port-$k-channel:{$port_channel[$i][$j][$k]}<br>";
//echo "CSC-$i-Card-$j-Port-$k-type:{$port_type[$i][$j][$k]}<br>";
//$port_e1Install[$i][$j][$k]="--";
//$port_e1L2Install[$i][$j][$k]="--";
}
}
}
*/
//=========================send the data to csuStatus_show page==============================
echo "<script LANGUAGE=\"JavaScript\">";
//refresh the half element
$i=$refresh_flag%2;
for($j=0;$j<16;$j++)
{
//=========card status==================
$tempV=$card_status[$i][$j];
$tempN="plat".$i."card".$j."status";
if($card_status[$i][$j]=="N")
$tempC="#FF0000";
else if($card_status[$i][$j]=="Y")
$tempC="#0000FF";
else
$tempC="#000000";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
//==========card refresh time==================
$tempV=$card_refreshTime[$i][$j];
$tempN="plat".$i."card".$j."refreshtime";
$tmp_total=explode(" ",$card_refreshTime_full[$i][$j]);
$tmp_year_month_day=explode("-",$tmp_total[0]);
$tmp_hour_minute_second=explode(":",$tmp_total[1]);
$tmp_now=time();
$tmp_fresh=mktime($tmp_hour_minute_second[0],$tmp_hour_minute_second[1],$tmp_hour_minute_second[2],$tmp_year_month_day[1],$tmp_year_month_day[2],$tmp_year_month_day[0]);
$slot=$tmp_now-$tmp_fresh;
if(strlen($card_refreshTime[$i][$j])>5)
{
//if($card_refreshTime[$i][$j]>$dueDate)
if($slot<=40)
$tempC="#0000FF";
else
$tempC="#FF0000";
}
else
$tempC="#000000";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
//==========card clock card sync=======================
$tempV=$card_clock[$i][$j];
//$tempN="plat".$i."card".$j."clock";
if($card_clock[$i][$j]=="--")
$tempC="#000000";
else
$tempC="#0000FF";
//echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
//echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
if($card_sync[$i][$j]!="--")
$tempV=$tempV."/".$card_sync[$i][$j];
else
$tempV="--";
$tempN="plat".$i."card".$j."clocksync";
if($card_sync[$i][$j]=="--")
$tempC="#000000";
else
$tempC="#0000FF";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
//=========== card version======================
$tempV=$card_version[$i][$j];
$tempN="plat".$i."card".$j."version";
if($card_version[$i][$j]=="--")
$tempC="#000000";
else
$tempC="#0000FF";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
//============card HWaddr======================
$tempV=$card_HWaddr[$i][$j];
$tempN="plat".$i."card".$j."hwaddr";
if($card_HWaddr[$i][$j]=="--")
$tempC="#000000";
else
$tempC="#0000FF";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
//=============card type=======================
$tempV=$card_type[$i][$j];
$tempN="plat".$i."card".$j."type";
if($card_type[$i][$j]=="--")
$tempC="#000000";
else
$tempC="#0000FF";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
//=============port status=======================
if($refresh_flag==0)
{
$tempV=$port_e1Install[$i][$j][$k];
$tempN="plat".$i."card".$j."port".$k."status";
if(strcmp($port_e1Install[$i][$j][$k],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_e1Install[$i][$j][$k],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
//=============port layer1=========================
if($refresh_flag==1)
{
$tempV=$port_layer1[$i][$j][$k];
$tempN="plat".$i."card".$j."port".$k."layer1";
if(strcmp($port_layer1[$i][$j][$k],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_layer1[$i][$j][$k],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
//=============port layer2=========================
if($refresh_flag==2)
{
$tempV=$port_layer2[$i][$j][$k];
$tempN="plat".$i."card".$j."port".$k."layer2";
if(strcmp($port_layer2[$i][$j][$k],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_layer2[$i][$j][$k],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
//=============port echo canceller=================
if($refresh_flag==3)
{
$tempV=$port_echoCanceller[$i][$j][$k];
$tempN="plat".$i."card".$j."port".$k."echocanceller";
if(strcmp($port_echoCanceller[$i][$j][$k],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_echoCanceller[$i][$j][$k],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
//=============port channel========================
if($refresh_flag==4)
{
$tempV=$port_channel[$i][$j][$k];
//$tempN="plat0card".$i."port".$j."channel";
$tempN="plat".$i."card".$j."port".$k."channel";
if(strcmp($port_channel[$i][$j][$k],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
//=============port type===========================
if($refresh_flag==5)
{
$tempV=$port_type[$i][$j][$k];
$tempN="plat".$i."card".$j."port".$k."type";
if(strcmp($port_type[$i][$j][$k],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.value='$tempV'";
echo "\nparent.show_frame.document.csuStatusForm.$tempN.style.color='$tempC'";
}
}
}
}
echo "\n</script>";
?>
</body>
+18
View File
@@ -0,0 +1,18 @@
<?php
require("../../inc/header.inc");
?>
<frameset framespacing="0" border="0" rows="100%,*" frameborder="0">
<?php
echo "<frame name=\"show_frame\" src=\"csuStatus_show.php\" scrolling=\"auto\">";
echo "<frame name=\"deal_frame\" scrolling=\"no\" noresized target=\"show_frame\" src=\"csuStatus_deal.php\">";
?>
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>
+882
View File
@@ -0,0 +1,882 @@
<?php
//Include the head file
require("../../inc/header.inc");
?>
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;background: url(--.gif); border: 0px; height: 16px;}
-->
</style>
<body>
<?php
//================================data define===============================================
//$card_status[platNo][cardNo] due to: refresh time,Layer1,Layer2,cpuLoad,0-normal 1-abnormal
//$card_refreshTime[platNo][cardNo]
//$card_clock[platNo][cardNo]
//$card_sync[platNo][cardNo]
//$card_version[platNo][cardNo]
//$card_HWaddr[platNo][cardNo]
//$card_type[platNo][cardNo]
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
$card_status[$i][$j]="--";
$card_refreshTime[$i][$j]="--";
$card_refreshTime_full[$i][$j]="--";
$card_clock[$i][$j]="--";
$card_sync[$i][$j]="--";
$card_version[$i][$j]="--";
$card_HWaddr[$i][$j]="--";
$card_type[$i][$j]="--";
}
}
//$port_e1Install[platNo][cardNo][portNo] port enable or disable
//$port_layer1[platNo][cardNo][portNo]
//$port_layer2[platNo][cardNo][portNo]
//$port_echoCanceller[platNo][cardNo][portNo]
//$port_channel[platNo][cardNo][portNo]
//$port_type[platNo][cardNo][portNo]
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
$port_layer1[$i][$j][$k]="--";
$port_layer2[$i][$j][$k]="--";
$port_echoCanceller[$i][$j][$k]="--";
$port_channel[$i][$j][$k]="--";
$port_type[$i][$j][$k]="--";
$port_e1Install[$i][$j][$k]="--";
$port_e1L2Install[$i][$j][$k]="--";
}
}
}
//===============================initial==================================================
$database=$omc_db;
$table_name="sysStat";
$dueDate = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y")));
//echo "$database--$table_name--$dueDate<br>";
//begin bit
$ver_bgn = 18; //version
$typ_bgn = 21; //subsys type
$ins_bgn = 22; //e1 installed
$inl_bgn = 23; //e1 layer2 installed
$phy_bgn = 24; //e1 layer1(physical layer)
$tra_bgn = 25; //e1 layer2(transport layer)
$can_bgn = 26; //echo canceller status
$cpu_bgn = 27; //cpu loading
$loc_bgn = 28; //lock status
$fre_bgn = 29; //frequency
$pow_bgn = 30; //power card and master clock
$pra_bgn = 31; //E1 FRAMER status
$ch_bgn = 31;
$att_bgn = 39;
$HWaddr_bgn = 17;
$msc_bgn_byt=19;
//========================Get the data from database sysTypeNo=111============================
$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE sysTypeNo=111 AND (sysNo='0' OR sysNo='1')";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do{
//If there is not any card,then break
if(!$selRow)
break;
$platNo = $selRow[sysNo];
$cardNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
$bin_mes='';
if($DEBUG) echo "<br>hex_mes=$hex_mes";
for($i=0;$i<strlen($hex_mes);$i++){
$sig_hex_mes=substr($hex_mes,$i,1);
$sig_dec_mes=HexDec($sig_hex_mes);
$sig_bin_mes=DecBin($sig_dec_mes);
$sig_bin_mes=omc_keep_length($sig_bin_mes,0,4);
$bin_mes.=$sig_bin_mes;
}
if($DEBUG) echo "<br>bin_mes=$bin_mes";
//=============card status===============
$card_status[$platNo][$cardNo] = 0;
//==============card refresh time==============
$card_refreshTime[$platNo][$cardNo]=$selRow[updateTime];
$card_refreshTime_full[$platNo][$cardNo]=$selRow[updateTime];
if($card_refreshTime[$platNo][$cardNo] <= $dueDate)
{
$card_status[$platNo][$cardNo]=1;
}
//================version===============
$bin_ver_0=substr($bin_mes,$ver_bgn*8,8);
$dec_ver_0=BinDec($bin_ver_0);
$bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8);
$dec_ver_1=BinDec($bin_ver_1);
$dec_ver_1=omc_keep_length($dec_ver_1,0,2);
$bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8);
$dec_ver_2=BinDec($bin_ver_2);
$dec_ver_2=omc_keep_length($dec_ver_2,0,2);
$card_version[$platNo][$cardNo]= $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2;
//===============card type==================
$bin_typ = substr($bin_mes,$typ_bgn*8,8);
$card_type[$platNo][$cardNo]= BinDec($bin_typ);
//==================e1 install===============
for($i=0;$i<8;$i++){
$bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1);
$port_e1Install[$platNo][$cardNo][$i]=BinDec($bin_ins);
}
//==============e1 layer2 install==============
for($i=0;$i<8;$i++)
{
$bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1);
$port_e1L2Install[$platNo][$cardNo][$i]=BinDec($bin_inl);
}
//================e1 layer1=============
for($i=0;$i<8;$i++){
$bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1);
$port_layer1[$platNo][$cardNo][$i] = BinDec($bin_phy);
if($port_e1Install[$platNo][$cardNo][$i] == 0){
$port_layer1[$platNo][$cardNo][$i]=2;
}
if($port_layer1[$platNo][$cardNo][$i] == 1){
$card_status[$platNo][$cardNo]=1;
}
}
//=============e1 layer2================
for($i=0;$i<8;$i++) {
$bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1);
$port_layer2[$platNo][$cardNo][$i]=BinDec($bin_tra);
if($port_e1Install[$platNo][$cardNo][$i] == 0 || $port_e1L2Install[$platNo][$cardNo][$i] == 0){
$port_layer2[$platNo][$cardNo][$i]=2;
}
if($port_layer2[$platNo][$cardNo][$i] == 0){
$card_status[$platNo][$cardNo]=1;
}
}
//===========echo canceller status=========
for($i=0;$i<8;$i++){
$bin_can=substr($bin_mes,$can_bgn*8+7-$i,1);
$port_echoCanceller[$platNo][$cardNo][$i]=BinDec($bin_can);
if($port_e1Install[$platNo][$cardNo][$i] == 0){
$port_echoCanceller[$platNo][$cardNo][$i] = 0;
}
}
//============cpu loading===============
$bin_cpu=substr($bin_mes,$cpu_bgn*8,8);
$dec_cpu=BinDec($bin_cpu);
if($DEBUG) echo "<br>dec_cpu=$dec_cpu";
$cpu_load=change2point($dec_cpu/126);
if($cpu_load>100){
$cpu_load=100;
}
elseif($cpu_load<0){
$cpu_load=0;
}
if($DEBUG)
echo "<br>cpu_load=$cpu_load";
if($cpu_load>90){
$card_status[$platNo][$cardNo] = 1;
}
//===========card sync================
$bin_loc = substr($bin_mes,$loc_bgn*8,8);
$card_sync[$platNo][$cardNo] = BinDec($bin_loc);
//===========master clock=============
$bin_mas = substr($bin_mes,$pow_bgn*8+7,1);
$card_clock[$platNo][$cardNo] = BinDec($bin_mas);
}while($selRow = @mysqli_fetch_array($selRes));
//==========================Get the data from database sysTypeNo=112=========================
$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE sysTypeNo=112";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do{
if(!$selRow)
break;
$platNo = $selRow[sysNo];
$cardNo = $selRow[subSysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
$card_HWaddr[$platNo][$cardNo] = substr($hex_mes,$HWaddr_bgn*2,12);
}while($selRow = @mysqli_fetch_array($selRes));
//===========================Get the data from database sysTypeNo=320=======================
$selSql = " SELECT sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat
WHERE sysTypeNo=320 AND (sysNo='0' OR sysNo='1')";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do
{
if(!$selRow)
break;
$platNo = $selRow[sysNo];
$hex_mes = $selRow[detailStat];
if($DEBUG) echo "<br>hex_mes=$hex_mes";
$bin_mes='';
for($i=0;$i<strlen($hex_mes);$i++){
$sig_hex_mes=substr($hex_mes,$i,1);
$sig_dec_mes=HexDec($sig_hex_mes);
$sig_bin_mes=DecBin($sig_dec_mes);
$sig_bin_mes=omc_keep_length($sig_bin_mes,0,4);
$bin_mes.=$sig_bin_mes;
}
if($DEBUG)echo "<br>bin_mes=$bin_mes";
for($i=0;$i<128;$i++)
{
$cardNo = floor($i/8);
$portNo=$i%8;
//=================port type========================
if($DEBUG)echo "<br>i=$i";
$BinStatus=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8,3);
$DecStatus=BinDec($BinStatus);
if($DEBUG)echo "<br>DecStatus=$DecStatus";
$port_type[$platNo][$cardNo][$portNo]=$DecStatus;
//===============port channel======================
$BinAttribute=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8+3,5);
$DecAttribute=BinDec($BinAttribute);
if($DEBUG)
echo "<br>DecAttribute=$DecAttribute";
if($port_e1Install[$platNo][$cardNo][$portNo]=="--")
{
$port_channel[$platNo][$cardNo][$portNo]="--";
}
else
$port_channel[$platNo][$cardNo][$portNo]=$DecAttribute;
}
}while($selRow = @mysqli_fetch_array($selRes));
//==============================format the data======================================
$card_status_format=array(0=>"Y",1=>"N","--"=>"--");
$card_clock_format=array(0=>"Slave",1=>"Master","--"=>"--");
$card_sync_format=array(0=>"Init",1=>"Search",2=>"Locked",3=>"Threshold",4=>"Adjust",5=>"HoldOver",6=>"StopAtOppm",7=>"Idle","--"=>"--");
$card_type_format=array(0=>"E1",1=>"T1","--"=>"--");
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
$card_status[$i][$j]=$card_status_format[$card_status[$i][$j]];
$card_clock[$i][$j]=$card_clock_format[$card_clock[$i][$j]];
$card_sync[$i][$j]=$card_sync_format[$card_sync[$i][$j]];
if(strlen($card_refreshTime[$i][$j])>5)
$card_refreshTime[$i][$j]=substr($card_refreshTime[$i][$j],11,8);
if(strlen($card_refreshTime[$i][$j])<3)
{
$card_HWaddr[$i][$j]="--";
}
else
{
if(strlen($card_HWaddr[$i][$j])>5)
{
$temp="";
for($z=0;$z<5;$z++)
{
$temp.=substr($card_HWaddr[$i][$j],$z*2,2);
$temp.=":";
}
$temp.=substr($card_HWaddr[$i][$j],10,2);
$card_HWaddr[$i][$j]=$temp;
}
}
$card_type[$i][$j]=$card_type_format[$card_type[$i][$j]];
}
}
$port_enable_format=array(0=>"--",1=>"Y","--"=>"--");
$port_layer1_format=array(0=>"Y",1=>"N",2=>"--","--"=>"--");
$port_layer2_format=array(0=>"N",1=>"Y",2=>"--","--"=>"--");
$port_echoCanceller_format=array(0=>"--",1=>"Y","--"=>"--");
$port_type_format=array(0=>"TUP",1=>"ISUP",2=>"AIF",3=>"ISDN-NT",4=>"ISDN-LT",5=>"CI-CNF",6=>"CI-INT",7=>"--","--"=>"--");
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
if($card_status[$i][$j] == "--")
{
$port_e1Install[$i][$j][$k]="--";
$port_layer1[$i][$j][$k]="--";
$port_layer2[$i][$j][$k]="--";
$port_echoCanceller[$i][$j][$k]="--";
$port_type[$i][$j][$k]="--";
}
else
{
$port_e1Install[$i][$j][$k]=$port_enable_format[$port_e1Install[$i][$j][$k]];
$port_layer1[$i][$j][$k]=$port_layer1_format[$port_layer1[$i][$j][$k]];
$port_layer2[$i][$j][$k]=$port_layer2_format[$port_layer2[$i][$j][$k]];
$port_echoCanceller[$i][$j][$k]=$port_echoCanceller_format[$port_echoCanceller[$i][$j][$k]];
$port_type[$i][$j][$k]=$port_type_format[$port_type[$i][$j][$k]];
}
}
}
}
//============================clear button=============================================
if($clear){
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
$card_status[$i][$j]="--";
$card_refreshTime[$i][$j]="--";
$card_clock[$i][$j]="--";
$card_sync[$i][$j]="--";
$card_version[$i][$j]="--";
$card_HWaddr[$i][$j]="--";
$card_type[$i][$j]="--";
}
}
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
$port_layer1[$i][$j][$k]="--";
$port_layer2[$i][$j][$k]="--";
$port_echoCanceller[$i][$j][$k]="--";
$port_channel[$i][$j][$k]="--";
$port_type[$i][$j][$k]="--";
$port_e1Install[$i][$j][$k]="--";
$port_e1L2Install[$i][$j][$k]="--";
}
}
}
//==================clear the record in the database=========================
$db=$omc_db;
$delSql = " Delete FROM OMC_PUB.sysStat
WHERE sysTypeNo='111'
";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
$tmpSql="SELECT sysTypeNo FROM sysConf WHERE needInstall = 1";
$tmpRes = mysqli_query($pubConn,$tmpSql);
$tmpRow = @mysqli_fetch_array($tmpRes);
$i=0;
do{
if($i==0)
$tmpWhere="sysTypeNo != $tmpRow[sysTypeNo]";
else
$tmpWhere=$tmpWhere." AND sysTypeNo != $tmpRow[sysTypeNo]";
$i++;
}while($tmpRow = @mysqli_fetch_array($tmpRes));
//echo "tmpWhere=$tmpWhere";
$delSql = " Delete FROM OMC_PUB.sysInfo WHERE $tmpWhere";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
$delSql = "Delete FROM OMC_PUB.sysLedStat";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
}
//==========================test the data===================================================
/*
echo "==================card attribute=================<br>";
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
echo "CSC-$i-Card-$j-status:{$card_status[$i][$j]}<br>";
echo "CSC-$i-Card-$j-refreshTime:{$card_refreshTime[$i][$j]}<br>";
echo "CSC-$i-Card-$j-clock:{$card_clock[$i][$j]}<br>";
echo "CSC-$i-Card-$j-sync:{$card_sync[$i][$j]}<br>";
echo "CSC-$i-Card-$j-version:{$card_version[$i][$j]}<br>";
echo "CSC-$i-Card-$j-HWaddr:{$card_HWaddr[$i][$j]}<br>";
echo "CSC-$i-Card-$j-type:{$card_type[$i][$j]}<br>";
}
}
echo "==================port attribute=================<br>";
for($i=0;$i<2;$i++)
{
for($j=0;$j<16;$j++)
{
for($k=0;$k<8;$k++)
{
echo "CSC-$i-Card-$j-Port-$k-enable:{$port_e1Install[$i][$j][$k]}<br>";
echo "CSC-$i-Card-$j-Port-$k-layer1:{$port_layer1[$i][$j][$k]}<br>";
echo "CSC-$i-Card-$j-Port-$k-layer2:{$port_layer2[$i][$j][$k]}<br>";
echo "CSC-$i-Card-$j-Port-$k-echoCanceller:{$port_echoCanceller[$i][$j][$k]}<br>";
echo "CSC-$i-Card-$j-Port-$k-channel:{$port_channel[$i][$j][$k]}<br>";
echo "CSC-$i-Card-$j-Port-$k-type:{$port_type[$i][$j][$k]}<br>";
//$port_e1Install[$i][$j][$k]="--";
//$port_e1L2Install[$i][$j][$k]="--";
}
}
}
*/
//===================================show the data in table==================================
//==========================online help=======================
{
echo "<div style=\"position:absolute;top:0;left:815;\" id=\"helpId\">";
$helpId="1.2.1";
showHelp($helpId);
echo "</div>";
}
echo "$strSysStatus > $strCentralOffice > MSC-CSC";
echo "<p align=\"right\"><a href=\"$returnRoute\" target=\"contents\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<a href=\"$PHP_SLEF?clear=1\" target=\"_self\"><img align=absBottom border=0 src=\"../../images/delete.gif\" width=\"14\" height=\"14\">$strClear</a>";
echo "<form name=\"csuStatusForm\" method=\"post\">";
echo "<table border=\"0\" width=100%>";
echo "<tr>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">CSC0-8K E1/T1 Card $strStatusInfo</font></p></td>";
echo "<td width=2%>&nbsp;</td>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">CSC1-8K E1/T1 Card $strStatusInfo</font></p></td>";
echo "</tr>";
//==============================csc0 table===============================================
echo "<td width=49% height=\"1\">";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=2%>ID</td>";
echo "<td width=2%>Type</td>";
echo "<td width=5%>$strBasicStatus</td>";
echo "<td width=12%>$strRefreshTime</td>";
echo "<td width=9%>Clock/Sync</td>";
echo "<td width=7%>Version</td>";
echo "<td width=12%>HWaddr</td>";
echo "</tr>";
for($i=0;$i<16;$i++)
{
echo "<tr>";
//==ID===
$showId = omc_keep_length($i,0,2);
echo "<td>$showId</td>";
//==type==
$tempV=$card_type[0][$i];
$tempN="plat0card".$i."type";
if(strcmp($card_type[0][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==status==
$tempV=$card_status[0][$i];
$tempN="plat0card".$i."status";
if(strcmp($tempV,"Y")==0)
$tempC="blue";
else if(strcmp($tempV,"N")==0)
$tempC="red";
else
$tempC="black";
echo "<td><input size=2 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==refresh time==
$tempV=$card_refreshTime[0][$i];
$tmp_total=explode(" ",$card_refreshTime_full[0][$i]);
$tmp_year_month_day=explode("-",$tmp_total[0]);
$tmp_hour_minute_second=explode(":",$tmp_total[1]);
$tmp_now=time();
$tmp_fresh=mktime($tmp_hour_minute_second[0],$tmp_hour_minute_second[1],$tmp_hour_minute_second[2],$tmp_year_month_day[1],$tmp_year_month_day[2],$tmp_year_month_day[0]);
$tempN="plat0card".$i."refreshtime";
$slot=$tmp_now-$tmp_fresh;
if(strlen($card_refreshTime[0][$i])>5)
{
//if($card_refreshTime[0][$i]>$dueDate)
if($slot<=40)
$tempC="#0000FF";
else
$tempC="#FF0000";
}
else
$tempC="#000000";
//echo "<td><input size=7 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
echo "<td><input size=7 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==clock sync==
$tempV=$card_clock[0][$i]."/".$card_sync[0][$i];
if($card_clock[0][$i]=="--")
$tempV="--";
$tempN="plat0card".$i."clocksync";
if(strcmp($card_sync[0][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=9 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==version==
$tempV=$card_version[0][$i];
$tempN="plat0card".$i."version";
if(strcmp($card_version[0][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=6 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==HWaddr==
$tempV=$card_HWaddr[0][$i];
$tempN="plat0card".$i."hwaddr";
if(strcmp($card_HWaddr[0][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=17 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "<td width=1%>&nbsp;</td>";
//================================csc1 table================================================
echo "<td width=49% height=\"1\">";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=2%>ID</td>";
echo "<td width=2%>Type</td>";
echo "<td width=5%>$strBasicStatus</td>";
echo "<td width=12%>$strRefreshTime</td>";
echo "<td width=9%>Clock/Sync</td>";
echo "<td width=7%>Version</td>";
echo "<td width=12%>HWaddr</td>";
echo "</tr>";
for($i=0;$i<16;$i++)
{
echo "<tr>";
//==ID===
$showId = omc_keep_length($i,0,2);
echo "<td>$showId</td>";
//==type==
$tempV=$card_type[1][$i];
$tempN="plat1card".$i."type";
if(strcmp($card_type[1][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==status==
$tempV=$card_status[1][$i];
$tempN="plat1card".$i."status";
if(strcmp($tempV,"Y")==0)
$tempC="blue";
else if(strcmp($tempV,"N")==0)
$tempC="red";
else
$tempC="black";
echo "<td><input size=2 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==refresh time==
$tempV=$card_refreshTime[1][$i];
$tempN="plat1card".$i."refreshtime";
$tmp_total=explode(" ",$card_refreshTime_full[1][$i]);
$tmp_year_month_day=explode("-",$tmp_total[0]);
$tmp_hour_minute_second=explode(":",$tmp_total[1]);
$tmp_now=time();
$tmp_fresh=mktime($tmp_hour_minute_second[0],$tmp_hour_minute_second[1],$tmp_hour_minute_second[2],$tmp_year_month_day[1],$tmp_year_month_day[2],$tmp_year_month_day[0]);
$slot=$tmp_now-$tmp_fresh;
if(strlen($card_refreshTime[1][$i])>5)
{
//if($card_refreshTime[1][$i]<=$dueDate)
if($slot<=40)
$tempC="#0000FF";
else
$tempC="#FF0000";
}
else
$tempC="#000000";
echo "<td><input size=7 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==clock sync==
$tempV=$card_clock[1][$i]."/".$card_sync[1][$i];
if($card_clock[1][$i]=="--")
$tempV="--";
$tempN="plat1card".$i."clocksync";
if(strcmp($card_sync[1][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=9 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==version==
$tempV=$card_version[1][$i];
$tempN="plat1card".$i."version";
if(strcmp($card_version[1][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=6 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==HWaddr==
$tempV=$card_HWaddr[1][$i];
$tempN="plat1card".$i."hwaddr";
if(strcmp($card_HWaddr[1][$i],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=17 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">$strPane0Status</font></p></td>";
echo "<td width=2%>&nbsp;</td>";
echo "<td width=49%><p align=\"center\"><font color=\"#0000FF\" size=\"2\">$strPane1Status</font></td>";
echo "</tr>";
echo "<tr>";
//<!-- left CSC 0 details -->
echo "<td width=49%>";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
for($i=0;$i<16;$i++)
{
echo "<tr bgcolor=\"#C0C0C0\">";
echo "<td width=6%>Slot</td>";
echo "<td width=6%>Port</td>";
echo "<td width=6% title=\"Enable\">EN</td>";
echo "<td width=6% title=\"Physical layer\">L1</td>";
echo "<td width=6% title=\"Transport\">L2</td>";
echo "<td width=6% title=\"Echo canceller\">EC</td>";
echo "<td width=6% title=\"Channel\">CH</td>";
echo "<td width=7% title=\"Port type\">TY</td>";
echo "</tr>";
for($j=0;$j<8;$j++)
{
echo "<tr>";
//==slot==
echo "<td>$i</td>";
//==port==
echo "<td>$j</td>";
//==status==
$tempV=$port_e1Install[0][$i][$j];
$tempN="plat0card".$i."port".$j."status";
if(strcmp($port_e1Install[0][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_e1Install[0][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==layer1==
$tempV=$port_layer1[0][$i][$j];
$tempN="plat0card".$i."port".$j."layer1";
if(strcmp($port_layer1[0][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_layer1[0][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==layer2==
$tempV=$port_layer2[0][$i][$j];
$tempN="plat0card".$i."port".$j."layer2";
if(strcmp($port_layer2[0][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_layer2[0][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==echo canceller==
$tempV=$port_echoCanceller[0][$i][$j];
$tempN="plat0card".$i."port".$j."echocanceller";
if(strcmp($port_echoCanceller[0][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_echoCanceller[0][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==channel==
$tempV=$port_channel[0][$i][$j];
$tempN="plat0card".$i."port".$j."channel";
if(strcmp($port_channel[0][$i][$j],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==type==
$tempV=$port_type[0][$i][$j];
$tempN="plat0card".$i."port".$j."type";
if(strcmp($port_type[0][$i][$j],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=7 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
echo "</tr>";
}
}
echo "</table>";
echo "</td>";
echo "<td width=2%></td>";
//<!-- right CSC 1 details -->
echo "<td width=49%>";
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
for($i=0;$i<16;$i++)
{
echo "<tr bgcolor=\"#C0C0C0\">";
echo "<td width=6%>Slot</td>";
echo "<td width=6%>Port</td>";
echo "<td width=6% title=\"Enable\">EN</td>";
echo "<td width=6% title=\"Physical layer\">L1</td>";
echo "<td width=6% title=\"Transport\">L2</td>";
echo "<td width=6% title=\"Echo canceller\">EC</td>";
echo "<td width=6% title=\"Channel\">CH</td>";
echo "<td width=7% title=\"Port type\">TY</td>";
echo "</tr>";
for($j=0;$j<8;$j++)
{
echo "<tr>";
//==slot==
echo "<td>$i</td>";
//==port==
echo "<td>$j</td>";
//==status==
$tempV=$port_e1Install[1][$i][$j];
$tempN="plat1card".$i."port".$j."status";
if(strcmp($port_e1Install[1][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_e1Install[1][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==layer1==
$tempV=$port_layer1[1][$i][$j];
$tempN="plat1card".$i."port".$j."layer1";
if(strcmp($port_layer1[1][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_layer1[1][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==layer2==
$tempV=$port_layer2[1][$i][$j];
$tempN="plat1card".$i."port".$j."layer2";
if(strcmp($port_layer2[1][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_layer2[1][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==echo canceller==
$tempV=$port_echoCanceller[1][$i][$j];
$tempN="plat1card".$i."port".$j."echocanceller";
if(strcmp($port_echoCanceller[1][$i][$j],"Y")==0)
$tempC="#0000FF";
else if(strcmp($port_echoCanceller[1][$i][$j],"N")==0)
$tempC="#FF0000";
else
$tempC="#000000";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==channel==
$tempV=$port_channel[1][$i][$j];
$tempN="plat1card".$i."port".$j."channel";
if(strcmp($port_channel[1][$i][$j],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=4 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
//==type==
$tempV=$port_type[1][$i][$j];
$tempN="plat1card".$i."port".$j."type";
if(strcmp($port_type[1][$i][$j],"--")==0)
$tempC="#000000";
else
$tempC="#0000FF";
echo "<td><input size=7 type=input readonly value=\"$tempV\" style=color:$tempC name=\"$tempN\" class=\"style3\"></td>";
echo "</tr>";
}
}
echo "</table>";
echo "</td>";
echo "</table>";
echo "</form>";
?>
</body>
+19
View File
@@ -0,0 +1,19 @@
# This file conf the total plat definition
PlatSysTypeNo=200
[0]
PlatformName="EMS"
PlatformID=0
PlatformNo=2
[8]
PlatformName="VSS"
PlatformID=8
PlatformNo=10
[9]
PlatformName="MSS"
PlatformID=9
PlatformNo=2
[18]
PlatformName="RCM"
PlatformID=18
PlatformNo=2
+229
View File
@@ -0,0 +1,229 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > IPTRANS Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"./plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,0);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
$table_title="<font color=\"#0000FF\">IPTRANS</font>( Version:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
$table_title.=",";
$table_title.=" Status:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
$table_title.=",";
$table_title.="RefreshTime:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">4id</span>";
$table_title.=")";
echo "<br><center>$table_title</center>";
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "</tr>";
for($i=0;$i<8;$i++)
{
echo "<tr>";
for($j=0;$j<4;$j++)
{
$dis_no=4950+($j)*8+$i;
echo "<td>";
echo $dis_no;
echo "</td>";
$id=AssignID();
echo "<td>";
$dis_port=($j)*8+$i;
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(sysNo,subSysNo)
{
var fixurl="./iptrans_status_update.php?sysNo="+sysNo+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+sysNo+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
//alert(response);
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$sysNo','$subSysNo');\n";
echo "</script>\n";
?>
+51
View File
@@ -0,0 +1,51 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,0);
//version
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[IPTRANS][Version][Value]},#0000FF;";
//Status
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[IPTRANS][Status][Value]},#0000FF;";
//RefreshTime
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},#0000FF;";
//port
for($i=0;$i<8;$i++)
{
for($j=0;$j<4;$j++)
{
$dis_port=($j)*8+$i;
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[IPTRANS][Port][$dis_port][Status][Value]},{$platDetailInfo[IPTRANS][Port][$dis_port][Status][Color]};";
}
}
echo "$total_response";
?>
+314
View File
@@ -0,0 +1,314 @@
<?php
require("../../inc/lib.inc");
?>
<?php
$maxRowPerPage=16;
$mtp3_systypeno=222;
$plat_systypeno=200;
$mss_platno=9;
$mtp3_modid=1;
$linkset_index_name="lsIndex";
$linkset_title_name="lsTitle";
$linkset_status_name="lsStatus";
$link_index_name="lkIndex";
$link_title_name="lkTitle";
$link_status_name="lkLinkStatus";
$link_lsID_name="lkLinkSetID";
$field_sep=",";
$line_sep=";";
function GetOIDByName($sysTypeNo,$name)
{
$database="OBJ_".$sysTypeNo.".paramConf";
$sql="select * from $database where name_2 like '%$name%' ";
$res=@mysqli_query($pubConn,$sql);
$row=@mysqli_fetch_array($res);
$oids="";
for($i=1;$i<=10;$i++)
{
$tmpN="level_".$i;
$tmpV=$row[$tmpN]+0;
if($tmpV == 0)
break;
$oids.=$tmpV.".";
}
if($i>1)
$oids=substr($oids,0,strlen($oids)-1);
return $oids;
}
function getLevel($objIdStr)
{
$levelArr=explode('.',$objIdStr);
for($j=0;$j<sizeof($levelArr);$j++)
{
$levelNo=$j+1;
${"level_$levelNo"}=$levelArr[$j];
if($Debug) echo "<BR>levelArr[$j]={$levelArr[$j]}";
if($j == 0){
$levelWhere ="level_$levelNo='${"level_$levelNo"}'";
}else{
$levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'";
}
}
$levelNo+=1;
if($levelNo<=10)
$levelWhere.=" AND level_$levelNo=0 ";
return($levelWhere);
}
function getLinkInfo($table,$titleoid,$statusoid,$instance)
{
$instanceNo=omc_keep_length($instance,"0",4);
$tmpwhere=getLevel($titleoid);
$sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
$linkInfo[Title]="";
else
{
$row=@mysqli_fetch_array($res);
$linkInfo[Title]=$row[initValue];
}
$tmpwhere=getLevel($statusoid);
$sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
$linkInfo[Status]=0;
else
{
$row=@mysqli_fetch_array($res);
$linkInfo[Status]=$row[initValue]+0;
}
return $linkInfo;
}
function getStatusByHeartbeat()
{
global $mss_platno,$plat_systypeno;
$sql="select * from OMC_PUB.sysStat where sysTypeNo={$plat_systypeno} and sysNo={$mss_platno} order by updateTime desc ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
return $StatusSet;
$row=@mysqli_fetch_array($res);
$baseStat=$row[detailStat];
$compStat=substr($baseStat,38);
$compStatLen=strlen($compStat)-1;
//echo "$compStat<br>";
$index=0;
$i=0;
while($i<$compStatLen)
{
$tmp=substr($compStat,$i,4);
$component[$index][ID]=$tmp+0;
$i+=4;
$tmp=substr($compStat,$i,4);
$component[$index][Length]=hexdec($tmp);
$i+=4;
$component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2);
$i+=$component[$index][Length]*2;
$index++;
}
if($component[1][Length] == 0)
return $StatusSet;
$mtp3_hb=$component[1][Content];
$pos=0;
$link_hb=substr($mtp3_hb,8,256*2);
$linkset_hb=substr($mtp3_hb,520,128*2);
for($i=0;$i<256;$i++)
{
$tmpi=hexdec(substr($link_hb,$i*2,2));
$tmpb=omc_keep_length(decbin($tmpi),"0",8);
$tmpb=strrev($tmpb);
for($j=0;$j<4;$j++)
{
$tmp2bit=strrev(substr($tmpb,$j*2,2));
$StatusSet[LinkStatus][$i*4+$j]=bindec($tmp2bit);
}
}
for($i=0;$i<128;$i++)
{
$tmpi=hexdec(substr($linkset_hb,$i*2,2));
$tmpb=omc_keep_length(decbin($tmpi),"0",8);
$tmpb=strrev($tmpb);
for($j=0;$j<4;$j++)
{
$tmp2bit=strrev(substr($tmpb,$j*2,2));
$tt=$i*4+$j;
$yy=bindec($tmp2bit);
$StatusSet[LinkSetStatus][$i*4+$j]=bindec($tmp2bit);
}
}
return $StatusSet;
}
?>
<?php
$mtp3_param_table="OBJ_".$mtp3_systypeno.".param_".$mss_platno;
$linkset_index_oid=GetOIDByName($mtp3_systypeno,$linkset_index_name);
$linkset_title_oid=GetOIDByName($mtp3_systypeno,$linkset_title_name);
$linkset_status_oid=GetOIDByName($mtp3_systypeno,$linkset_status_name);
$link_index_oid=GetOIDByName($mtp3_systypeno,$link_index_name);
$link_title_oid=GetOIDByName($mtp3_systypeno,$link_title_name);
$link_status_oid=GetOIDByName($mtp3_systypeno,$link_status_name);
$link_lsID_oid=GetOIDByName($mtp3_systypeno,$link_lsID_name);
$response="";
//get the page list
$tmpwhere=getLevel($linkset_index_oid);
$sql="select * from $mtp3_param_table where $tmpwhere ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
$page_count=ceil($num/$maxRowPerPage);
$response.="page_count".$field_sep.$page_count.$line_sep;
//get the linkset index
$tmpwhere=getLevel($linkset_index_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
$linksetCount=$num;
//system("echo '$sql' >> /tmp/test.txt");
if($num > 0)
$response.="layer".$field_sep."blank_row_id".$field_sep."hide".$line_sep;
else
$response.="layer".$field_sep."blank_row_id".$field_sep."show".$line_sep;
for($index=0;$index<$maxRowPerPage;$index++)
{
//system("echo 'linksetCount=$linksetCount' >> /tmp/test.txt");
if($index < $linksetCount)
$response.="layer".$field_sep."row_id_{$index}".$field_sep."show".$line_sep;
else
$response.="layer".$field_sep."row_id_{$index}".$field_sep."hide".$line_sep;
}
$linkset_id_cond=" and (";
for($index=0;$index < $num;$index++)
{
$row=@mysqli_fetch_array($res);
$linkset[$index][Instance]=$row[instanceNo]+0;
$linkset_id_cond.=" initValue={$linkset[$index][Instance]} ";
if($index != ($num-1))
$linkset_id_cond.=" or ";
$linkset[$index][LinkIndex]=0;
$index_mirror[$linkset[$index][Instance]][Index]=$index;
}
$linkset_id_cond.=") ";
if($num == 0)
$linkset_id_cond="";
$statusSet=getStatusByHeartbeat();
//get linkset status and title
$tmpwhere=getLevel($linkset_title_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
for($index=0;$index < $num;$index++)
{
$row=@mysqli_fetch_array($res);
$instance=$row[instanceNo]+0;
$pos=$index_mirror[$instance][Index];
$linkset[$index][Title]=$row[initValue];
}
$tmpwhere=getLevel($linkset_status_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
for($index=0;$index < $num;$index++)
{
$row=@mysqli_fetch_array($res);
$instance=$row[instanceNo]+0;
$pos=$index_mirror[$instance][Index];
//$linkset[$index][Status]=$row[initValue]+0;
$linkset[$index][Status]=$statusSet[LinkSetStatus][$instance]+0;
}
$status_value=array(0=>"N",1=>"Y",2=>"I",3=>"--");
$status_color=array(0=>"#ff0000",1=>"#0000ff",2=>"#cecece",3=>"#000000");
for($index=0;$index<$linksetCount;$index++)
{
if(strlen($linkset[$index][Title])>0)
$value=$linkset[$index][Instance]."[".$linkset[$index][Title]."]";
else
$value=$linkset[$index][Instance];
$response.="obj".$field_sep."ls_title_id_{$index}".$field_sep.$value.$field_sep."#000000".$line_sep;
$value=$linkset[$index][Status]+0;
$response.="obj".$field_sep."ls_status_id_{$index}".$field_sep.$status_value[$value].$field_sep.$status_color[$value].$line_sep;
}
//get link status
$tmpwhere=getLevel($link_lsID_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere $linkset_id_cond order by instanceNo asc ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
for($index=0;$index<$num;$index++)
{
$row=@mysqli_fetch_array($res);
$ls_instance=$row[initValue]+0;
$lk_instance=$row[instanceNo]+0;
$ls_index=$index_mirror[$ls_instance][Index];
$lk_index=$linkset[$ls_index][LinkIndex];
$lkInfo=getLinkInfo($mtp3_param_table,$link_title_oid,$link_status_oid,$lk_instance);
$value=$lk_instance;
//$color=$status_color[$lkInfo[Status]];
$color=$status_color[$statusSet[LinkStatus][$lk_instance]];
$response.="obj".$field_sep."lk_status_id_{$ls_index}_{$lk_index}".$field_sep."{$value}".$field_sep."{$color}".$line_sep;
//$response.="title".$field_sep."lk_title_id_{$ls_index}_{$lk_index}".$field_sep."{$lkInfo[Title]}".$line_sep;
$linkset[$ls_index][LinkIndex]++;
}
for($index=0;$index<$num;$index++)
{
for($j=$linkset[$index][LinkIndex];$j<$maxRowPerPage;$j++)
{
$response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$field_sep."#000000".$line_sep;
//$response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$line_sep;
}
}
$response=substr($response,0,strlen($response)-1);
//system("date >> /tmp/test.txt");
echo $response;
?>
+187
View File
@@ -0,0 +1,187 @@
<?php
//Include the head file
require("../../inc/header.inc");
?>
<script language="JavaScript">
function updateStatus(flag)
{
var current_page_no=document.getElementById('current_page_no').value;
//alert(current_page_no);
var fixurl="./linksetStatus_deal.php?current_page_no="+current_page_no;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
else
request_oo = new XMLHttpRequest();
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
getRes();
}
request_oo.send(null);
if(flag == 1)
setTimeout("updateStatus("+flag+")", 10000);
}
function getRes()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
//alert(response);
//return;
var module=response.split(';');
//alert(module.length);
for(pos=0;pos<module.length;pos++)
{
var items=module[pos].split(',');
var types=items[0].replace(/(^\s*)|(\s*$)/g, "");
//alert(types);
if(types == 'obj')
{
var item_id=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_val=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_col=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
document.getElementById(item_id).style.color=item_col;
document.getElementById(item_id).innerHTML=item_val;
}
else if(types == 'title')
{
var item_id=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_val=items[2].replace(/(^\s*)|(\s*$)/g, "");
document.getElementById(item_id).title=item_val;
}
else if(types == 'page_count')
{
var prev_page_count=document.getElementById('prev_page_count').value;
if(prev_page_count != items[1])
{
//alert('page_count');
var sel_obj=document.getElementById('page_select');
for(i=sel_obj.length-1;i>=0;i--)
{
sel_obj[i]=null;
}
var opt_len=0;
for(i=0;i<items[1];i++)
{
var nam="Linkset "+(i*16)+" - "+(i*16+15);
sel_obj[opt_len]=new Option(nam,i);
opt_len++;
}
document.getElementById('prev_page_count').value=items[1];
}
}
else if(types == 'layer')
{
//alert('layer');
var item_id=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_val=items[2].replace(/(^\s*)|(\s*$)/g, "");
if(item_val == 'hide')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
function changepage()
{
document.getElementById('current_page_no').value=document.getElementById('page_select').value;
updateStatus(0);
}
</script>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$maxRowPerPage=16;
adjust_head();
adjust_title_head();
echo "<form name=\"statusForm\" method=\"post\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > MTP3 Status > LinkSet";
echo "</td>";
echo "<td width=\"50%\" align=\"right\">";
$helpId="1.2.4";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "<select id=\"page_select\" onchange=\"javascript:changepage();\">";
echo "</select>";
echo "</td>";
echo "<td width=\"50%\" align=right>";
echo "<a href=\"./plat_test_status.php\" target=\"_self\"><img style=\"vertical-align:middle;\" border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
//echo "<center><font color=blue size=2>Linkset Status</font></center><p>";
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<caption><center><font color=blue size=2>Linkset Status</font></center></caption>";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=\"10%\" align=\"center\">Name</td>";
echo "<td width=\"6%\" align=\"center\">Status</td>";
echo "<td width=\"84%\" align=\"center\" colspan=\"16\">Links Status</td>";
echo "</tr>";
echo "<tr id=\"blank_row_id\"><td>--</td><td>--</td><td colspan=16>--</td></tr>";
for($i=0;$i<$maxRowPerPage;$i++)
{
echo "<tr id=\"row_id_{$i}\">";
echo "<td>";
echo "<span id=\"ls_title_id_{$i}\">--</span>";
echo "</td>";
echo "<td align=\"center\">";
echo "<span id=\"ls_status_id_{$i}\">--</span>";
echo "</td>";
for($j=0;$j<16;$j++)
{
echo "<td width=\"5%\" id=\"lk_title_id_{$i}_{$j}\">";
echo "<span id=\"lk_status_id_{$i}_{$j}\">--</span>";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "Remarks: <font color=blue>Y</font> = Available, <font color=red>N</font> = Unavailable, <font color=#CCCCCC>I</font> = Inhibited.";
echo "<input type=hidden value=\"0\" id=\"prev_page_count\">";
echo "<input type=hidden value=\"0\" id=\"current_page_no\">";
echo "</form>";
adjust_content_tail();
?>
<script language="JavaScript">
updateStatus(1);
</script>
+388
View File
@@ -0,0 +1,388 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > PLAT Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
foreach($config as $key => $val)
{
if($config[$key][PlatformID] == $sysNo)
{
$thisconfig=$config[$key];
break;
}
}
$tmpconf[PlatNo]=$sysNo;
$plat=GetPlatInfo($tmpconf,$subSysNo);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
echo "<br><center><font color=\"blue\">{$thisconfig[PlatformName]}_$subSysNo platform information</font></center>";
echo "<table width=100% border=1 cellpadding=1 cellspacing=0 bordercolor=#666666 bordercolordark=#FFFFFF bgcolor=\"#ffffff\">";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Status</td>";
echo "<td>";
//platform Status
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Refresh Time</td>";
echo "<td>";
//Refresh Time
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Start Time</td>";
echo "<td>";
//Start Time
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>CPU Usage</td>";
echo "<td>";
//CPU Usage PN
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
//CPU Usage Rate
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Physical Memory</td>";
echo "<td>";
//Physical Memory Used/Total
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
echo "(Used/Total)";
echo "<br>";
//Physical Memory Used/Swap
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
echo "(Used/Swap)";
echo "<br>";
$id=AssignID();
echo "Buffers:";
echo "&nbsp;";
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo ";&nbsp;";
$id=AssignID();
echo "Cached:";
echo "&nbsp;";
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "<br>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=left bgcolor=\"#E6E6E6\" width=50%>Harddisk Space</td>";
echo "<td>";
//Harddisk, support 16 harddisk
for($i=0;$i<16;$i++)
{
$id=AssignID();
if($i==0)
echo "<span id=\"{$id}\">";
else
echo "<span id=\"{$id}\" style=\"display:none;\">";
$id=AssignID();
$val=GetProcessLabel(0);
echo "<input id=\"{$id}\" value=\"{$val}\" readonly type=text size=18 style=\"font-family:Arial; color:#3366aa; background-color:#ffffff; padding:0px; border-style:double; border-width:1px;height:14px;border-color:#222222;font-size:12px;\">";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "&nbsp;";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">";
echo "--";
echo "</span>";
echo "<br>";
echo "</span>";
}
echo "</td>";
echo "</tr>";
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(sysNo,subSysNo)
{
var fixurl="./plat_status_update.php?sysNo="+sysNo+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+sysNo+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
//alert(response);
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
function GetLabel(pn)
{
switch(pn)
{
case '0':
case 0:
return '';
case '1':
case 1:
return '¨�';
case '2':
case 2:
return '¨�¨�';
case '3':
case 3:
return '¨�¨�¨�';
case '4':
case 4:
return '¨�¨�¨�¨�';
case '5':
case 5:
return '¨�¨�¨�¨�¨�';
case '6':
case 6:
return '¨�¨�¨�¨�¨�¨�';
case '7':
case 7:
return '¨�¨�¨�¨�¨�¨�¨�';
case '8':
case 8:
return '¨�¨�¨�¨�¨�¨�¨�¨�';
case '9':
case 9:
return '¨�¨�¨�¨�¨�¨�¨�¨�¨�';
case '10':
case 10:
return '¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�';
}
return '';
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$sysNo','$subSysNo');\n";
echo "</script>\n";
?>
+181
View File
@@ -0,0 +1,181 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
foreach($config as $key => $val)
{
if($config[$key][PlatformID] == $sysNo)
{
$thisconfig=$config[$key];
break;
}
}
$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$sysNo} and subSysNo=$subSysNo ";
//echo "$sql<br>";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
exit();
$tmpconf[PlatNo]=$sysNo;
$plat=GetPlatInfo($tmpconf,$subSysNo);
//platform Status
$id=AssignID();
$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$sysNo} and subSysNo=$subSysNo ";
//echo "$sql<br>";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num != 1)
{
$baseStat=0;
}
else
{
$row=@mysqli_fetch_array($res);
$baseStat=$row[baseStat]+0;
}
$refresh_time=$row[updateTime];
$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y")));
$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y")));
if($refresh_time < $due_date || $refresh_time > $ove_date)
{
$valid_time=0;
}
else
{
$valid_time=1;
}
if($valid_time == 0 || $baseStat == 0)
$total_response.="$id,block,N,#ff0000;";
else
$total_response.="$id,block,Y,#0000ff;";
//Refresh Time
$id=AssignID();
if($valid_time)
$total_response.="$id,block,$refresh_time,#0000ff;";
else
$total_response.="$id,block,$refresh_time,#ff0000;";
//Start Time
$id=AssignID();
if(trim($plat[StartTime][Value]) == "")
$total_response.="$id,block,--,#000000;";
else
$total_response.="$id,block,{$plat[StartTime][Value]},#0000ff;";
//CPU Usage PN
$id=AssignID();
$message="{$id},{$plat[CPURatePN][Display]},{$plat[CPURatePN][Value]},{$plat[CPURatePN][Color]};";
$total_response.=$message;
//CPU Usage
$id=AssignID();
$message="{$id},{$plat[CPURate][Display]},{$plat[CPURate][Value]},{$plat[CPURate][Color]};";
$total_response.=$message;
//Physical Memory
$id=AssignID();
$message="{$id},{$plat[PMTotalRatePN][Display]},{$plat[PMTotalRatePN][Value]},{$plat[PMTotalRatePN][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMTotalRate][Display]},{$plat[PMTotalRate][Value]},{$plat[PMTotalRate][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMTotalRateV][Display]},{$plat[PMTotalRateV][Value]},{$plat[PMTotalRateV][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMSwapRatePN][Display]},{$plat[PMSwapRatePN][Value]},{$plat[PMSwapRatePN][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMSwapRate][Display]},{$plat[PMSwapRate][Value]},{$plat[PMSwapRate][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMSwapRateV][Display]},{$plat[PMSwapRateV][Value]},{$plat[PMSwapRateV][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMBuffers][Display]},{$plat[PMBuffers][Value]},{$plat[PMBuffers][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[PMCached][Display]},{$plat[PMCached][Value]},{$plat[PMCached][Color]};";
$total_response.=$message;
//Harddisk
for($i=0;$i<16;$i++)
{
if($i<$plat[HDNum])
{
$id=AssignID();
$message="{$id},layerShow,no,no;";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][PN][Display]},{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][Rate][Display]},{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][V][Display]},{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};";
$total_response.=$message;
$id=AssignID();
$message="{$id},{$plat[HD][$i][Path][Display]},{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};";
$total_response.=$message;
}
else
{
$id=AssignID();
$message="{$id},layerHide,no,no;";
$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};";
//$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};";
//$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};";
//$total_response.=$message;
$id=AssignID();
$message="{$id},none,{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};";
//$total_response.=$message;
}
}
echo "$total_response";
?>
+639
View File
@@ -0,0 +1,639 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<script language="JavaScript">
function clearAll()
{
window.location.href="./plat_test_status.php?clearAll=1";
}
</script>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\" action=\"./server_status.php\" method=\"post\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > Plat Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=# onClick=\"javascript:clearAll();\"><img align=absBottom border=0 src=\"../../images/delete.gif\" width=\"14\" height=\"14\">Clear</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
$config=parse_ini_file("../platStatus/config.ini",true);
$config_count=sizeof($config);
if(0)
{
echo "config_count=$config_count<br>";
echo "<pre>";
print_r($config);
echo "</pre>";
}
if($clearAll == 1)
{
//echo "clear<br>";
$sql="delete from OMC_PUB.sysInfo where sysTypeNo=200 ";
@mysqli_query($pubConn,$sql);
echo mysqli_error($pubConn);
}
echo "<br><center><font color=\"blue\">Platform summary information</font></center>";
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#ffffff\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td>Item</td>";
echo "<td>Application status</td>";
echo "<td>IPTRANS</td>";
echo "<td>MTP3</td>";
echo "<td>SCCP</td>";
echo "<td>TCAP</td>";
echo "<td>SNMP</td>";
echo "<td>DEBUG</td>";
echo "<td>SMPP</td>";
echo "<td>PLAT STATUS</td>";
echo "<td>Refresh Time</td>";
echo "<td>IP Address</td>";
echo "</tr>";
echo "<tr id=\"blank_line\">";
echo "<td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td>";
echo "</tr>";
foreach($config as $key => $val)
{
if(strcmp($key,"PlatSysTypeNo")==0)
{
continue;
}
if($config[$key][PlatformID] == 0)
{
for($j=0;$j<2;$j++)
{
//Rowline
$id=AssignID();
echo "<tr id=\"$id\" style=\"display:none;\">";
//Item Name
echo "<td>{$config[$key][PlatformName]}_{$j}</td>";
//Application status
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</a>";
echo "</td>";
//IPTRANS
$id=AssignID();
echo "<td>";
echo "<a href=\"./iptrans_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//MTP3
$id=AssignID();
echo "<td>";
echo "<a href=\"./linksetStatus_show.php\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SCCP
$id=AssignID();
echo "<td>";
echo "<a href=\"./sccp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//TCAP
$id=AssignID();
echo "<td>";
echo "<a href=\"./tcap_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SNMP
$id=AssignID();
echo "<td>";
echo "<a href=\"./snmp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//DEBUG
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//SMPP
$id=AssignID();
echo "<td>";
echo "<a href=\"./smpp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//PLAT STATUS
$id=AssignID();
echo "<td>";
echo "<a href=\"./plat_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//Refresh Time
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//IP Address
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
}
}
if($config[$key][PlatformID] == 8)
{
for($j=0;$j<10;$j++)
{
//Rowline
$id=AssignID();
echo "<tr id=\"$id\" style=\"display:none;\">";
//Item Name
echo "<td>{$config[$key][PlatformName]}_{$j}</td>";
//Application status
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</a>";
echo "</td>";
//IPTRANS
$id=AssignID();
echo "<td>";
echo "<a href=\"./iptrans_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//MTP3
$id=AssignID();
echo "<td>";
echo "<a href=\"./linksetStatus_show.php\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SCCP
$id=AssignID();
echo "<td>";
echo "<a href=\"./sccp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//TCAP
$id=AssignID();
echo "<td>";
echo "<a href=\"./tcap_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SNMP
$id=AssignID();
echo "<td>";
echo "<a href=\"./snmp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//DEBUG
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//SMPP
$id=AssignID();
echo "<td>";
echo "<a href=\"./smpp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//PLAT STATUS
$id=AssignID();
echo "<td>";
echo "<a href=\"./plat_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//Refresh Time
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//IP Address
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
}
}
if($config[$key][PlatformID] == 9)
{
for($j=0;$j<2;$j++)
{
//Rowline
$id=AssignID();
echo "<tr id=\"$id\" style=\"display:none;\">";
//Item Name
echo "<td>{$config[$key][PlatformName]}_{$j}</td>";
//Application status
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</a>";
echo "</td>";
//IPTRANS
$id=AssignID();
echo "<td>";
echo "<a href=\"./iptrans_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//MTP3
$id=AssignID();
echo "<td>";
echo "<a href=\"./linksetStatus_show.php\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SCCP
$id=AssignID();
echo "<td>";
echo "<a href=\"./sccp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//TCAP
$id=AssignID();
echo "<td>";
echo "<a href=\"./tcap_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SNMP
$id=AssignID();
echo "<td>";
echo "<a href=\"./snmp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//DEBUG
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//SMPP
$id=AssignID();
echo "<td>";
echo "<a href=\"./smpp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//PLAT STATUS
$id=AssignID();
echo "<td>";
echo "<a href=\"./plat_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//Refresh Time
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//IP Address
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
}
}
if($config[$key][PlatformID] == 18)
{
for($j=0;$j<2;$j++)
{
//Rowline
$id=AssignID();
echo "<tr id=\"$id\" style=\"display:none;\">";
//Item Name
echo "<td>{$config[$key][PlatformName]}_{$j}</td>";
//Application status
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</a>";
echo "</td>";
//IPTRANS
$id=AssignID();
echo "<td>";
echo "<a href=\"./iptrans_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//MTP3
$id=AssignID();
echo "<td>";
echo "<a href=\"./linksetStatus_show.php\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SCCP
$id=AssignID();
echo "<td>";
echo "<a href=\"./sccp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</a>";
echo "</td>";
//TCAP
$id=AssignID();
echo "<td>";
echo "<a href=\"./tcap_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//SNMP
$id=AssignID();
echo "<td>";
echo "<a href=\"./snmp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//DEBUG
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//SMPP
$id=AssignID();
echo "<td>";
echo "<a href=\"./smpp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#FF0000;\">$id</span>";
echo "</a>";
echo "</td>";
//PLAT STATUS
$id=AssignID();
echo "<td>";
echo "<a href=\"./plat_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$j\">";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</a>";
echo "</td>";
//Refresh Time
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
//IP Address
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
}
}
}
echo "<table>";
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=# onClick=\"javascript:clearAll();\"><img align=absBottom border=0 src=\"../../images/delete.gif\" width=\"14\" height=\"14\">Clear</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
if($clearAll)
{
echo "<script language=\"JavaScript\">\n";
echo "document.getElementById('blank_line').style.display='';\n";
echo "</script>\n";
}
echo "</form>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus()
{
var fixurl="./plat_test_status_update.php";
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus()", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
//alert(response);
var module=response.split(';');
//alert("module.length="+module.length);
for(i=0;i<module.length;i++)
{
var items=module[i].split(',');
//alert(items.length);
if(items.length != 4)
continue;
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
var item_state=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
//alert("item_id="+item_id+",item_state="+item_state+",item_value="+item_value+",item_color="+item_color);
if(item_state == 'block')
{
document.getElementById(item_id).style.display='';
}
else
{
document.getElementById(item_id).style.display='none';
}
if(item_value != 'none')
{
document.getElementById(item_id).innerHTML=item_value;
}
if(item_color != 'none')
{
document.getElementById(item_id).style.color=item_color;
}
}
}
}
updateStatus();
</script>
+156
View File
@@ -0,0 +1,156 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc")
?>
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
$config=parse_ini_file("../platStatus/config.ini",true);
$config_count=sizeof($config);
$total_response="";
$show_num=0;
foreach($config as $key => $val)
{
if(strcmp($key,"PlatSysTypeNo")==0)
{
continue;
}
for($sys=0;$sys<$config[$key][PlatformNo];$sys++)
{
$sql="select * from OMC_PUB.sysInfo where sysTypeNo={$config[PlatSysTypeNo]} and sysNo={$config[$key][PlatformID]} and subSysNo={$sys} ";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
// $module_vertion=GetModuleVersion({$config[PlatSysTypeNo]},{$config[$key][PlatformID]},{$sysNo});
if($num == 0)
{
$id=AssignID();
$total_response.="$id,none,none,none;";
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
$id=AssignID();
continue;
}
else
{
$row=@mysqli_fetch_array($res);
$id=AssignID();
$total_response.="$id,block,none,none;";
$platDetailInfo=GetDetailPlatInfo($config[$key][PlatformID],$sys,9999);
$debug_message="GetDetailPlatInfo($config[$key][PlatformID],$sys,9999);<br>";
debug_log("/tmp/test.txt",$debug_message);
//Application status
$id=AssignID();
if(strcmp($platDetailInfo[Application][Status][Value],"--"))
$platDetailInfo[Application][Status][Value]="Y";
$total_response.="$id,block,{$platDetailInfo[Application][Status][Value]},#0000FF;";
//IPTRANS
$id=AssignID();
//if(strcmp($platDetailInfo[IPTRANS][Status][Value],"--"))
//$platDetailInfo[IPTRANS][Status][Value]="<a href=\"./iptrans_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[IPTRANS][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[IPTRANS][Status][Value]},{$platDetailInfo[IPTRANS][Status][Color]};";
//MTP3
$id=AssignID();
// if(strcmp($platDetailInfo[MTP3][Status][Value],"--"))
// $platDetailInfo[MTP3][Status][Value]="<a href=\"./linksetStatus_show.php\">".$platDetailInfo[MTP3][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[MTP3][Status][Value]},{$platDetailInfo[MTP3][Status][Color]};";
//SCCP
$id=AssignID();
//if(strcmp($platDetailInfo[SCCP][Status][Value],"--"))
//$platDetailInfo[SCCP][Status][Value]="<a href=\"./sccp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[SCCP][Status][Value]."</a>";
//$platDetailInfo[SCCP][Status][Value]=$platDetailInfo[SCCP][Status][Value];
$total_response.="$id,block,{$platDetailInfo[SCCP][Status][Value]},{$platDetailInfo[SCCP][Status][Color]};";
//TCAP
$id=AssignID();
//if(strcmp($platDetailInfo[TCAP][Status][Value],"--"))
//$platDetailInfo[TCAP][Status][Value]="<a href=\"./tcap_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[TCAP][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[TCAP][Status][Value]},{$platDetailInfo[TCAP][Status][Color]};";
//SNMP
$id=AssignID();
//if(strcmp($platDetailInfo[SNMP][Status][Value],"--"))
//$platDetailInfo[SNMP][Status][Value]="<a href=\"./snmp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[SNMP][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[SNMP][Status][Value]},{$platDetailInfo[SNMP][Status][Color]};";
//DEBUG
$id=AssignID();
//if(strcmp($platDetailInfo[DEBUG][Status][Value],"--"))
//$platDetailInfo[DEBUG][Status][Value]="<a href=\"./tcap_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[DEBUG][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[DEBUG][Status][Value]},{$platDetailInfo[DEBUG][Status][Color]};";
//SMPP
$id=AssignID();
//if(strcmp($platDetailInfo[SMPP][Status][Value],"--"))
//$platDetailInfo[SMPP][Status][Value]="<a href=\"./smpp_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[SMPP][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[SMPP][Status][Value]},{$platDetailInfo[SMPP][Status][Color]};";
//PLAT Status
$id=AssignID();
//if(strcmp($platDetailInfo[Application][Status][Value],"--"))
//$platDetailInfo[Application][Status][Value]="<a href=\"./plat_status.php?sysNo={$config[$key][PlatformID]}&subSysNo=$sys\">".$platDetailInfo[Application][Status][Value]."</a>";
$total_response.="$id,block,{$platDetailInfo[Application][Status][Value]},#0000FF;";
//Refresh Time
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},{$platDetailInfo[RefreshTime][Color]};";
//IP Address
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[IPAddress][Value]},{$platDetailInfo[IPAddress][Color]};";
$show_num++;
}
}
}
if($show_num)
$total_response.="blank_line,none,none,none;";
else
$total_response.="blank_line,block,none,none;";
debug_log("/tmp/test.txt",$total_response);
echo $total_response;
?>
+226
View File
@@ -0,0 +1,226 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > SCCP Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"./plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,2);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
$table_title="<font color=\"#0000FF\">SCCP</font>( Version:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=",";
$table_title.=" Status:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=",";
$table_title.="RefreshTime:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=")";
echo "<br><center>$table_title</center>";
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"left\" >Num</td>";
echo "<td align=\"left\" >Name</td>";
echo "</tr>";
for($i=0;$i<256;$i++)
{
echo "<tr id=\"$i\">";
$id=AssignID();
echo "<td><span id=\"{$id}\" style=\"color:#000000;\">--</span></td>";
$id=AssignID();
echo "<td><span id=\"{$id}\" style=\"color:#000000;\">--</span></td>";
echo "</tr>";
}
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
//echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
//echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
//echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(sysNo,subSysNo)
{
var fixurl="./sccp_status_update.php?sysNo="+sysNo+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+sysNo+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
//alert(response);
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.display='';
}
}
}
}
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$sysNo','$subSysNo');\n";
echo "</script>\n";
?>
+66
View File
@@ -0,0 +1,66 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,2);
//version
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[IPTRANS][Version][Value]},#0000FF;";
//Status
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[IPTRANS][Status][Value]},#0000FF;";
//RefreshTime
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},#0000FF;";
for($j=0;$j<256;$j++)
{
$id=AssignID();
if(strcmp($platDetailInfo[SCCP][LocalNode][$j][Flag],"1")==0)
{
$total_response.="$j,layerShow,,;";
$total_response.="$id,block,$j,#000000;";
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SCCP][LocalNode][$j][Value1]},#000000;";
}
else
{
$total_response.="$j,layerHide,,;";
$total_response.="$id,none,{$platDetailInfo[SCCP][LocalNode][254][Flag]},#000066;";
$id=AssignID();
$total_response.="$id,none,{$platDetailInfo[SCCP][LocalNode][254][Flag]},#000066;";
}
}
debug_log("/tmp/goodd.txt",$total_response);
echo "$total_response";
?>
+223
View File
@@ -0,0 +1,223 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > SMPP Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,9);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
$table_title="<font color=\"#0000FF\">SMPP</font>( Status:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
$table_title.=",";
$table_title.="RefreshTime:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
$table_title.=")";
echo "<br><center>$table_title</center>";
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "<td align=\"left\" >Port no</td>";
echo "<td align=\"left\" >Status</td>";
echo "</tr>";
for($i=0;$i<8;$i++)
{
echo "<tr>";
for($j=0;$j<4;$j++)
{
$dis_no=($j)*8+$i;
echo "<td>";
echo $dis_no;
echo "</td>";
echo "<td>";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">0</font> = Not initializing , <font color=\"black\">1</font> = Idle, <font color=\"red\">2</font> = Waiting, <font color=\"green\">3</font> =Established.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(sysNo,subSysNo)
{
var fixurl="./smpp_status_update.php?sysNo="+sysNo+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+sysNo+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
//alert(response);
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$sysNo','$subSysNo');\n";
echo "</script>\n";
?>
+52
View File
@@ -0,0 +1,52 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,9);
//Status
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SMPP][Status][Value]},#0000FF;";
//RefreshTime
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},#0000FF;";
//port
for($i=0;$i<8;$i++)
{
for($j=0;$j<4;$j++)
{
$id=AssignID();
$dis_port=($j)*8+$i;
if(strcmp($platDetailInfo[SMPP][Status][Value],"Y"))
$total_response.="$id,block,-,#000000};";
else
$total_response.="$id,block,{$platDetailInfo[SMPP][SMPPLink][$dis_port][Value]},{$platDetailInfo[SMPP][SMPPLink][$dis_port][Color]};";
}
}
echo "$total_response";
?>
+237
View File
@@ -0,0 +1,237 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > SNMP Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,4);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
$table_title="<font color=\"#0000FF\">SNMP</font>( Version:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=",";
$table_title.=" Status:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=",";
$table_title.="RefreshTime:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=")";
echo "<br><center>$table_title</center>";
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"left\" >Function type</td>";
echo "<td align=\"left\" >Registered number</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\" >TARP</td>";
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\" >SET</td>";
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\" >GET</td>";
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\" >RSP</td>";
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">$id</span>";
echo "</td>";
echo "</tr>";
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(sysNo,subSysNo)
{
var fixurl="./snmp_status_update.php?sysNo="+sysNo+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+sysNo+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
//alert(response);
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$sysNo','$subSysNo');\n";
echo "</script>\n";
?>
+59
View File
@@ -0,0 +1,59 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,4);
//version
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SNMP][Version][Value]},#0000FF;";
//Status
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SNMP][Status][Value]},#0000FF;";
//RefreshTime
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},#0000FF;";
//TARP
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SNMP][TrapFuncCount][Value]},{$platDetailInfo[SNMP][TrapFuncCount][Color]};";
//set
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SNMP][SetFuncCount][Value]},{$platDetailInfo[SNMP][SetFuncCount][Color]};";
//get
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SNMP][GetFuncCount][Value]},{$platDetailInfo[SNMP][GetFuncCount][Color]};";
//rsp
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[SNMP][RspFuncCount][Value]},{$platDetailInfo[SNMP][RspFuncCount][Color]};";
echo "$total_response";
?>
+212
View File
@@ -0,0 +1,212 @@
<?php
require("../../inc/header.inc");
require("../serverStatusImprove/function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
?>
<?php
adjust_head();
adjust_title_head();
echo "<FORM NAME=\"downForm\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Advanced > TCAP Status";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "&nbsp;";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
if(0)
{
echo "subSysNo=$subSysNo,platID=$platID<br>";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,3);
if(0)
{
echo "<pre>";
print_r($plat);
echo "</pre>";
}
$table_title="<font color=\"#0000FF\">TCAP</font>( Version:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=",";
$table_title.=" Status:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=",";
$table_title.="RefreshTime:";
$id=AssignID();
$table_title.="<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
$table_title.=")";
echo "<br><center>$table_title</center>";
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"left\" >Current Used Dialogue ID</td>";
echo "<td align=\"left\" >Max Used Dialogue ID</td>";
echo "</tr>";
echo "<tr>";
$id=AssignID();
echo "<td>";
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
echo "<td>";
$id=AssignID();
echo "<span id=\"{$id}\" style=\"color:#000000;\">--</span>";
echo "</td>";
echo "</tr>";
echo "</table>";
//Remark Table
echo "<table border=\"0\" width=\"100%\" cellpadding=1 cellspacing=0>";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Remarks: <font color=\"blue\">Y</font> = Normal, <font color=\"red\">N</font> = Abnormal, -- = None.";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
echo "<a href=\"plat_test_status.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">Back</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_content_tail();
?>
<script language="JavaScript">
function updateStatus(sysNo,subSysNo)
{
var fixurl="./tcap_status_update.php?sysNo="+sysNo+"&subSysNo="+subSysNo;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
{
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_oo = new XMLHttpRequest();
}
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
checUpdateState();
}
request_oo.send(null);
setTimeout("updateStatus('"+sysNo+"','"+subSysNo+"')", 10000);
}
function checUpdateState()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
response=response.replace(/(^\s*)|(\s*$)/g, "");
//alert(response);
if(response == "")
return;
var objects=response.split(';');
//alert(objects.length);
for(i=0;i<objects.length;i++)
{
var items=objects[i].split(',');
var item_id=items[0].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
var item_display=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_value=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_color=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(item_display == 'Rect')
{
document.getElementById(item_id).value=GetLabel(item_value);
document.getElementById(item_id).style.color='#3366aa';
}
else if(item_display == 'layerShow')
{
document.getElementById(item_id).style.display='';
}
else if(item_display == 'layerHide')
{
document.getElementById(item_id).style.display='none';
}
else
{
document.getElementById(item_id).style.color=item_color;
document.getElementById(item_id).innerHTML=item_value;
if(item_display == 'none')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
</script>
<?php
echo "\n<script language=\"JavaScript\">\n";
echo "updateStatus('$sysNo','$subSysNo');\n";
echo "</script>\n";
?>
+60
View File
@@ -0,0 +1,60 @@
<?php
require("../../inc/lib.inc");
require("../serverStatusImprove/function.inc");
$global_id=0;
function AssignID()
{
global $global_id;
$id="ID_{$global_id}";
$global_id++;
return $id;
}
if(0)
{
echo "platID=$platID,subSysNo=$subSysNo";
}
$config=parse_ini_file("config.ini",true);
$config_count=sizeof($config);
$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,3);
//version
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[TCAP][Version][Value]},#0000FF;";
//Status
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[TCAP][Status][Value]},{$platDetailInfo[TCAP][Status][Color]};";
//RefreshTime
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},#0000FF;";
//port
if(strcmp($platDetailInfo[TCAP][Status][Value],"--"))
{
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[TCAP][CurrentUsedDialogueID][Value]},{$platDetailInfo[TCAP][CurrentUsedDialogueID][Color]};";
$id=AssignID();
$total_response.="$id,block,{$platDetailInfo[TCAP][MaxUsedDialogueID][Value]},{$platDetailInfo[TCAP][MaxUsedDialogueID][Color]};";
}
else
{
$id=AssignID();
$total_response.="$id,block,--,#000000;";
$id=AssignID();
$total_response.="$id,block,--,#000000;";
}
echo "$total_response";
?>
BIN
View File
Binary file not shown.
+329
View File
@@ -0,0 +1,329 @@
<?php
require("../../inc/lib.inc");
?>
<?php
$maxRowPerPage=16;
$mtp3_systypeno=222;
$plat_systypeno=200;
$mss_platno=9;
$mtp3_modid=1;
$linkset_index_name="lsIndex";
$linkset_title_name="lsTitle";
$linkset_status_name="lsStatus";
$link_index_name="lkIndex";
$link_title_name="lkTitle";
$link_status_name="lkLinkStatus";
$link_lsID_name="lkLinkSetID";
$field_sep=",";
$line_sep=";";
global $OMC_server;
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OBJ_".$mtp3_systypeno);
$current_page_no=$_REQUEST['current_page_no'];
function GetOIDByName($sysTypeNo,$name)
{
global $mss_platno,$plat_systypeno,$OMC_server;
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OBJ_".$sysTypeNo);
$database="OBJ_".$sysTypeNo.".paramConf";
$sql="select * from $database where name_2 like '%$name%' ";
$res=@mysqli_query($objDbConn,$sql);
$row=@mysqli_fetch_array($res);
$oids="";
for($i=1;$i<=10;$i++)
{
$tmpN="level_".$i;
$tmpV=$row[$tmpN]+0;
if($tmpV == 0)
break;
$oids.=$tmpV.".";
}
if($i>1)
$oids=substr($oids,0,strlen($oids)-1);
return $oids;
}
function getLevel($objIdStr)
{
$levelArr=explode('.',$objIdStr);
for($j=0;$j<sizeof($levelArr);$j++)
{
$levelNo=$j+1;
${"level_$levelNo"}=$levelArr[$j];
if($Debug) echo "<BR>levelArr[$j]={$levelArr[$j]}";
if($j == 0){
$levelWhere ="level_$levelNo='${"level_$levelNo"}'";
}else{
$levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'";
}
}
$levelNo+=1;
if($levelNo<=10)
$levelWhere.=" AND level_$levelNo=0 ";
return($levelWhere);
}
function getLinkInfo($table,$titleoid,$statusoid,$instance)
{
global $OMC_server,$mtp3_systypeno;
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OBJ_".$mtp3_systypeno);
$instanceNo=omc_keep_length($instance,"0",4);
$tmpwhere=getLevel($titleoid);
$sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' ";
//echo "sql=$sql<br>";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
$linkInfo[Title]="";
else
{
$row=@mysqli_fetch_array($res);
$linkInfo[Title]=$row[initValue];
}
$tmpwhere=getLevel($statusoid);
$sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' ";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
$linkInfo[Status]=0;
else
{
$row=@mysqli_fetch_array($res);
$linkInfo[Status]=$row[initValue]+0;
}
return $linkInfo;
}
function getStatusByHeartbeat()
{
global $mss_platno,$plat_systypeno,$OMC_server;
$pubConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OMC_PUB");
$sql="select * from OMC_PUB.sysStat where sysTypeNo=$plat_systypeno and sysNo=$mss_platno order by updateTime desc ";
$res=@mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num == 0)
return $StatusSet;
$row=@mysqli_fetch_array($res);
$baseStat=$row[detailStat];
$compStat=substr($baseStat,38);
$compStatLen=strlen($compStat)-1;
//echo "$compStat<br>";
$index=0;
$i=0;
while($i<$compStatLen)
{
$tmp=substr($compStat,$i,4);
$component[$index][ID]=$tmp+0;
$i+=4;
$tmp=substr($compStat,$i,4);
$component[$index][Length]=hexdec($tmp);
$i+=4;
$component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2);
$i+=$component[$index][Length]*2;
$index++;
}
if($component[1][Length] == 0)
return $StatusSet;
$mtp3_hb=$component[1][Content];
$pos=0;
$link_hb=substr($mtp3_hb,8,256*2);
$linkset_hb=substr($mtp3_hb,520,128*2);
for($i=0;$i<256;$i++)
{
$tmpi=hexdec(substr($link_hb,$i*2,2));
$tmpb=omc_keep_length(decbin($tmpi),"0",8);
$tmpb=strrev($tmpb);
for($j=0;$j<4;$j++)
{
$tmp2bit=strrev(substr($tmpb,$j*2,2));
$StatusSet[LinkStatus][$i*4+$j]=bindec($tmp2bit);
}
}
for($i=0;$i<128;$i++)
{
$tmpi=hexdec(substr($linkset_hb,$i*2,2));
$tmpb=omc_keep_length(decbin($tmpi),"0",8);
$tmpb=strrev($tmpb);
for($j=0;$j<4;$j++)
{
$tmp2bit=strrev(substr($tmpb,$j*2,2));
$tt=$i*4+$j;
$yy=bindec($tmp2bit);
$StatusSet[LinkSetStatus][$i*4+$j]=bindec($tmp2bit);
}
}
return $StatusSet;
}
?>
<?php
$mtp3_param_table="OBJ_".$mtp3_systypeno.".param_".$mss_platno;
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],"OBJ_".$mtp3_systypeno);
$linkset_index_oid=GetOIDByName($mtp3_systypeno,$linkset_index_name);
$linkset_title_oid=GetOIDByName($mtp3_systypeno,$linkset_title_name);
$linkset_status_oid=GetOIDByName($mtp3_systypeno,$linkset_status_name);
$link_index_oid=GetOIDByName($mtp3_systypeno,$link_index_name);
$link_title_oid=GetOIDByName($mtp3_systypeno,$link_title_name);
$link_status_oid=GetOIDByName($mtp3_systypeno,$link_status_name);
$link_lsID_oid=GetOIDByName($mtp3_systypeno,$link_lsID_name);
$response="";
//get the page list
$tmpwhere=getLevel($linkset_index_oid);
$sql="select * from $mtp3_param_table where $tmpwhere ";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
$page_count=ceil($num/$maxRowPerPage);
$response.="page_count".$field_sep.$page_count.$line_sep;
//get the linkset index
$tmpwhere=getLevel($linkset_index_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage ";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
$linksetCount=$num;
//system("echo '$sql' >> /tmp/test.txt");
if($num > 0)
$response.="layer".$field_sep."blank_row_id".$field_sep."hide".$line_sep;
else
$response.="layer".$field_sep."blank_row_id".$field_sep."show".$line_sep;
for($index=0;$index<$maxRowPerPage;$index++)
{
//system("echo 'linksetCount=$linksetCount' >> /tmp/test.txt");
if($index < $linksetCount)
$response.="layer".$field_sep."row_id_{$index}".$field_sep."show".$line_sep;
else
$response.="layer".$field_sep."row_id_{$index}".$field_sep."hide".$line_sep;
}
$linkset_id_cond=" and (";
for($index=0;$index < $num;$index++)
{
$row=@mysqli_fetch_array($res);
$linkset[$index][Instance]=$row[instanceNo]+0;
$linkset_id_cond.=" initValue={$linkset[$index][Instance]} ";
if($index != ($num-1))
$linkset_id_cond.=" or ";
$linkset[$index][LinkIndex]=0;
$index_mirror[$linkset[$index][Instance]][Index]=$index;
}
$linkset_id_cond.=") ";
if($num == 0)
$linkset_id_cond="";
$statusSet=getStatusByHeartbeat();
//get linkset status and title
$tmpwhere=getLevel($linkset_title_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage ";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
for($index=0;$index < $num;$index++)
{
$row=@mysqli_fetch_array($res);
$instance=$row[instanceNo]+0;
$pos=$index_mirror[$instance][Index];
$linkset[$index][Title]=$row[initValue];
}
$tmpwhere=getLevel($linkset_status_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage ";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
for($index=0;$index < $num;$index++)
{
$row=@mysqli_fetch_array($res);
$instance=$row[instanceNo]+0;
$pos=$index_mirror[$instance][Index];
//$linkset[$index][Status]=$row[initValue]+0;
$linkset[$index][Status]=$statusSet[LinkSetStatus][$instance]+0;
}
$status_value=array(0=>"N",1=>"Y",2=>"I",3=>"--");
$status_color=array(0=>"#ff0000",1=>"#0000ff",2=>"#cecece",3=>"#000000");
for($index=0;$index<$linksetCount;$index++)
{
if(strlen($linkset[$index][Title])>0)
$value=$linkset[$index][Instance]."[".$linkset[$index][Title]."]";
else
$value=$linkset[$index][Instance];
$response.="obj".$field_sep."ls_title_id_{$index}".$field_sep.$value.$field_sep."#000000".$line_sep;
$value=$linkset[$index][Status]+0;
$response.="obj".$field_sep."ls_status_id_{$index}".$field_sep.$status_value[$value].$field_sep.$status_color[$value].$line_sep;
}
//get link status
//echo "AAA=$link_lsID_oid<br>";
$tmpwhere=getLevel($link_lsID_oid);
$from=$current_page_no * $maxRowPerPage;
$sql="select * from $mtp3_param_table where $tmpwhere $linkset_id_cond order by instanceNo asc ";
//echo "SSSSS=$sql<br>";
$res=@mysqli_query($objDbConn,$sql);
$num=mysqli_num_rows($res);
for($index=0;$index<$num;$index++)
{
$row=@mysqli_fetch_array($res);
$ls_instance=$row[initValue]+0;
$lk_instance=$row[instanceNo]+0;
$ls_index=$index_mirror[$ls_instance][Index];
$lk_index=$linkset[$ls_index][LinkIndex];
$lkInfo=getLinkInfo($mtp3_param_table,$link_title_oid,$link_status_oid,$lk_instance);
$value=$lk_instance;
//$color=$status_color[$lkInfo[Status]];
$color=$status_color[$statusSet[LinkStatus][$lk_instance]];
$response.="obj".$field_sep."lk_status_id_{$ls_index}_{$lk_index}".$field_sep."{$value}".$field_sep."{$color}".$line_sep;
//$response.="title".$field_sep."lk_title_id_{$ls_index}_{$lk_index}".$field_sep."{$lkInfo[Title]}".$line_sep;
$linkset[$ls_index][LinkIndex]++;
}
for($index=0;$index<$num;$index++)
{
for($j=$linkset[$index][LinkIndex];$j<$maxRowPerPage;$j++)
{
$response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$field_sep."#000000".$line_sep;
//$response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$line_sep;
}
}
$response=substr($response,0,strlen($response)-1);
//system("date >> /tmp/test.txt");
echo $response;
?>
+195
View File
@@ -0,0 +1,195 @@
<?php
//Include the head file
require("../../inc/header.inc");
?>
<script language="JavaScript">
function updateStatus(flag)
{
var current_page_no=document.getElementById('current_page_no').value;
var fixurl="./linksetStatus_deal.php?current_page_no="+current_page_no;
var browserr = navigator.appName;
if(browserr == "Microsoft Internet Explorer")
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
else
request_oo = new XMLHttpRequest();
request_oo.open("GET",fixurl,"false");
request_oo.onreadystatechange=function()
{
getRes();
}
request_oo.send(null);
if(flag == 1)
setTimeout("updateStatus("+flag+")", 10000);
}
function getRes()
{
//not
if(request_oo.readyState == 3)
{
//alert("not finish");
}
if(request_oo.readyState == 4)
{
var response = request_oo.responseText;
//return;
var module=response.split(';');
//alert(document.getElementById('prev_page_count').value)
// var items=module[0].split(',');
// alert(items[1]);
for(pos=0;pos<module.length;pos++)
{
var items=module[pos].split(',');
var types=items[0].replace(/(^\s*)|(\s*$)/g, "");
//alert(types);
if(types == 'obj')
{
var item_id=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_val=items[2].replace(/(^\s*)|(\s*$)/g, "");
var item_col=items[3].replace(/(^\s*)|(\s*$)/g, "");
if(document.getElementById(item_id) == null)
continue;
document.getElementById(item_id).style.color=item_col;
document.getElementById(item_id).innerHTML=item_val;
}
else if(types == 'title')
{
var item_id=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_val=items[2].replace(/(^\s*)|(\s*$)/g, "");
document.getElementById(item_id).title=item_val;
}
else if(types == 'page_count')
{
var prev_page_count=document.getElementById('prev_page_count').value;
if(prev_page_count != items[1])
{
var sel_obj=document.getElementById('page_select');
for(i=sel_obj.length-1;i>=0;i--)
{
sel_obj[i]=null;
}
var opt_len=0;
for(i=0;i<items[1];i++)
{
var nam="Linkset "+(i*16)+" - "+(i*16+15);
sel_obj[opt_len]=new Option(nam,i);
opt_len++;
}
document.getElementById('prev_page_count').value=items[1];
}
}
else if(types == 'layer')
{
//alert('layer');
var item_id=items[1].replace(/(^\s*)|(\s*$)/g, "");
var item_val=items[2].replace(/(^\s*)|(\s*$)/g, "");
if(item_val == 'hide')
document.getElementById(item_id).style.display='none';
else
document.getElementById(item_id).style.display='';
}
}
}
}
function changepage()
{
document.getElementById('current_page_no').value=document.getElementById('page_select').value;
updateStatus(0);
}
</script>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
$maxRowPerPage=16;
adjust_head();
adjust_title_head();
echo "<form name=\"statusForm\" method=\"post\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "Status > NSS > LinkSet";
echo "</td>";
echo "<td width=\"50%\" align=\"right\">";
$helpId="1.2.4";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"50%\">";
echo "<select id=\"page_select\" onchange=\"javascript:changepage();\">";
echo "</select>";
echo "</td>";
echo "<td width=\"50%\" align=right>";
echo "<a href=\"$PHP_SELF?clear=1\" target=\"_self\"><img style=\"vertical-align:middle;\" border=0 src=\"../../images/delete.gif\" width=\"14\" height=\"14\">$strClear</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
//echo "<center><font color=blue size=2>Linkset Status</font></center><p>";
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
echo "<caption><center><font color=blue size=2>Linkset Status</font></center></caption>";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=\"10%\" align=\"center\">Name</td>";
echo "<td width=\"6%\" align=\"center\">Status</td>";
echo "<td width=\"84%\" align=\"center\" colspan=\"16\">Links Status</td>";
echo "</tr>";
echo "<tr id=\"blank_row_id\"><td>--</td><td>--</td><td colspan=16>--</td></tr>";
for($i=0;$i<$maxRowPerPage;$i++)
{
echo "<tr id=\"row_id_{$i}\">";
echo "<td>";
echo "<span id=\"ls_title_id_{$i}\">--</span>";
echo "</td>";
echo "<td align=\"center\">";
echo "<span id=\"ls_status_id_{$i}\">--</span>";
echo "</td>";
for($j=0;$j<16;$j++)
{
echo "<td width=\"5%\" id=\"lk_title_id_{$i}_{$j}\">";
echo "<span id=\"lk_status_id_{$i}_{$j}\">--</span>";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "Remarks: <font color=blue>Y</font> = Available, <font color=red>N</font> = Unavailable, <font color=#CCCCCC>I</font> = Inhibited.";
echo "<input type=hidden value=\"0\" id=\"prev_page_count\">";
echo "<input type=hidden value=\"0\" id=\"current_page_no\">";
echo "</form>";
adjust_content_tail();
?>
<script language="JavaScript">
updateStatus(1);
</script>
+64
View File
@@ -0,0 +1,64 @@
<script language="JavaScript">
function beginDrag(elementToDrag,event)
{
var deltaX=event.clientX-parseInt(elementToDrag.style.left);
var deltaY=event.clientY-parseInt(elementToDrag.style.top);
if(document.addEventListener)
{
document.addEventListener("mousemove",moveHandler,true);
document.addEventListener("mouseup",upHandler,true);
}
else if(document.attachEvent)
{
document.attachEvent("onmousemove",moveHandler);
document.attachEvent("onmouseup",upHandler);
}
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
if(event.preventDefault)
event.preventDefault();
else
event.returnValue=false;
function moveHandler(e)
{
  if (!e) e=window.event; //如果是IE的事件对象,那么就用window.event
  //全局属性,否则就用DOM二级标准的Event对象。
elementToDrag.style.left=(event.clientX-deltaX)+"px";
elementToDrag.style.top=(event.clientY-deltaY)+"px";
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
}
function upHandler(e)
{
if(document.removeEventListener)
{
document.removeEventListener("mouseup",upHandler,true);
document.removeEventListener("mousemove",moveHandler,true);
}
else
{
document.detachEvent("onmouseup",upHandler);
document.detachEvent("onmousemove",moveHandler);
}
window.location.href='./mapStatus.php?command=save&drag_x='+elementToDrag.style.left+"&drag_y="+elementToDrag.style.top+"&drag_key_led_num="+elementToDrag.id+"&needDragElement="+needDragElement+"&showingPageType="+showingPageType+"&typeOffset="+typeOffset+"&maxPageNum="+maxPageNum+"&maxLedNum="+maxLedNum+"&bg_img="+bg_img;
}
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
}
</script>
+64
View File
@@ -0,0 +1,64 @@
<script language="JavaScript">
function beginDrag(elementToDrag,event)
{
var deltaX=event.clientX-parseInt(elementToDrag.style.left);
var deltaY=event.clientY-parseInt(elementToDrag.style.top);
if(document.addEventListener)
{
document.addEventListener("mousemove",moveHandler,true);
document.addEventListener("mouseup",upHandler,true);
}
else if(document.attachEvent)
{
document.attachEvent("onmousemove",moveHandler);
document.attachEvent("onmouseup",upHandler);
}
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
if(event.preventDefault)
event.preventDefault();
else
event.returnValue=false;
function moveHandler(e)
{
  if (!e) e=window.event; //如果是IE的事件对象,那么就用window.event
  //全局属性,否则就用DOM二级标准的Event对象。
elementToDrag.style.left=(event.clientX-deltaX)+"px";
elementToDrag.style.top=(event.clientY-deltaY)+"px";
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
}
function upHandler(e)
{
if(document.removeEventListener)
{
document.removeEventListener("mouseup",upHandler,true);
document.removeEventListener("mousemove",moveHandler,true);
}
else
{
document.detachEvent("onmouseup",upHandler);
document.detachEvent("onmousemove",moveHandler);
}
window.location.href='./mapStatus_test.php?command=save&drag_x='+elementToDrag.style.left+"&drag_y="+elementToDrag.style.top+"&drag_key_led_num="+elementToDrag.id+"&needDragElement="+needDragElement+"&showingPageType="+showingPageType+"&typeOffset="+typeOffset+"&maxPageNum="+maxPageNum+"&maxLedNum="+maxLedNum+"&bg_img="+bg_img;
}
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
}
</script>
+57
View File
@@ -0,0 +1,57 @@
function beginDrag(elementToDrag,event)
{
var deltaX=event.clientX-parseInt(elementToDrag.style.left);
var deltaY=event.clientY-parseInt(elementToDrag.style.top);
if(document.addEventListener)
{
document.addEventListener("mousemove",moveHandler,true);
document.addEventListener("mouseup",upHandler,true);
}
else if(document.attachEvent)
{
document.attachEvent("onmousemove",moveHandler);
document.attachEvent("onmouseup",upHandler);
}
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
if(event.preventDefault)
event.preventDefault();
else
event.returnValue=false;
function moveHandler(e)
{
  if (!e) e=window.event; //如果是IE的事件对象,那么就用window.event
  //全局属性,否则就用DOM二级标准的Event对象。
elementToDrag.style.left=(event.clientX-deltaX)+"px";
elementToDrag.style.top=(event.clientY-deltaY)+"px";
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
}
function upHandler(e)
{
if(document.removeEventListener)
{
document.removeEventListener("mouseup",upHandler,true);
document.removeEventListener("mousemove",moveHandler,true);
}
else
{
document.detachEvent("onmouseup",upHandler);
document.detachEvent("onmousemove",moveHandler);}
}
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble=true;
}
+72
View File
@@ -0,0 +1,72 @@
<style>
<!--.drag{position:relative;cursor:hand}
-->
</style>
<script language="JavaScript">
var dragapproved=false
var z,x,y
var browser = navigator.appName; //find the browser name
if(browser == "Microsoft Internet Explorer"){
IE=1
}else{
IE=0
}
//alert(IE)
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x
z.style.pixelTop=temp2+event.clientY-y
return false
}
}
function drags(){
//if (!document.all)
// return
dragapproved=true
if(IE){
z=event.srcElement
alert(z)
}else{
var node=this.parentNode;
//node=node.parentNode;
alert(node.id);
//alert(node.nodeType);
//alert(node.id);
//while(node.nodeType!=1){
// alert('11')
// node=node.parentNode;
//}
//alert('22')
//alert(node);
}
while (z.id.indexOf("statusLed") == -1) {//check the z if it's led
z = z.parentElement;
if (z == null) {
return true;
}
}
temp1=z.style.pixelLeft
temp2=z.style.pixelTop
x=event.clientX
y=event.clientY
document.onmousemove=move
}
function dropDrags() {
dragapproved=false
window.location.href='./mapStatus.php?command=save&drag_x='+z.style.pixelLeft+"&drag_y="+z.style.pixelTop+"&drag_key_led_num="+z.id
z = null;
return true
}
document.onmousedown=drags
document.onmouseup=dropDrags
</script>
+107
View File
@@ -0,0 +1,107 @@
<?php
?>
<script language=JavaScript>
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.left += percent;
lastScrollX = lastScrollX + percent;
}
}
function checkFocus(x,y) {
stalkerx = document.floater.pageX;
stalkery = document.floater.pageY;
stalkerwidth = document.floater.clip.width;
stalkerheight = document.floater.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;
}
function grabIt(e) {
if(IE) {
whichIt = event.srcElement;
while (whichIt.id.indexOf("floater") == -1) {
whichIt = whichIt.parentElement;
if (whichIt == null) { return true; }
}
whichIt.style.pixelLeft = whichIt.offsetLeft;
whichIt.style.pixelTop = whichIt.offsetTop;
currentX = (event.clientX + document.body.scrollLeft);
currentY = (event.clientY + document.body.scrollTop);
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater;
StalkerTouchedX = e.pageX-document.floater.pageX;
StalkerTouchedY = e.pageY-document.floater.pageY;
}
}
return true;
}
function moveIt(e) {
if (whichIt == null) { return false; }
if(IE) {
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentX); distanceY = (newY - currentY);
currentX = newX; currentY = newY;
whichIt.style.pixelLeft += distanceX;
whichIt.style.pixelTop += distanceY;
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue = false;
} else {
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
return false;
}
return false;
}
function dropIt() {
whichIt = null;
if(NS) window.releaseEvents (Event.MOUSEMOVE);
return true;
}
if(NS) {
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabIt;
window.onmousemove = moveIt;
window.onmouseup = dropIt;
}
if(IE) {
document.onmousedown = grabIt;
document.onmousemove = moveIt;
document.onmouseup = dropIt;
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
</script>
+758
View File
@@ -0,0 +1,758 @@
<script language="JavaScript" type="Text/JavaScript">
<!--
if(window.Event){// 修正Event的DOM
/*
IE5 MacIE5 Mozilla Konqueror2.2 Opera5
event yes yes yes yes yes
event.returnValue yes yes no no no
event.cancelBubble yes yes no no no
event.srcElement yes yes no no no
event.fromElement yes yes no no no
*/
Event.prototype.__defineSetter__("returnValue",function(b){//
if(!b)this.preventDefault();
return b;
});
Event.prototype.__defineSetter__("cancelBubble",function(b){// 设置或者检索当前事件句柄的层次冒泡
if(b)this.stopPropagation();
return b;
});
Event.prototype.__defineGetter__("srcElement",function(){
var node=this.target;
while(node.nodeType!=1)node=node.parentNode;
alert(node);
return node;
});
Event.prototype.__defineGetter__("fromElement",function(){// 返回鼠标移出的源节点
var node;
if(this.type=="mouseover")
node=this.relatedTarget;
else if(this.type=="mouseout")
node=this.target;
if(!node)return;
while(node.nodeType!=1)node=node.parentNode;
return node;
});
Event.prototype.__defineGetter__("toElement",function(){// 返回鼠标移入的源节点
var node;
if(this.type=="mouseout")
node=this.relatedTarget;
else if(this.type=="mouseover")
node=this.target;
if(!node)return;
while(node.nodeType!=1)node=node.parentNode;
return node;
});
Event.prototype.__defineGetter__("offsetX",function(){
return this.layerX;
});
Event.prototype.__defineGetter__("offsetY",function(){
return this.layerY;
});
}
if(window.Document){// 修正Document的DOM
/*
IE5 MacIE5 Mozilla Konqueror2.2 Opera5
document.documentElement yes yes yes yes no
document.activeElement yes null no no no
*/
}
if(window.Node){// 修正Node的DOM
/*
IE5 MacIE5 Mozilla Konqueror2.2 Opera5
Node.contains yes yes no no yes
Node.replaceNode yes no no no no
Node.removeNode yes no no no no
Node.children yes yes no no no
Node.hasChildNodes yes yes yes yes no
Node.childNodes yes yes yes yes no
Node.swapNode yes no no no no
Node.currentStyle yes yes no no no
*/
Node.prototype.replaceNode=function(Node){// 替换指定节点
this.parentNode.replaceChild(Node,this);
}
Node.prototype.removeNode=function(removeChildren){// 删除指定节点
if(removeChildren)
return this.parentNode.removeChild(this);
else{
var range=document.createRange();
range.selectNodeContents(this);
return this.parentNode.replaceChild(range.extractContents(),this);
}
}
Node.prototype.swapNode=function(Node){// 交换节点
var nextSibling=this.nextSibling;
var parentNode=this.parentNode;
node.parentNode.replaceChild(this,Node);
parentNode.insertBefore(node,nextSibling);
}
}
if(window.HTMLElement){
HTMLElement.prototype.__defineGetter__("all",function(){
var a=this.getElementsByTagName("*");
var node=this;
a.tags=function(sTagName){
return node.getElementsByTagName(sTagName);
}
return a;
});
HTMLElement.prototype.__defineGetter__("parentElement",function(){
if(this.parentNode==this.ownerDocument)return null;
return this.parentNode;
});
HTMLElement.prototype.__defineGetter__("children",function(){
var tmp=[];
var j=0;
var n;
for(var i=0;i<this.childNodes.length;i++){
n=this.childNodes[i];
if(n.nodeType==1){
tmp[j++]=n;
if(n.name){
if(!tmp[n.name])
tmp[n.name]=[];
tmp[n.name][tmp[n.name].length]=n;
}
if(n.id)
tmp[n.id]=n;
}
}
return tmp;
});
HTMLElement.prototype.__defineGetter__("currentStyle", function(){
return this.ownerDocument.defaultView.getComputedStyle(this,null);
});
HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
var df=r.createContextualFragment(sHTML);
this.parentNode.replaceChild(df,this);
return sHTML;
});
HTMLElement.prototype.__defineGetter__("outerHTML",function(){
var attr;
var attrs=this.attributes;
var str="<"+this.tagName;
for(var i=0;i<attrs.length;i++){
attr=attrs[i];
if(attr.specified)
str+=" "+attr.name+'="'+attr.value+'"';
}
if(!this.canHaveChildren)
return str+">";
return str+">"+this.innerHTML+"</"+this.tagName+">";
});
HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){
switch(this.tagName.toLowerCase()){
case "area":
case "base":
case "basefont":
case "col":
case "frame":
case "hr":
case "img":
case "br":
case "input":
case "isindex":
case "link":
case "meta":
case "param":
return false;
}
return true;
});
HTMLElement.prototype.__defineSetter__("innerText",function(sText){
var parsedText=document.createTextNode(sText);
this.innerHTML=parsedText;
return parsedText;
});
HTMLElement.prototype.__defineGetter__("innerText",function(){
var r=this.ownerDocument.createRange();
r.selectNodeContents(this);
return r.toString();
});
HTMLElement.prototype.__defineSetter__("outerText",function(sText){
var parsedText=document.createTextNode(sText);
this.outerHTML=parsedText;
return parsedText;
});
HTMLElement.prototype.__defineGetter__("outerText",function(){
var r=this.ownerDocument.createRange();
r.selectNodeContents(this);
return r.toString();
});
HTMLElement.prototype.attachEvent=function(sType,fHandler){
var shortTypeName=sType.replace(/on/,"");
fHandler._ieEmuEventHandler=function(e){
window.event=e;
return fHandler();
}
this.addEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
}
HTMLElement.prototype.detachEvent=function(sType,fHandler){
var shortTypeName=sType.replace(/on/,"");
if(typeof(fHandler._ieEmuEventHandler)=="function")
this.removeEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
else
this.removeEventListener(shortTypeName,fHandler,true);
}
HTMLElement.prototype.contains=function(Node){// 是否包含某节点
do if(Node==this)return true;
while(Node=Node.parentNode);
return false;
}
HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){
switch(where){
case "beforeBegin":
this.parentNode.insertBefore(parsedNode,this);
break;
case "afterBegin":
this.insertBefore(parsedNode,this.firstChild);
break;
case "beforeEnd":
this.appendChild(parsedNode);
break;
case "afterEnd":
if(this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);
else
this.parentNode.appendChild(parsedNode);
break;
}
}
HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr){
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML=r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where,parsedHTML);
}
HTMLElement.prototype.insertAdjacentText=function(where,txtStr){
var parsedText=document.createTextNode(txtStr);
this.insertAdjacentElement(where,parsedText);
}
HTMLElement.prototype.attachEvent=function(sType,fHandler){
var shortTypeName=sType.replace(/on/,"");
fHandler._ieEmuEventHandler=function(e){
window.event=e;
return fHandler();
}
this.addEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
}
HTMLElement.prototype.detachEvent=function(sType,fHandler){
var shortTypeName=sType.replace(/on/,"");
if(typeof(fHandler._ieEmuEventHandler)=="function")
this.removeEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
else
this.removeEventListener(shortTypeName,fHandler,true);
}
}
//-->
</script>
+14
View File
@@ -0,0 +1,14 @@
<html>
 <head>
  <title>Untitled Page</title>
  <script type="text/javascript" src="dragIE.js"></script>
 </head>
 <body>
 <div id="2222" style="position:absolute;left:100px;top:100px;background-color:White;border:solid black;">
  <div style="background-color:Gray;border-bottom:solid black;padding:3px;font-family:Sans-Serif;font-weight:bold;" onmousedown="beginDrag(this.parentNode,event);">
  拖动我&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </div>
  <div>
  <p>This is a test.Testing,testing</p></div>
 </div>
 </body>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 B

Loaded 100 of 4263 files, more files were not shown because too many files have changed in this diff. Show more