Files
web.ems/wxc2_omc/configuration/confSs7/gttRemoteList.php
agtuser 16a3fd1e1b init
2024-11-11 17:56:00 +08:00

585 lines
17 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/*********************************************************
程序说明:
功能说明:设置七号信令中的 GTT
调用关系:调用: header.inc
被调用:
变量说明:
作者:
修改注释:
NO.1
姓名: Cui Ticun
时间2004-4-21
修改说明Support OMC7.0,从advanced移到configuration中修改
和添加了上方的操作按钮
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.1.0";
$DEBUG = 0;
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
adjust_head();
adjust_title_head();
if($DEBUG) echo "<br>正在调试中!!";
//==========================================================
//变量定义
//==========================================================
$pubDb = 'OMC_PUB';
$paramTable ='OBJ_223.param_99';
$maxNum = 30;
$db_1='OBJ_223';
$sysId ='223_99_99';
$instanceNo ='0';
$initValue ='initValue';
$editValue ='editValue';
$readValue ='readValue';
$nProcFail = 0;//failure
$nWaitProc = 1;//wait
$nInProc = 2;
$nOutProc = 3;
$nGetComm = 0;
$nSetComm = 3;
if($DEBUG) echo "<br>setObjIdStr = $setObjIdStr";
if($DEBUG) echo "<br>setInstanceNo = $setInstanceNo";
/************get default value**************/
$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 AND level_1 = 2 AND level_2 = 2 AND paramType=2";
$defRes = @mysqli_query($pubConn,$defSql);
$defRow = @mysqli_fetch_array($defRes);
do
{
$defaultValue = $defRow[initValue];
//echo "<br>defaultValue[$leve_3]=$defaultValue[$leve_3]";
}while($defRow = @mysqli_fetch_array($defRes));
if(isset($setSys) || isset($getSys)){
echo "<br><br><br><br><br>";
if($DEBUG) echo "<br>sysId=$sysId";
if($DEBUG) echo "<br>objIdStr=$objIdStr";
if(isset($setSys)){
$moveSql = "UPDATE $paramTable SET readValue = initValue
WHERE level_1='2' AND level_2='2'
";
if($DEBUG) echo "<BR>moveSql=$moveSql";
mysqli_query($pubConn,$moveSql);
echo mysqli_error($pubConn);
$commIdStr = sysCommSend($sysId,$nSetComm,$objIdStr);
if($DEBUG) echo "<br>nSetComm";
$showType="Set";
}else{
$commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr);
$showType="Get";
}
$i = 0;
while(1)
{
//echo "<br>i=$i";
if($i == 0)
echo "<br>$showType GTT";
if($i > $maxNum){
echo "<br><font size=\"2\" color=\"#FF0000\">Timeout</font>";
break;
}
echo "<img border=\"0\" src=\"../../images/arrow.gif\" width=\"10\" height=\"10\">";
flush();
$sysId = "223_99_99";
$chkType = "0";
$chRes=ChComm($sysId,$chkType);
//echo "<br>chRes=$chRes";
if($chRes == $nOutProc || $chRes == $nProcFail){
if($chRes == $nProcFail)
echo "<br><font size=\"2\" color=\"#FF0000\">$remark</font><br>";
elseif($remark == 'response timeout')
echo "<br><font size=\"2\" color=\"#FF0000\">$remark</font><br>";
else
echo "<br><font size=\"2\" color=\"#0000FF\">$remark</font><br>";
break;
}
sleep(1);
$i++;
}
$needCopyReadBuf=1;
$moveSql = "UPDATE $paramTable SET initValue = readValue
WHERE level_1='2' AND level_2='2'
";
if($DEBUG) echo "<BR>moveSql=$moveSql";
mysqli_query($pubConn,$moveSql);
echo mysqli_error($pubConn);
}elseif(isset($saveSys)){
$updSql = " UPDATE $paramTable SET initValue = '02'
WHERE level_1 = '3' AND level_2 = '2'
";
$updRes = @mysqli_query($pubConn,$updSql);
echo mysqli_error($pubConn);
$commIdStr=sysCommSend($sysId,$nSetComm,'3.2');
$i = 0;
while(1)
{
//echo "<br>i=$i";
if($i == 0)
echo "<br>Save parameter to system";
if($i > $maxNum){
echo "<br><font size=\"2\" color=\"#FF0000\">Timeout</font>";
break;
}
echo "<img border=\"0\" src=\"../../images/arrow.gif\" width=\"10\" height=\"10\">";
flush();
$sysId = "223_99_99";
$chkType = "0";
$chRes=ChComm($sysId,$chkType);
//echo "<br>chRes=$chRes";
if($chRes == $nOutProc || $chRes == $nProcFail){
if($chRes == $nProcFail)
echo "<br><font size=\"2\" color=\"#FF0000\">$remark</font><br>";
elseif($remark == 'response timeout')
echo "<br><font size=\"2\" color=\"#FF0000\">$remark</font><br>";
else
echo "<br><font size=\"2\" color=\"#0000FF\">$remark</font><br>";
break;
}
sleep(1);
$i++;
}
}elseif(isset($resetSys)){
$updSql = " UPDATE $paramTable SET initValue = '00'
WHERE level_1 = '3' AND level_2 = '2'
";
$updRes = @mysqli_query($pubConn,$updSql);
echo mysqli_error($pubConn);
$commIdStr=sysCommSend($sysId,$nSetComm,'3.2');
if($DEBUG) echo "<BR>commIdStr =$commIdStr";
if($DEBUG) echo "<BR>commIdStr =$commIdStr";
$i = 0;
while(1)
{
//echo "<br>i=$i";
if($i == 0)
echo "<br>Reset system";
if($i > $maxNum){
echo "<br><font size=\"2\" color=\"#FF0000\">Timeout</font>";
break;
}
echo "<img border=\"0\" src=\"../../images/arrow.gif\" width=\"10\" height=\"10\">";
flush();
$sysId = "223_99_99";
$chkType = "0";
$chRes=ChComm($sysId,$chkType);
//echo "<br>chRes=$chRes";
if($chRes == $nOutProc || $chRes == $nProcFail){
if($chRes == $nProcFail)
echo "<br><font size=\"2\" color=\"#FF0000\">$remark</font><br>";
elseif($remark == 'response timeout')
echo "<br><font size=\"2\" color=\"#FF0000\">$remark</font><br>";
else
echo "<br><font size=\"2\" color=\"#0000FF\">$remark</font><br>";
break;
}
sleep(1);
$i++;
}
}
if(1==$delete)
{
$delSql = "UPDATE $paramTable SET initValue = '$defaultValue'
WHERE level_1='2' AND level_2='2' AND instanceNo='$delValue'";
//echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
}
if($setSys || $getSys || $saveSys || $undoSet||$resetSys){
echo "<br>";
echo "<p align=\"left\"><a href=\"$PHP_SELF?setFlag=$setFlag\" target=\"contents\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
exit();
}
//==========================================================
//输入变量
//==========================================================
/*
GTT table
[unit]On/off[u]00.0-00.7[u]select
[v]1[opt]on
[v]0[opt]off
[unit]Numbering plan[u]01.0-01.7[u]select
[v]1[opt]MSISDN
[v]6[opt]IMSI
[v]7[opt]E.214 GT
[unit]Start GT number[u]02.0-11.7[u]input
[v]keepHex-low-E
[unit]End GT number[u]12.0-21.7[u]input
[v]keepHex-low-E
[unit]Network indicator[u]22.0-22.7[u]select
[v]0[opt]0
[v]1[opt]1
[v]2[opt]2
[v]3[opt]3
[unit]Destination point code[u]23.0-25.7[u]input
[v]toDec-high-0
[unit]SSN[u]26.0-26.7[u]input
[v]toDec-high-0
[unit]Route indicator[u]27.0-27.7[u]select
[v]0[opt]route on GT
[v]1[opt]route on SSN
[unit]Replaced start digit[u]28.0-28.7[u]input
[v]keepHex-high-0
[unit]Replaced end digit[u]29.0-29.7[u]input
[v]keepHex-high-0
[unit]Outgoing number plan[u]30.0-30.7[u]select
[v]1[opt]MSISDN
[v]6[opt]IMSI
[v]7[opt]E.214 GT
[unit]Replacing digits[u]31.0-40.7[u]input
[v]keepHex-low-E
*/
//==========================================================
//数据处理
//==========================================================
$objIdStr='2.2';
$GTTtableConfArr=array(
array('Start number', '03.0-12.7'),
array('End number', '13.0-22.7'),
array('On/off', '00.0-00.7'),
array('Numbering plan', '01.0-01.7'),
array('TT', '02.0-02.7'),
array('Network indicator', '23.0-23.7'),
array('DPC', '24.0-26.7'),
array('SSN', '27.0-27.7'),
array('Route indicator', '28.0-28.7'),
array('Address indicator', '29.0-29.7'),
array('Replaced start digit', '30.0-30.7'),
array('Replaced end digit', '31.0-31.7'),
array('Outgoing number plan', '32.0-32.7'),
array('Replacing digits', '33.0-42.7')
);
$NetIdConfArr=array(
array('0','International'),
array('1','Inter-S'),
array('2','National'),
array('3','National-S')
);
$numPlanConfArr=array(
array('0','--'),
array('1','MSISDN'),
array('6','IMSI'),
array('7','E.214 GT')
);
$addressIdConfArr=array(
array('00','NULL'),
array('01','DPC'),
array('02','SSN'),
array('03','DPC+SSN'),
array('04','GT'),
array('05','GT+DPC'),
array('06','GT+SSN'),
array('07','GT+DPC+SSN')
);
function showNumber($number){
$newNumber =str_replace('F','',$number);
if($newNumber == ''){
$newNumber='--';
}
return($newNumber);
}
//==========================================================
//输出并显示数据
//==========================================================
if($DEBUG) echo "<BR>";
?>
<script LANGUAGE="JavaScript">
function openSet(objIdStr,instanceNo){
URL="./gttRemoteConf.php?instanceNo="+instanceNo+"&objIdStr="+objIdStr;
var setWindow = open(URL, 'newWin', 'toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=yes,width=400,height=350');
setWindow.focus();
}
function delFirm(instanceNo)
{
var delValue,x,y;
x = document.body.scrollLeft;
y = document.body.scrollTop;
if(confirm('Do you want to delete the selected?')!=true){
window.location.href='<?php echo $PHP_SELF;?>'+"?scroll_x="+x+"&scroll_y="+y;
}else{
window.location.href='<?php echo $PHP_SELF;?>?&delete=1&delValue='+instanceNo+"&scroll_x="+x+"&scroll_y="+y;
}
}
</script>
<?php
function ChComm($sysId,$chkType)
{
global $omc_db;
global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc;
$commTable = "parameterComm";
$sysIdArr = explode('_',$sysId);
$sysTypeNo = $sysIdArr[0];
$sysNo = $sysIdArr[1];
$subSysNo = $sysIdArr[2];
if($chkType==0)
$selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' ";
else
$selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' ";
$selRes = @mysqli_query($pubConn,$selComm);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
$outProcCount=0;
do
{
$temCommState = $selRow[commState];
if(isset($selRow[remark])){
$remark = $selRow[remark];
if($DEBUG)echo "<br>remark=$remark";
}
if($DEBUG)echo "<br>temCommState=$temCommState";
if($temCommState == $nWaitProc){
return($nWaitProc);
}elseif($temCommState == $nInProc){
return($nInProc);
}elseif($temCommState == $nOutProc){
$commState = $nOutProc;
$outProcCount++;
}else{
$commState = $nProcFail;
}
}while($selRow = @mysqli_fetch_array($selRes));
if($outProcCount > 0){
return($nOutProc);
}else{
return($nProcFail);
}
}
?>
<form name="selectform">
<?php
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strConfiguration > $strNetwork > SS7 > GTT";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\">";
echo "<b>System:</b>&nbsp;&nbsp;";
echo "<input type=\"submit\" name=\"getSys\" value=\"$strGet\" class=\"button\">";
echo "<input type=\"submit\" name=\"setSys\" value=\"$strSet\" class=\"button\">";
/*
if ( TRUE == session_is_registered("gttRSetFlag") ) {
echo "<input type=\"submit\" name=\"undoSet\" value=\"$strUndo\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}else{
echo "<input type=\"submit\" name=\"undoSet\" value=\"$strUndo\" DISABLED class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}
*/
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<b>Command:</b>&nbsp;&nbsp;";
echo "<input type=\"submit\" name=\"saveSys\" value=\"$strSave\" class=\"button\">";
echo "<input type=\"submit\" name=\"resetSys\" value=\"$strReset\" class=\"button\">";
echo "<input type=\"hidden\" name=\"objIdStr\" value=\"2.2\">";
echo "</td>";
echo "<td>&nbsp;</td>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
/*
echo "<b>System:</b>&nbsp;&nbsp;";
echo "<input type=\"submit\" name=\"getSys\" value=\"$strGet\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" name=\"setSys\" value=\"$strSet\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" name=\"saveSys\" value=\"$strSave\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
if ( TRUE == session_is_registered("gttRSetFlag") ) {
echo "<input type=\"submit\" name=\"undoSet\" value=\"$strUndo\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}else{
echo "<input type=\"submit\" name=\"undoSet\" value=\"$strUndo\" DISABLED class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}
echo "<b>OMC:</b>&nbsp;&nbsp;";
echo "<input type=\"submit\" name=\"getOmc\" value=\"$strGet\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" name=\"saveOmc\" value=\"$strSave\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=\"hidden\" name=\"objIdStr\" value=\"2.2\">";
echo "<br>";
echo "<br>";
*/
?>
<br>
<table border="1" width="100%" cellpadding="1" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF">
<?php
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td>No.</td>";
echo "<td>Start number</td>";
echo "<td>End number</td>";
echo "<td>Enable</td>";
echo "<td>NP</td>";
echo "<td>TT</td>";
echo "<td>NI</td>";
echo "<td>DPC</td>";
echo "<td>SSN</td>";
echo "<td>Router ID</td>";
echo "<td>Address ID</td>";
echo "<td>Rep-start</td>";
echo "<td>Rep-End</td>";
echo "<td>ONP</td>";
echo "<td>Rep-number</td>";
echo "<td>Delete</td>";
echo "</tr>";
$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]}";
}
$getSql="SELECT $initValue,instanceNo FROM $paramTable
WHERE level_1='$level_1' AND level_2='$level_2'
";
if($DEBUG) echo "<BR>getSql=$getSql";
$result =mysqli_query($pubConn,$getSql);
echo mysqli_error($pubConn);
while($rows =mysqli_fetch_array($result)){
$instanceNo=$rows[instanceNo];
$value=$rows[0];
if(strcasecmp($value,$defaultValue)==0)
continue;
if($DEBUG) echo "<BR>value=$value";
$startDigit =getBitValue($value,$GTTtableConfArr[0][1]);
//if($startDigit == 'FFFFFFFFFFFFFFFFFFFF') continue;
$startDigit =showNumber($startDigit);
$endDigit =getBitValue($value,$GTTtableConfArr[1][1]);
$endDigit =showNumber($endDigit);
$enableFlag =getBitValue($value,$GTTtableConfArr[2][1]);
if($enableFlag > 0){
$enableFlag ='Y';
}else{
$enableFlag ='N';
}
$numPlan =getBitValue($value,$GTTtableConfArr[3][1]);
for($j=0;$j<sizeof($numPlanConfArr);$j++){
if($numPlan == $numPlanConfArr[$j][0]){
$numPlanName = $numPlanConfArr[$j][1];
break;
}
}
$tt =hexdec(getBitValue($value,$GTTtableConfArr[4][1]));
$NetID =getBitValue($value,$GTTtableConfArr[5][1]);
for($j=0;$j<sizeof($NetIdConfArr);$j++){
if($NetID == $NetIdConfArr[$j][0]){
$NetIDName = $NetIdConfArr[$j][1];
break;
}
}
$SPC =getBitValue($value,$GTTtableConfArr[6][1]);
$SSN =getBitValue($value,$GTTtableConfArr[7][1]);
$RouterID =getBitValue($value,$GTTtableConfArr[8][1]);
$adressID =getBitValue($value,$GTTtableConfArr[9][1]);
for($j=0;$j<sizeof($addressIdConfArr);$j++){
if($adressID == $addressIdConfArr[$j][0]){
$adressIDName = $addressIdConfArr[$j][1];
break;
}
}
$Rep_start =getBitValue($value,$GTTtableConfArr[10][1]);
$Rep_end =getBitValue($value,$GTTtableConfArr[11][1]);
$OutNumPlan =getBitValue($value,$GTTtableConfArr[12][1]);
for($j=0;$j<sizeof($numPlanConfArr);$j++){
if($OutNumPlan == $numPlanConfArr[$j][0]){
$OutNumPlanName = $numPlanConfArr[$j][1];
break;
}
}
$Rep_digit =getBitValue($value,$GTTtableConfArr[13][1]);
$Rep_digit =showNumber($Rep_digit);
if($instanceNo == $setInstanceNo &&$objIdStr==$setObjIdStr)
echo "<tr bgcolor=#CCFFCC>";
else
echo "<tr>";
echo "<td><a href=\"javascript:openSet('$objIdStr','$instanceNo')\">";
echo "$instanceNo</a>&nbsp;</td>";
echo "<td>$startDigit&nbsp;</td>";
echo "<td>$endDigit&nbsp;</td>";
echo "<td>$enableFlag&nbsp;</td>";
echo "<td>$numPlanName&nbsp;</td>";
echo "<td>$tt&nbsp;</td>";
echo "<td>$NetIDName&nbsp;</td>";
echo "<td>$SPC&nbsp;</td>";
echo "<td>$SSN&nbsp;</td>";
echo "<td>$RouterID&nbsp;</td>";
echo "<td>$adressIDName&nbsp;</td>";
echo "<td>$Rep_start&nbsp;</td>";
echo "<td>$Rep_end&nbsp;</td>";
echo "<td>$OutNumPlanName&nbsp;</td>";
echo "<td>$Rep_digit&nbsp;</td>";
echo "<td><input type=\"checkbox\" name=\"C$instanceNo\" value=\"ON\" onClick=\"javascript:delFirm($instanceNo)\" ></td>";
echo "</tr>";
}
echo "<tr>";
echo "<td><a href=\"javascript:openSet('$objIdStr','new')\">";
echo "New</a></td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "<td>--</td>";
echo "</tr>";
?>
</table>
</form>
&nbsp;
<?php
adjust_content_tail();
?>
</body>
</html>