init web ems all

This commit is contained in:
agtuser
2024-09-27 17:13:36 +08:00
parent 81c97acbe9
commit 5cc56f8078
4263 changed files with 798779 additions and 0 deletions

View File

@@ -0,0 +1,787 @@
<?php
/*********************************************************
Description:
Function<6F><6E>Calling prefix parameter configuration.
Invoke<6B><65>header.inc
Author: Lilong
Date: 4/28/2004
Modification notes<65><73>
NO.1
Name<6D><65>
Date<74><65>
Description<6F><6E>
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.1.1.3";
$DEBUG = 0;
$sysInfoTable = 'OMC_PUB.sysInfo';
?>
<script LANGUAGE="JavaScript">
function openSet(oType,tNum){
var x,y;
x = document.body.scrollLeft;
y = document.body.scrollTop;
URL="./callingPrefixEdit.php?oType="+oType+"&tNum="+tNum+"&scroll_x="+x+"&scroll_y="+y;
var msgWindow = open(URL, 'newWin', 'toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=yes,width=480,height=500');
msgWindow.focus();
}
function delFirm(i)
{
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='+i+"&scroll_x="+x+"&scroll_y="+y;
}
}
</script>
<?php
$sysTypeNo_0 = "111";
if($thisOmcType==10){
$sysTypeNo_1 = "251";
}else{
$sysTypeNo_1 = "322";
}
$db_0 = "OBJ_".$sysTypeNo_0;
$db_1 = "OBJ_".$sysTypeNo_1;
$tb_0 = "param_0";
$tb_1 = "param_1";
$tb_2 = "param_99";
$maxNum = 20;
$nPubFlag = 99;
$nSubSysParam = 0;
$nGlobalSubSysParam = 1;
$nGlobalSysParam = 2;
$nGetComm = 0;
$nSetComm = 3;
$nInteger = 2;
$nOctStr = 4;
$nProcFail = 0;
$nWaitProc = 1;
$nInProc = 2;
$nOutProc = 3;
//Calling Number manipulation
$oidPas = "2.1.8";
$pPas = explode(".",$oidPas);
$i = 0;
$wAnd = '';
while(isset($pPas[$i]))
{
$lNum = $i+1;
if($DEBUG) echo "<br>pPas[$i]=$pPas[$i]";
$wAnd = $wAnd." AND level_$lNum = $pPas[$i] ";
$i++;
}
if($DEBUG) echo "<br>wAnd=$wAnd";
/************get default value**************/
$defSql = " SELECT initValue,level_3 FROM paramConf WHERE keyId > 0 ".$wAnd." ORDER BY level_3 ";
if($DEBUG) echo "<br>defSql=$defSql<br>";
$defRes = @mysqli_query($pubConn,$defSql);
$defRow = @mysqli_fetch_array($defRes);
do
{
$leve_3 = $defRow[level_3];
$defaultValue[$leve_3] = $defRow[initValue];
if($DEBUG) echo "<br>defaultValue[$leve_3]=$defaultValue[$leve_3]";
}while($defRow = @mysqli_fetch_array($defRes));
$inTonArr=array(
array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'Unknown', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'),
array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'),
array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF')
);
$outTonArr=array(
array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'Unknown', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'),
array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'),
array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF')
);
$trkDelCArr=array(
array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'),
array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'),
array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'),
array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'),
array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'),
array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'),
array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'),
array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000')
);
$trkInsCArr=array(
array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'),
array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'),
array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'),
array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'),
array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'),
array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'),
array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'),
array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000')
);
if($DEFAULT_SYS == 'MSC'){
$proTypeArr=array(
array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'MSRN', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'MSC', 'color' => '#0000FF')
);
}else{
$proTypeArr=array(
array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'PBX', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'SUB', 'color' => '#0000FF'),
array('num' => '3', 'remark' => '--', 'color' => '#0000FF')
);
}
$callTypeArr=array(
array('num' => '0', 'remark' => 'Normal', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'EM', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'IP', 'color' => '#FF0000'),
array('num' => '3', 'remark' => 'VMS', 'color' => '#0000FF')
);
$tgTypeArr=array(
array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'subscriber', 'color' => '#0000FF'),
array('num' => '4', 'remark' => '--', 'color' => '#0000FF')
);
$camelFlagArr=array(
array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF')
);
$eDelCArr=array(
array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'),
array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'),
array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'),
array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'),
array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'),
array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'),
array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'),
array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000')
);
$eInsCArr=array(
array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'),
array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'),
array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'),
array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'),
array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'),
array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'),
array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'),
array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000')
);
//****************************************************************
//<2F><><EFBFBD><EFBFBD>
// ChComm($sysId)
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
// <09><>
//
//
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>$paramType
//$nSubSysParam = 0;
//$nGlobalSubSysParam = 1;
//$nGlobalSysParam = 2;
//<2F><><EFBFBD>ߣ<EFBFBD>
//
//<2F>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
//NO.1
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ʱ<>
//<2F>޸<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
//----------------------------------------------------------
function ChComm($sysId,$chkType=1)
{
global $omc_db;
global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc;
$commTable = "parameterComm";
$DEBUG = 0;
$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' ";
if($DEBUG) echo "<br>selComm=$selComm";
$selRes = @mysqli_query($pubConn,$selComm);
$selRow = @mysqli_fetch_array($selRes);
echo mysqli_error($pubConn);
do
{
$temCommState = $selRow[commState];
if($selRow[remark]){
$remark = $selRow[remark];
//echo "<br>remark=$remark";
}
//echo "<br>temCommState=$temCommState";
if($temCommState == $nWaitProc)
return($nWaitProc);
elseif($temCommState == $nInProc)
return($nInProc);
elseif($temCommState == $nOutProc)
$commState = $nOutProc;
else
$commState = 0;
}while($selRow = @mysqli_fetch_array($selRes));
return($commState);
}
//****************************************************************
//<2F><><EFBFBD><EFBFBD>
// <09><>Buffer_2<5F><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>$buffer_1
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
//
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
// <09><>
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>$paramType
//----------------------------------------------------------
function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1')
{
global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wAnd;
$DEBUG = 0;
$addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' ";
//Attributes of TG
if($type){
$uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$addWer;
}else{
$uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$wDef.$addWer;
}
if($DEBUG) echo " <br>uTgSql=$uTgSql ";
$uTgRes = @mysqli_query($pubConn,$uTgSql);
echo mysqli_error($pubConn);
if($uTgRes)
return 1;
else
return 0;
}
//****************************************************************
//<2F><><EFBFBD><EFBFBD>
// get <20><> set
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
//
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
// <09><>
//
//
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>$commType
//----------------------------------------------------------
function eSetGet($commType) {
global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc;
global $maxNum,$remark,$nGetComm,$nSetComm;
$DEBUG = 0;
if($commType == $nGetComm) {
$showType = "Get ";
} else {
$showType = "Set ";
}
$pNext1 = 1;
//2.1.8 Calling Number manipulation
if($pNext1) {
$sysId = $sysTypeNo_1."_99";
$objIdStr = "2.1.8.*";
$cic = sysCommSend($sysId,$commType,$objIdStr);
//echo "<br>cic=$cic";
$i = 0;
while (1) {
//echo "<br>i=$i";
if($i == 0)
echo "<br>$showType Calling Number manipulation&nbsp;&nbsp;";
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 = $sysTypeNo_1;
$chkType = "0";
$chRes=ChComm($sysId,$chkType);
if ($DEBUG) {
echo "<br>chRes=$chRes";
}
if($chRes == $nOutProc || $chRes == $nProcFail){
$pNext2 = 1;
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++;
}
}//end of $pNext1
return 1;
}//end of function
if ($saveSys) {
/****************copy initValue to editValue******************/
$buffer_1 = "editValue";
$buffer_2 = "initValue";
$edCin=copyBuffer($buffer_1,$buffer_2,$wDef);
if($DEBUG) echo "<br>edCin=$edCin";
//Get the value to "readValue" buffer.
eSetGet($nGetComm);//get value
/****************copy readValue to undoValue******************/
$buffer_1 = "undoValue";
$buffer_2 = "readValue";
$edCin=copyBuffer($buffer_1,$buffer_2,$wDef);
if($DEBUG) echo "<br>edCin=$edCin";
//set editValue to system.
eSetGet($nSetComm);
$callingPrefixSetFlag = 1;
session_register("callingPrefixSetFlag");
//if get fail ( undoValue = NULL ) , unregister set flag.
$where = "WHERE level_1=2 AND level_2=1 AND level_3=8";
$selSql = "SELECT distinct undoValue FROM $tb_2 $where ORDER BY undoValue";
if($DEBUG) echo "selSql(1)=$selSql,db=$db_1<br>";
$selRes = @mysqli_query($pubConn,$selSql);
$selRow = mysqli_fetch_array($selRes);
if ('' == $selRow[0]) {
session_unregister("callingPrefixSetFlag");
if ($DEBUG) {
echo "session_unregister(\"callingPrefixSetFlag\")<br>";
}
}
sleep(1);
echo "<script language=\"javascript\">";
//echo "window.location.href='$PHP_SELF';";
echo "</script>";
}//end of set sys
elseif($readSys){
eSetGet($nGetComm);//get value
/****************copy readValue to initValue******************/
$buffer_1 = "initValue";
$buffer_2 = "readValue";
$inCre=copyBuffer($buffer_1,$buffer_2,$wDef);
if($DEBUG) echo "<br>inCre=$inCr";
sleep(1);
echo "<script language=\"javascript\">";
//echo "window.location.href='$PHP_SELF';";
echo "</script>";
}//end of $readSys
elseif($undoSet){
/****************copy undoValue to editValue******************/
$buffer_1 = "editValue";
$buffer_2 = "undoValue";
$edCin=copyBuffer($buffer_1,$buffer_2,$wDef);
if($DEBUG) echo "<br>edCin=$edCin";
if ( 1 == eSetGet($nSetComm) ) {
$buffer_1 = "initValue";
$buffer_2 = "undoValue";
$edCin=copyBuffer($buffer_1,$buffer_2,$wDef);
if($DEBUG) echo "<br>edCin=$edCin";
}
session_unregister("callingPrefixSetFlag");
sleep(1);
echo "<script language=\"javascript\">";
//echo "window.location.href='$PHP_SELF';";
echo "</script>";
}
//end undoSet
elseif($saveDisk)
{
/****************copy initValue to editValue******************/
$buffer_1 = "editValue";
$buffer_2 = "initValue";
$inCed=copyBuffer($buffer_1,$buffer_2,$wDef);
if($DEBUG) echo "<br>$inCed=$$inCed";
if($inCed)
echo "<br><font color=\"#0000FF\">Save success.</font>";
else
echo "<br><font color=\"#FF0000\">Save Failure.</font>";
flush();
sleep(1);
echo "<script language=\"javascript\">";
echo "window.location.href='$PHP_SELF';";
echo "</script>";
}//end of $saveDisk
elseif($readDisk){
/****************copy editValue to initValue******************/
$buffer_1 = "initValue";
$buffer_2 = "editValue";
$loadType = 1;
$edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType);
if($DEBUG) echo "<br>edCin=$edCin";
if($edCin)
echo "<br><font color=\"#0000FF\">Read success.</font>";
else
echo "<br><font color=\"#FF0000\">Read failure.</font>";
flush();
sleep(1);
echo "<script language=\"javascript\">";
echo "window.location.href='$PHP_SELF';";
echo "</script>";
}//end of $comSys
elseif($delete){
$delSql = " UPDATE $tb_2 set initValue = '$defaultValue[8]' WHERE subSysNo = '99' ".$wAnd." AND instanceNo = $delValue ";
if($DEBUG) echo "<br>delSql=$delSql";
$delRes = @mysqli_query($pubConn,$delSql);
echo mysqli_error($pubConn);
}
elseif($saveComm)
{
session_unregister("callingPrefixSetFlag");
$temTb = ${tb_."2"};
$updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' ";
//echo "<br>updSql=$updSql";
$updRes = @mysqli_query($pubConn,$updSql);
//echo "<br>updRes=$updRes";
if($sTimeOut)
break;
$sysId = $sysTypeNo_1."_99";
$commType = $nSetComm;
$objIdStr = "3.2.*";
$flag = sysCommSend($sysId,$commType,$objIdStr);
//echo "<br>flag=$flag";
$i = 0;
while(1)
{
if($i == 0)
echo "<br>Save parameter to system";
if($i > $maxNum){
echo "<br><font size=\"2\" color=\"#FF0000\">Timeout</font>";
$sTimeOut = 1;
break;
}
echo "<img border=\"0\" src=\"../../images/arrow.gif\" width=\"10\" height=\"10\">";
flush();
$sysId = $sysTypeNo_1;
$chkType = "0";
$chRes=ChComm($sysId,$chkType);
//echo "<br>chRes=$chRes";
if($chRes == $nOutProc || $chRes == $nProcFail){
$pNext1 = 1;
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($resetComm)
{
$temTb = ${tb_."2"};
$updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' ";
//echo "<br>updSql=$updSql";
$updRes = @mysqli_query($pubConn,$updSql);
//echo "<br>updRes=$updRes";
if($sTimeOut)
break;
$sysId = $sysTypeNo_1."_99";
$commType = $nSetComm;
$objIdStr = "3.2.*";
$flag = sysCommSend($sysId,$commType,$objIdStr);
//echo "<br>flag=$flag";
$i = 0;
while(1)
{
if($i == 0)
echo "<br>Reset system";
if($i > $maxNum){
echo "<br><font size=\"2\" color=\"#FF0000\">Timeout</font>";
$sTimeOut = 1;
break;
}
echo "<img border=\"0\" src=\"../../images/arrow.gif\" width=\"10\" height=\"10\">";
flush();
$sysId = $sysTypeNo_1;
$chkType = "0";
$chRes=ChComm($sysId,$chkType);
//echo "<br>chRes=$chRes";
if($chRes == $nOutProc || $chRes == $nProcFail){
$pNext1 = 1;
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($readSys || $saveSys || $saveComm || $undoSet||$resetComm){
echo "<br>";
echo "<p align=\"left\"><a href=\"$PHP_SELF\" target=\"contents\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
exit();
}
/**************select used E1 card*******************/
$getSql = " SELECT sysNo,subSysNo,baseStat
FROM $sysInfoTable
WHERE sysTypeNo='$sysTypeNo_0' AND baseStat > '0'
ORDER BY sysNo,subSysNo
";
//echo "<br>getSql=$getSql";
$getRes = @mysqli_query($pubConn,$getSql);
$getRow = @mysqli_fetch_array($getRes);
echo mysqli_error($pubConn);
do{
$sysNo = $getRow[sysNo];
$subSysNo = $getRow[subSysNo];
$cardArr[$sysNo][subSysNo] = $getRow[baseStat];
}while($getRow = @mysqli_fetch_array($getRes));
/************select value to see************/
//Attributes of TG
$andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wAnd." ORDER BY instanceNo ";
if($DEBUG) echo "<br>andSql=$andSql";
$andRes = @mysqli_query($pubConn,$andSql);
$andRow = @mysqli_fetch_array($andRes);
echo mysqli_error($pubConn);
do{
$level_3 = $andRow[level_3];
$instanceNo = $andRow[instanceNo];
$initValue = $andRow[initValue];
if($DEBUG) echo "<br>initValue=$initValue";
if($initValue == $defaultValue[$level_3]){
$andShow[$level_3][$instanceNo] = 0;
}else{
$andShow[$level_3][$instanceNo] = 1;
}
if($DEBUG) echo "<br>andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}";
$prefixDigit = explode("E",substr($initValue,0,8));
$prefixNum =$prefixArr[$instanceNo][1] = $prefixDigit[0];
if($DEBUG) echo "<br>prefixArr[$instanceNo][1]={$prefixArr[$instanceNo][1]}";
$outTon = $prefixArr[$instanceNo][3] = hexdec(substr($initValue,8,1));
$inTon = $prefixArr[$instanceNo][2] = hexdec(substr($initValue,9,1));
if($DEBUG) echo "<br>inTon=$inTon, outTon=$outTon";
$tdc = $prefixArr[$instanceNo][4] = hexdec(substr($initValue,11,1));
$tic = $prefixArr[$instanceNo][5] = hexdec(substr($initValue,10,1));
if($DEBUG) echo "<br>tdc=$tdc, tic=$tic<br>";
$tidDigit = explode("E",substr($initValue,12,8));
$tid = $prefixArr[$instanceNo][6] = $tidDigit[0];
}while($andRow = @mysqli_fetch_array($andRes));
$wDef = " AND (";
for($i=0;$i<256;$i++)
{
//2.1.8
if ( $andShow[8][$i] > 0 ){
$realShow[$i] = 1;
if($DEBUG) echo "<br>realShow[$i]=$realShow[$i]";
$wDef = $wDef." instanceNo = $i OR ";
}
}
$wDef = substr($wDef,0,-3);
$wDef = $wDef.")";
if(strlen($wDef) < 10){
$wDef = ' AND instanceNo < 0 ';
}
//echo "<br>wDef=$wDef";
$realShow[0] = "1";
$scroll_x = isset($scroll_x)?$scroll_x:'0';
$scroll_y = isset($scroll_y)?$scroll_y:'0';
echo "<body onLoad='self.scrollBy($scroll_x,$scroll_y)'>";
echo "<form method=\"POST\" name=\"confForm\" action=\"$PHP_SELF\">";
?>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > Calling prefix";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<br>&nbsp;
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!--
<tr>
<?php
echo "<td width=200 valign=\"middle\"><nobr><b>System:</b>";
echo "<input type=\"submit\" value=$strGet class=\"button\" name=\"readSys\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" value=$strSet class=\"button\" name=\"saveSys\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" value=$strSave class=\"button\" name=\"saveComm\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
if ( TRUE == session_is_registered("callingPrefixSetFlag") ) {
echo "<input type=\"submit\" value=\"Undo\" class=\"button\" name=\"undoSet\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
}else{
echo "<input type=\"submit\" value=\"Undo\" DISABLED class=\"button\" name=\"undoSet\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
}
?>
</nobr>
</td>
<?php
echo "<td width=200 valign=\"middle\"><nobr><b>OMC:</b>";
echo "<input type=\"submit\" value=$strGet class=\"button\" name=\"readDisk\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" value=$strSave class=\"button\" name=\"saveDisk\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
?>
</nobr>
</td>
<td width=200 valign="middle"><nobr><b>New:</b><input type="button" value="<?php echo $strAdd; ?>" onclick="javascript:openSet(1,0);" name="add" style="left: 3; top: 2; width: 60; height: 25; position: relative">
</nobr>
</td>
</tr>
-->
<tr>
<?php
echo "<td width=200 valign=\"middle\"><nobr><b>System:</b>";
echo "<input type=\"submit\" value=$strGet class=\"button\" name=\"readSys\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" value=$strSet class=\"button\" name=\"saveSys\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
if ( TRUE == session_is_registered("callingPrefixSetFlag") ) {
echo "<input type=\"submit\" value=\"Undo\" class=\"button\" name=\"undoSet\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
}else{
echo "<input type=\"submit\" value=\"Undo\" DISABLED class=\"button\" name=\"undoSet\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
}
?>
</nobr>
</td>
<?php
echo "<td width=200 valign=\"middle\"><nobr><b>Command:</b>";
echo "<input type=\"submit\" value=$strSave class=\"button\" name=\"saveComm\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "<input type=\"submit\" value=$strReset class=\"button\" name=\"resetComm\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
?>
</nobr>
</td>
<td width=200 valign="middle"><nobr><b>New:</b><input type="button" value="<?php echo $strAdd; ?>" onclick="javascript:openSet(1,0);" name="add" style="left: 3; top: 2; width: 60; height: 25; position: relative">
</nobr>
</td>
</tr>
</table>
<p></p>
<TABLE border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr bgcolor="#E6E6E6">
<td width="6%" title="">No.</td>
<td width="8%" title="Prefix"><nobr>Prefix</nobr</td>
<td width="8%" title="TON incoming call"><nobr>In-TON</nobr</td>
<td width="8%" title="TON outgoing call"><nobr>Out-TON</nobr</td>
<td width="8%" title="Out trunk deletion count"><nobr>T-D-C</nobr</td>
<td width="8%" title="Out trunk insertion count"><nobr>T-I-C</nobr</td>
<td width="8%" title="Out trunk inserted digits(max=8)"><nobr>T-I-D</nobr</td>
<td width="6%" title=""><nobr>Delete</nobr</td>
</tr>
<?php
for($i=0;$i<256;$i++){
$sNum = floor($i/8);
$pNum = floor($i%8);
if($realShow[$i]){
if($pNum == 0 && $i > 0)
echo "<tr bgcolor=\"#E6E6E6\">";
else
echo "<tr>";
echo "<td><a href=javascript:openSet(0,$i)>$i</a></td>";
echo "<td><nobr>{$prefixArr[$i][1]}&nbsp;</nobr></td>";
echo "<td><nobr>{$inTonArr[$prefixArr[$i][2]][remark]}&nbsp;</nobr></td>";
echo "<td><nobr>{$outTonArr[$prefixArr[$i][3]][remark]}&nbsp;</nobr></td>";
echo "<td><nobr>{$prefixArr[$i][4]}&nbsp;</nobr></td>";
echo "<td><nobr>{$prefixArr[$i][5]}&nbsp;</nobr></td>";
echo "<td><nobr>{$prefixArr[$i][6]}&nbsp;</nobr></td>";
echo "<td><input type=\"checkbox\" name=\"C$i\" value=\"ON\" onClick=\"javascript:delFirm($i)\" ></td>";
echo "</tr>";
}
}
echo "</table>";
echo "<input type=\"hidden\" name=\"wDef\" value=\"$wDef\">";
echo "</form>";
?>
</body>
</html>