init web ems all
This commit is contained in:
667
wxc2_omc/configuration/paramConfiguration/handleOpaquePara.php
Executable file
667
wxc2_omc/configuration/paramConfiguration/handleOpaquePara.php
Executable file
@@ -0,0 +1,667 @@
|
||||
<?php
|
||||
/*********************************************************
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>ֶ<EFBFBD>opaque<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺͱ<C4BA><CDB1><EFBFBD>
|
||||
|
||||
<20><><EFBFBD>ù<EFBFBD>ϵ:<3A><><EFBFBD><EFBFBD>: header.inc
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
|
||||
|
||||
<20><><EFBFBD><EFBFBD>ֵ:
|
||||
|
||||
<20><><EFBFBD><EFBFBD>:
|
||||
|
||||
<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>:
|
||||
NO.1
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
ʱ<EFBFBD><EFBFBD>:
|
||||
<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>:
|
||||
*********************************************************/
|
||||
require("../../inc/header.inc");
|
||||
$DEBUG = 0;
|
||||
|
||||
$settedColor ="blue";
|
||||
$notSettedColor ="#008000";
|
||||
$inputBkgrdColor = "#E7FEFD";
|
||||
$saveBkgrdColor ="#F3F77D";
|
||||
$waitingBkgrdColor = "red";
|
||||
|
||||
$sysIdArr = explode('_',$sysId);
|
||||
$sysTypeNo = $sysIdArr[0];
|
||||
$sysNo = $sysIdArr[1];
|
||||
$subSysNo = $sysIdArr[2];
|
||||
$objDb = 'OBJ_'.$sysTypeNo;
|
||||
$paraConfTable = $objDb.'.paramConf';
|
||||
|
||||
if(checkIndependSystem($sysTypeNo))//Plat
|
||||
$paraTable=$objDb.".param_".$sysNo;
|
||||
else
|
||||
$paraTable=$objDb.".param_99";
|
||||
|
||||
$levelWhere=getLevelWhere($oidStr);
|
||||
$paraSql="SELECT * FROM $paraTable WHERE $levelWhere AND instanceNo=$instanceNo";
|
||||
if($DEBUG)
|
||||
echo "<br>paraSql=$paraSql";
|
||||
$paraResult=mysqli_query($pubConn,$paraSql);
|
||||
$paraRows=@mysqli_fetch_array($paraResult);
|
||||
|
||||
$setValue=$paraRows[initValue];
|
||||
$readValue=$paraRows[readValue];
|
||||
if($DEBUG)
|
||||
echo "<br>setValue=$setValue";
|
||||
|
||||
function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){
|
||||
if(strlen($string) <= $defLen){
|
||||
$fillLen=$defLen - strlen($string);
|
||||
for($i=0;$i<$fillLen;$i++){
|
||||
if($fillWay == 'low'){
|
||||
$string = $string.$fillChar;
|
||||
}else{
|
||||
$string = $fillChar.$string;
|
||||
}
|
||||
}
|
||||
return($string);
|
||||
}else{
|
||||
echo "<br>Error in omcStrFill:the defLen < lengh of string!!";
|
||||
echo "<br>defLen=$defLen and string=$string!!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------
|
||||
//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD>汾
|
||||
if($language == 'eng'){
|
||||
$objNameField=name_2;
|
||||
$objSetField=setTemplate_2 ; //<2F><><EFBFBD><EFBFBD>2
|
||||
}else{
|
||||
$objNameField=name_1;
|
||||
$objSetField=setTemplate_1 ; //<2F><><EFBFBD><EFBFBD>1(Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
}
|
||||
//-----------------------
|
||||
|
||||
//=======================Get value From submit===================
|
||||
if($set == 'Set'){
|
||||
//sort by offset
|
||||
for($i=1;$i<=$unitNum;$i++){
|
||||
$tmpDef = ${'unitDef_'.$i};
|
||||
$tmpValue = ${'unit_'.$i};
|
||||
if($DEBUG) echo "<br>tmpDef = $tmpDef";
|
||||
$defArr[$i] = $tmpDef;
|
||||
$tmpDefArr=explode('-',$tmpDef);
|
||||
$sortArr[$i] = $tmpDefArr[0];
|
||||
$valueArr[$i] = $tmpValue;
|
||||
}
|
||||
$lastValue = '';
|
||||
$k = 0;
|
||||
asort($sortArr);
|
||||
for(reset($sortArr); $key = key($sortArr); next($sortArr)){
|
||||
if($DEBUG) echo "<br>sortArr[$key] = {$sortArr[$key]}";
|
||||
if($DEBUG) echo "<br>unitValue = {$valueArr[$key]}";
|
||||
$unitValue = $valueArr[$key];
|
||||
if($DEBUG) echo "<br>defArr[$key] = {$defArr[$key]}";
|
||||
$unitDefArr = explode('-',$defArr[$key]); //<2F><>:0.0-0.7-input -toDec-high-0
|
||||
if(sizeof($unitDefArr) <= 1){
|
||||
if($DEBUG) echo "<br>nothing,just a name";
|
||||
continue;
|
||||
}
|
||||
$bgnOffset = $unitDefArr[0];
|
||||
$endOffset = $unitDefArr[1];
|
||||
$operType = $unitDefArr[2];
|
||||
$valueType = $unitDefArr[3];
|
||||
$fillWay = $unitDefArr[4];
|
||||
$fillChar = $unitDefArr[5];
|
||||
|
||||
$bgnOffsetArr = explode('.',$bgnOffset);
|
||||
$bgnByte = $bgnOffsetArr[0];
|
||||
$bgnBit = $bgnOffsetArr[1];
|
||||
$endOffsetArr = explode('.',$endOffset);
|
||||
$endByte = $endOffsetArr[0];
|
||||
$endBit = $endOffsetArr[1];
|
||||
$byteLen = $endByte - $bgnByte + 1;
|
||||
$byteValue = '';
|
||||
if($DEBUG) echo "<br>valueType = $valueType";
|
||||
switch($valueType){
|
||||
case 'toDec':
|
||||
if($bgnBit > 0 ||$endBit < 7){
|
||||
$bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit
|
||||
$bitValue = DecBin($unitValue);
|
||||
if($DEBUG)echo "<br>bitValue = $bitValue ";
|
||||
$bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar);
|
||||
if($DEBUG) echo "<br>omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)";
|
||||
$bitValueArr[$k] = $bitValue;
|
||||
if($DEBUG) echo "<br>bitValueArr[$k] = {$bitValueArr[$k]}";
|
||||
if($endBit == 7){//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>п<EFBFBD>byte<74><65><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>byteֵ
|
||||
$bitValue = '';
|
||||
for($bitNo=0; $bitNo<=$k; $bitNo++){
|
||||
if($DEBUG) echo "<br>bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}";
|
||||
$bitValue = $bitValueArr[$bitNo].$bitValue;
|
||||
}
|
||||
$k=0;
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$byteLen = strlen($bitValue) / 8;
|
||||
if($DEBUG) echo "<br>byteLen = $byteLen";
|
||||
$byteValue = BinDec($bitValue);
|
||||
$byteValue = DecHex($byteValue);
|
||||
$strLen = $byteLen*2;
|
||||
if($DEBUG) echo "<br>omcStrFill($byteValue,$strLen,$fillWay,$fillChar)";
|
||||
$byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar);
|
||||
}else{//<2F><><EFBFBD><EFBFBD><F2A3ACBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>bit<69><74>
|
||||
$byteValue = '';
|
||||
$k++;
|
||||
}
|
||||
}else{
|
||||
$byteValue = DecHex($unitValue);
|
||||
$strLen = $byteLen*2;
|
||||
$byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar);
|
||||
if($DEBUG) echo "<br>omcStrFill($byteValue,$strLen,$fillWay,$fillChar)";
|
||||
}
|
||||
if($DEBUG) echo "<br>byteValue = $byteValue";
|
||||
break;
|
||||
case 'keepDec':
|
||||
//echo "<br>Error:keepDec";
|
||||
$byteValue = $unitValue - 0;
|
||||
break;
|
||||
case 'toHex':
|
||||
echo "<br>Error:toHex";
|
||||
break;
|
||||
case 'keepHex':
|
||||
if($bgnBit > 0 || $endBit < 7){//<2F><><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>,û<>ж<EFBFBD>=7<>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD>β
|
||||
$byteValue = $unitValue;
|
||||
$strLen = $byteLen;
|
||||
$byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar);
|
||||
$bitValue = DecBin(HexDec($byteValue));
|
||||
$byteValue='';
|
||||
$bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit
|
||||
$bitValue = omcStrFill($bitValue,$bitLen,'high','0');
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$bitValueArr[$k] = $bitValue;
|
||||
$k++;
|
||||
}else{
|
||||
$k=0;
|
||||
$byteValue = $unitValue;
|
||||
$strLen = $byteLen*2;
|
||||
$byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar);
|
||||
if($DEBUG) echo "<br>omcStrFill($byteValue,$strLen,$fillWay,$fillChar)";
|
||||
}
|
||||
break;
|
||||
case 'toAscii':
|
||||
if($bgnBit > 0 ||$endBit < 7){
|
||||
echo "<br>Error:toAscii";
|
||||
exit(1);
|
||||
}else{
|
||||
$tmpLen=strlen($unitValue);
|
||||
for($i=0;$i<$tmpLen;$i++){
|
||||
$unitChar = substr($unitValue,$i,1);
|
||||
$decValue = ord($unitChar); //ascii -> dec
|
||||
$byteValue .= DecHex($decValue);
|
||||
if(strlen($byteValue) < 2){
|
||||
$byteValue = '0'.$byteValue;
|
||||
}
|
||||
}
|
||||
$strLen = $byteLen*2;
|
||||
$byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar);
|
||||
}
|
||||
break;
|
||||
case 'toLatitude':
|
||||
//feake show 4byte
|
||||
if($unitValue>90)
|
||||
{
|
||||
$unitValue=90;
|
||||
/**************************************************/
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "alert('The value must be -90.00 to 90.00');\n";
|
||||
echo "</script>\n";
|
||||
/***************************************************/
|
||||
}
|
||||
if($unitValue<-90)
|
||||
{
|
||||
$unitValue=-90;
|
||||
/**************************************************/
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "alert('The value must be -90.00 to 90.00');\n";
|
||||
echo "</script>\n";
|
||||
/***************************************************/
|
||||
}
|
||||
$byteValue=$unitValue*pow(2,23)/90;
|
||||
$byteValue=ceil($byteValue);
|
||||
$byteValue=dechex($byteValue);
|
||||
$byteValue=omcStrFill($byteValue,8,'high','0');
|
||||
break;
|
||||
case 'toLongitude':
|
||||
if($unitValue>180)
|
||||
{
|
||||
$unitValue=180;
|
||||
/**************************************************/
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "alert('The value must be -180.00 to 180.00');\n";
|
||||
echo "</script>\n";
|
||||
/***************************************************/
|
||||
}
|
||||
if($unitValue<-180)
|
||||
{
|
||||
$unitValue=-180;
|
||||
/**************************************************/
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "alert('The value must be -180.00 to 180.00');\n";
|
||||
echo "</script>\n";
|
||||
/***************************************************/
|
||||
}
|
||||
$byteValue=$unitValue*pow(2,24)/360;
|
||||
$byteValue=ceil($byteValue);
|
||||
$byteValue=dechex($byteValue);
|
||||
$byteValue=omcStrFill($byteValue,8,'high','0');
|
||||
break;
|
||||
default:
|
||||
echo "Error:Unknown valueType";
|
||||
break;
|
||||
}
|
||||
if($DEBUG) echo "<br>byteValue = $byteValue ";
|
||||
//--><-//$lastValue = $byteValue.$lastValue;
|
||||
$lastValue = $lastValue.$byteValue;
|
||||
}
|
||||
$lastValue=strtoupper($lastValue);
|
||||
if($DEBUG) echo "<br>lastValue = $lastValue ";
|
||||
$updateSql="UPDATE $paraTable SET initValue='$lastValue' WHERE $levelWhere AND instanceNo=$instanceNo";
|
||||
if($DEBUG)echo "<br>updateSql=$updateSql";
|
||||
mysqli_query($pubConn,$updateSql);
|
||||
|
||||
if($lastValue==$readValue)
|
||||
$returnColor= $settedColor;
|
||||
else
|
||||
$returnColor= $notSettedColor;
|
||||
if(!$DEBUG){
|
||||
|
||||
//discard the postfix E
|
||||
if(strstr($tmpDef,"keepHex-low"))
|
||||
{
|
||||
$oidwhere=getLevelWhere($oidStr);
|
||||
$sql="select setTemplate_2 from OBJ_$sysTypeNo.paramConf where $oidwhere ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$split=explode("[unit]",$row[0]);
|
||||
$tmplen=sizeof($split);
|
||||
//only one unit
|
||||
//if($tmplen == 2)
|
||||
{
|
||||
$split2=explode("keepHex-low-",$row[0]);
|
||||
$repl=substr($split2[1],0,1);
|
||||
$lastValue=str_replace($repl," ",$lastValue);
|
||||
}
|
||||
}
|
||||
if(strlen(trim($lastValue))<=0)
|
||||
$lastValue="--";
|
||||
|
||||
echo "<script LANGUAGE=\"JavaScript\">";
|
||||
$innerHTML="<a style=\'color:$returnColor\'>$lastValue</a>";
|
||||
echo "\n window.opener.document.getElementById('$spanId').innerHTML='$innerHTML';";
|
||||
if($DEBUG) exit();
|
||||
echo "\n window.opener.document.getElementById('$spanId').focus();";
|
||||
echo "\n window.close();";
|
||||
echo "\n </script>";
|
||||
exit();
|
||||
}else{
|
||||
echo "<br>lastValue = $lastValue ";
|
||||
}
|
||||
}//end of if($set == 1)
|
||||
|
||||
//=======================Show GUI ========================
|
||||
?>
|
||||
<body>
|
||||
<script LANGUAGE="JavaScript">
|
||||
function checkInt(term){
|
||||
var checkOK = "0123456789";
|
||||
var checkStr = term.value;
|
||||
var allValid = true;
|
||||
var termName = term.name;
|
||||
var minValue = eval("document.confForm."+termName+"_min.value");
|
||||
var maxValue = eval("document.confForm."+termName+"_max.value");
|
||||
var oldValue = eval("document.confForm."+termName+"_old.value");
|
||||
//alert(minValue+'<'+term.value+'<'+maxValue);
|
||||
for (i = 0; i < checkStr.length; i++){
|
||||
ch = checkStr.charAt(i);
|
||||
for (j = 0; j < checkOK.length; j++){
|
||||
if (ch == checkOK.charAt(j))
|
||||
break;
|
||||
}
|
||||
if (j == checkOK.length){
|
||||
allValid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!allValid){
|
||||
var errAlert="parameter Must be a dec number!";
|
||||
alert(errAlert);
|
||||
term.value=oldValue;
|
||||
term.focus();
|
||||
return (false);
|
||||
}
|
||||
|
||||
if((minValue - term.value) > 0){
|
||||
var errAlert="Too little!";
|
||||
alert(errAlert);
|
||||
term.value=oldValue;
|
||||
term.focus();
|
||||
return (false);
|
||||
}
|
||||
if((term.value - maxValue) > 0){
|
||||
var errAlert="Too Big!";
|
||||
alert(errAlert);
|
||||
term.value=oldValue;
|
||||
term.focus();
|
||||
return (false);
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<form method="POST" name="confForm" action="<?php echo"$PHP_SELF";?>" >
|
||||
<?php
|
||||
$objSql = "SELECT $objNameField,$objSetField,valueType,minValue,maxValue FROM $paraConfTable WHERE $levelWhere";
|
||||
if($DEBUG)
|
||||
echo "objSql=$objSql";
|
||||
$objResult = mysqli_query($pubConn ,$objSql);
|
||||
$objRows = @mysqli_fetch_array($objResult);
|
||||
$objName = $objRows[$objNameField];
|
||||
$setTemplate = $objRows[$objSetField];
|
||||
$valueType = $objRows[valueType];
|
||||
$minValue = $objRows[minValue];
|
||||
$maxValue = $objRows[maxValue];
|
||||
|
||||
/**************************************
|
||||
*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar
|
||||
*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2
|
||||
*[remark]
|
||||
***************************************/
|
||||
|
||||
//explode by '[remark]'
|
||||
$remarkArr = explode('[remark]',$setTemplate);
|
||||
$remark = $remarkArr[1];
|
||||
|
||||
//explode by '[unit]'
|
||||
$unitArr = explode('[unit]',$remarkArr[0]);
|
||||
|
||||
//show every one unit
|
||||
//$setValue = strrev($setValue);
|
||||
if($DEBUG){
|
||||
echo "<table border=\"1\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">";
|
||||
}else{
|
||||
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">";
|
||||
}
|
||||
|
||||
for($i=1;$i<sizeof($unitArr);$i++){
|
||||
echo "\n <tr><td width=\"10%\" valign=middle><nobr>";
|
||||
//unit input name
|
||||
$unitName = "unit_".$i;
|
||||
|
||||
//explode by '[u]'
|
||||
$tlvArr = explode('[u]',$unitArr[$i]);
|
||||
if(sizeof($tlvArr) <= 1 ){
|
||||
echo "<u><b>{$unitArr[$i]}</b></u>";
|
||||
continue;
|
||||
}
|
||||
|
||||
//show Unit Name
|
||||
echo "$tlvArr[0]";
|
||||
echo " </nobr></td><td>";
|
||||
if($DEBUG) echo "$tlvArr[1]";
|
||||
//explode by '-'
|
||||
$offsetArr = explode('-',$tlvArr[1]);
|
||||
$bgnOffsetArr = explode('.',$offsetArr[0]);
|
||||
$bgnByte = $bgnOffsetArr[0];
|
||||
$bgnBit = $bgnOffsetArr[1];
|
||||
$endOffsetArr = explode('.',$offsetArr[1]);
|
||||
$endByte = $endOffsetArr[0];
|
||||
$endBit = $endOffsetArr[1];
|
||||
$byteLen = $endByte - $bgnByte + 1;
|
||||
$byteValue = substr($setValue,$bgnByte*2,$byteLen*2);
|
||||
//--><-//$byteValue = strrev($byteValue);
|
||||
|
||||
if($DEBUG) echo "<br>byteValue = $byteValue";
|
||||
$bitValue = '';
|
||||
if($bgnBit > 0 ||$endBit < 7){
|
||||
if($DEBUG) echo "<br>$bgnBit > 0 ||$endBit < 7";
|
||||
$bitValue = HexDec($byteValue);
|
||||
$bitValue = DecBin($bitValue);
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$bitLen = $byteLen*8;//1 byte = 8 bit
|
||||
$bitValue = omcStrFill($bitValue,$bitLen,'high','0');
|
||||
if($DEBUG) echo "<br>omcStrFill($bitValue,$bitLen,'high','0')";
|
||||
|
||||
$bitValue = strrev($bitValue);
|
||||
$catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit
|
||||
if($DEBUG) echo "<br>bitValue = substr($bitValue,$bgnBit,$catBitLen)";
|
||||
$bitValue = substr($bitValue,$bgnBit,$catBitLen);
|
||||
$bitValue = strrev($bitValue);
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
}
|
||||
|
||||
//explode by '[v]'
|
||||
$valueArr = explode('[v]',$tlvArr[2]);
|
||||
$typeAddTitleArr = explode('[t]',$valueArr[0]);
|
||||
$operType = chop($typeAddTitleArr[0]);
|
||||
$titleStr = chop($typeAddTitleArr[1]);
|
||||
$valueArr[1] = chop($valueArr[1]);
|
||||
|
||||
if($DEBUG) echo "<br>operType = $operType";
|
||||
switch($operType){
|
||||
case 'input'://
|
||||
//explode by '-'
|
||||
$defArr = explode('-',$valueArr[1]);
|
||||
if($DEBUG) echo "<br>defArr = $defArr[0],$defArr[1],$defArr[2]";
|
||||
switch($defArr[0]){
|
||||
case 'toDec':
|
||||
if(strlen($bitValue) > 0){
|
||||
$inputValue = BinDec($bitValue);
|
||||
}else{
|
||||
$inputValue = HexDec($byteValue);
|
||||
}
|
||||
break;
|
||||
case 'keepDec':
|
||||
$inputValue = $byteValue;
|
||||
break;
|
||||
case 'toHex':
|
||||
echo "<br>Error:toHex";
|
||||
break;
|
||||
case 'keepHex':
|
||||
$inputValue = $byteValue;
|
||||
break;
|
||||
case 'toAscii':
|
||||
$charValue = "";
|
||||
if($bgnBit > 0 ||$endBit < 7){
|
||||
echo "<br>Error:toAscii";
|
||||
exit(1);
|
||||
}else{
|
||||
$tmpLen=strlen($byteValue);
|
||||
for($charCount=0;$charCount<$tmpLen;$charCount++){
|
||||
$unitByte = substr($byteValue,$charCount,2);
|
||||
$unitChar = chr(HexDec($unitByte)); // hex -> ascii
|
||||
if($DEBUG) echo "<br>unitChar=$unitChar";
|
||||
$charValue .= $unitChar;
|
||||
$charCount++;
|
||||
}
|
||||
$inputValue = $charValue;
|
||||
$inputValue = trim($inputValue);//add by oven 2006-8-2 remvove dirty in Mozilla.
|
||||
}
|
||||
break;
|
||||
case 'toLatitude':
|
||||
//feake edit float
|
||||
if($byteValue[0]=='F' || $byteValue[0]=='f')
|
||||
{
|
||||
$tmp=hexdec($byteValue)-1;
|
||||
$orgbin=decbin($tmp);
|
||||
$lastbin="";
|
||||
for($ii=0;$ii<strlen($orgbin);$ii++)
|
||||
{
|
||||
if($orgbin[$ii] == '0')
|
||||
$lastbin=$lastbin."1";
|
||||
else
|
||||
$lastbin=$lastbin."0";
|
||||
}
|
||||
$last=bindec($lastbin);
|
||||
$last=-$last;
|
||||
}
|
||||
else
|
||||
$last=hexdec($byteValue);
|
||||
$inputValue=$last*90/pow(2,23);
|
||||
if(strlen($inputValue)>8)
|
||||
$inputValue=substr($inputValue,0,8);
|
||||
|
||||
if($inputValue > 90 || $inputValue < -90)
|
||||
{
|
||||
/**************************************************/
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "alert('The value must be -90.00 to 90.00');\n";
|
||||
echo "</script>\n";
|
||||
/***************************************************/
|
||||
}
|
||||
break;
|
||||
case 'toLongitude':
|
||||
if($byteValue[0]=='F' || $byteValue[0]=='f')
|
||||
{
|
||||
$tmp=hexdec($byteValue)-1;
|
||||
$orgbin=decbin($tmp);
|
||||
$lastbin="";
|
||||
for($ii=0;$ii<strlen($orgbin);$ii++)
|
||||
{
|
||||
if($orgbin[$ii] == '0')
|
||||
$lastbin=$lastbin."1";
|
||||
else
|
||||
$lastbin=$lastbin."0";
|
||||
}
|
||||
$last=bindec($lastbin);
|
||||
$last=-$last;
|
||||
}
|
||||
else
|
||||
$last=hexdec($byteValue);
|
||||
$inputValue=$last*360/pow(2,24);
|
||||
if(strlen($inputValue)>8)
|
||||
$inputValue=substr($inputValue,0,8);
|
||||
|
||||
if($inputValue > 180 || $inputValue < -180)
|
||||
{
|
||||
/**************************************************/
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "alert('The value must be -180.00 to 180.00');\n";
|
||||
echo "</script>\n";
|
||||
/***************************************************/
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "<br>Error:valueType=$defArr[0]";
|
||||
break;
|
||||
}
|
||||
if($DEBUG)echo "<br>inputValue = $inputValue";
|
||||
switch($defArr[1]){
|
||||
case 'high':
|
||||
switch($defArr[2]){
|
||||
case '0':
|
||||
if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){
|
||||
//$inputValue = str_replace('0','',$inputValue);
|
||||
}else if($defArr[0] == 'toAscii'){
|
||||
for($ii=0;$ii<strlen($inputValue);$ii++){
|
||||
if($inputValue[$ii]=='0')
|
||||
$inputValue[$ii]='';
|
||||
else
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
$inputValue = $inputValue - 0;
|
||||
}
|
||||
break;
|
||||
case 'E':
|
||||
echo "Error:high fill E";
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 'low':
|
||||
if ("toAscii" != $defArr[0]) {
|
||||
switch($defArr[2]){
|
||||
case '0':
|
||||
$inputValue = str_replace('00','',$inputValue);
|
||||
break;
|
||||
case 'E':
|
||||
$inputValue = str_replace('E','',$inputValue);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
if($defArr[0] == 'toAscii'){
|
||||
$inputLen = $byteLen;
|
||||
}elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){
|
||||
$inputLen = $byteLen *2;
|
||||
}else{
|
||||
$inputLen = $byteLen *3;
|
||||
}
|
||||
echo "<input type=\"text\" size=\"$inputLen\" maxLength =\"$inputLen\" name=\"$unitName\" value=\"$inputValue\" class=\"text\">";
|
||||
|
||||
break;
|
||||
case 'select':
|
||||
if($bitValue != ''){
|
||||
$selectValue = BinDec($bitValue);
|
||||
}else{
|
||||
$selectValue = HexDec($byteValue);
|
||||
}
|
||||
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
if($DEBUG) echo "<br>selectValue = $selectValue";
|
||||
|
||||
echo "<select size=\"1\" name=\"$unitName\">";
|
||||
$isSelected = 0;
|
||||
for($j=1;$j<sizeof($valueArr);$j++){
|
||||
//explode by '[opt]'
|
||||
$defArr = explode('[opt]',$valueArr[$j]);
|
||||
if(sizeof($defArr) < 2){
|
||||
echo "<option value=\"$selectValue\" selected>Reserved Value</option>";
|
||||
break;
|
||||
}elseif($defArr[0] == $selectValue){
|
||||
echo "<option value=\"$defArr[0]\" selected>$defArr[1]</option>";
|
||||
$isSelected = 1;
|
||||
}else{
|
||||
echo "<option value=\"$defArr[0]\">$defArr[1]</option>";
|
||||
}
|
||||
}
|
||||
|
||||
if($isSelected ==0 && $j == sizeof($valueArr)){
|
||||
echo "<option value=\"$selectValue\" selected>Undefined Value</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
break;
|
||||
default: echo "<br>Error:operType =|$operType|";
|
||||
break;
|
||||
}//end of switch(..)
|
||||
//like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType-
|
||||
|
||||
if($operType == 'select'){ //select
|
||||
$tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0';
|
||||
}else{
|
||||
$tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1];
|
||||
}
|
||||
$tempDef = str_replace(" ", "", $tempDef);
|
||||
$tempDef = chop($tempDef);
|
||||
echo "\n <input type=\"hidden\" name=\"unitDef_$i\" value=\"$tempDef\">";
|
||||
echo "</td></tr>";
|
||||
}//end of for(..)
|
||||
|
||||
echo "</table>";
|
||||
|
||||
$remark=nl2br($remark);
|
||||
echo "<br><b>Remarks:</b><br>$remark<br><br>";
|
||||
$unitNum = $i-1;
|
||||
echo "\n<input type=\"hidden\" name=\"unitNum\" value=\"$unitNum\">";
|
||||
echo "\n<input type=\"hidden\" name=\"sysId\" value=\"$sysId\">";
|
||||
echo "\n<input type=\"hidden\" name=\"oidStr\" value=\"$oidStr\">";
|
||||
echo "\n<input type=\"hidden\" name=\"instanceNo\" value=\"$instanceNo\">";
|
||||
echo "\n<input type=\"hidden\" name=\"spanId\" value=\"$spanId\">";
|
||||
echo "\n<input type=\"submit\" name=\"set\" value = \"Set\">";
|
||||
echo "\n<input type=\"reset\" name=\"Reset\" value =\"Reset\">";
|
||||
echo "</Form>";
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
182
wxc2_omc/configuration/paramConfiguration/lockTimeSlot.php
Executable file
182
wxc2_omc/configuration/paramConfiguration/lockTimeSlot.php
Executable file
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("../sub_inc/operWebFunc.inc");
|
||||
require("param_comm.inc");
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function selectAll(entries)
|
||||
{
|
||||
var select_state=document.myform.cbSelectAll.checked;
|
||||
if(select_state==true)
|
||||
{
|
||||
for(i=1;i<entries;i++)
|
||||
{
|
||||
var cmd="document.myform.cb_"+i;
|
||||
if(eval(cmd) != null)
|
||||
{
|
||||
cmd="document.myform.cb_"+i+".checked=true";
|
||||
eval(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=1;i<entries;i++)
|
||||
{
|
||||
var cmd="document.myform.cb_"+i;
|
||||
if(eval(cmd) != null)
|
||||
{
|
||||
cmd="document.myform.cb_"+i+".checked=false";
|
||||
eval(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function closeWindow(sysId,tableOid,instanceNo)
|
||||
{
|
||||
window.opener.location.href="./param_show_table.php?sysId="+sysId+"&tableOid="+tableOid+"&instanceNo="+instanceNo;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
//echo "sysId=$sysId,instanceNo=$instanceNo,oidStr=$oidStr,tableOid=$tableOid,opt=$opt<br>";
|
||||
$trunkTimeSlotEntriesFiled="trunkTimeSlotEntries";
|
||||
//get the trunkTimeSlotEntries oid
|
||||
$sql="select level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 from OBJ_320.paramConf where name_2='$trunkTimeSlotEntriesFiled' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
if($num == 0)
|
||||
exit($trunkTimeSlotEntriesFiled." do not exist!<br>");
|
||||
$pos=0;
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$trunkTimeSlotEntriesOid="";
|
||||
while($row[$pos]!=0)
|
||||
{
|
||||
$trunkTimeSlotEntriesOid.="{$row[$pos]}.";
|
||||
$pos++;
|
||||
}
|
||||
$trunkTimeSlotEntriesOid=substr($trunkTimeSlotEntriesOid,0,strlen($trunkTimeSlotEntriesOid)-1);
|
||||
//echo "trunkTimeSlotEntriesOid=$trunkTimeSlotEntriesOid<br>";
|
||||
|
||||
//get the trunkTimeSlotEntries value
|
||||
$oidWhere=getLevelWhere($trunkTimeSlotEntriesOid);
|
||||
$sql="select readValue from OBJ_320.param_99 where $oidWhere and instanceNo='$instanceNo' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$trunkTimeSlotEntriesValue=$row[0]+0;
|
||||
//echo "Entries={$row[0]} {$instanceNo}<br>";
|
||||
|
||||
|
||||
//show the title
|
||||
$split=explode(".",$instanceNo);
|
||||
$tgno=$split[0]+0;
|
||||
$tkno=$split[1]+0;
|
||||
echo "<b>MSC > Trunk Group $tgno > Trunk $tkno > Time Slot</b><p>";
|
||||
|
||||
//set
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST")
|
||||
{
|
||||
echo "Set parameter...<br>";
|
||||
//echo "trunkTimeSlotEntriesValue=$trunkTimeSlotEntriesValue";
|
||||
if($trunkTimeSlotEntriesValue==24)
|
||||
$totalNum=25;
|
||||
else if($trunkTimeSlotEntriesValue==32)
|
||||
$totalNum=32;
|
||||
for($i=1;$i<$totalNum;$i++)
|
||||
{
|
||||
$param="cb_".$i;
|
||||
$value=$$param;
|
||||
$index=0;
|
||||
if($value=="on")
|
||||
{
|
||||
$newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4);
|
||||
|
||||
$tmpWhere=getLevelWhere("2.4.3.1.4");
|
||||
$updateSql="UPDATE OBJ_320.param_99 SET initValue=$typeValue WHERE $tmpWhere AND instanceNo='$newInstanceNo'";
|
||||
mysqli_query($pubConn,$updateSql);
|
||||
//echo "typeValue=$typeValue,updateSql=$updateSql<p>";
|
||||
|
||||
/*
|
||||
$commInfoArr[$index][sysId]=$sysId;
|
||||
$commInfoArr[$index][oid]="2.4.3.1.4";
|
||||
$commInfoArr[$index][instanceNo]=$newInstanceNo;
|
||||
$index++;
|
||||
*/
|
||||
$commIdStr=oidSysCommSend($sysId,3,"2.4.3.1.4",$selectedSysId=-1,$newInstanceNo);
|
||||
//checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&instanceNo=$instanceNo");
|
||||
//echo "set $newInstanceNo<br>";
|
||||
|
||||
echo "<img width=10 height=10 src=\"../../images/arrow.gif\">";
|
||||
}
|
||||
}
|
||||
echo "<br>";
|
||||
/*
|
||||
if($index > 0)
|
||||
{
|
||||
setParam($commInfoArr);
|
||||
}
|
||||
*/
|
||||
|
||||
echo "<a href=\"javascript:closeWindow('$sysId','$tableOid','$instanceNo');\">Close</a>";
|
||||
exit("");
|
||||
}
|
||||
|
||||
echo "<form name=\"myform\" action=\"lockTimeSlot.php?sysId=$sysId&oidStr=$oidStr&instanceNo=$instanceNo&tableOid=$tableOid\" method=\"post\">";
|
||||
|
||||
echo "Type <select size=1 name=\"typeValue\">";
|
||||
|
||||
if($opt == 'lock')
|
||||
{
|
||||
echo "<option value=0>disable</option>";
|
||||
echo "<option value=1>incoming</option>";
|
||||
echo "<option value=2>outgoing</option>";
|
||||
}
|
||||
else if($opt == 'unlock')
|
||||
{
|
||||
echo "<option value=3>bidirectional</option>";
|
||||
}
|
||||
echo "</select><p>";
|
||||
|
||||
|
||||
|
||||
if($trunkTimeSlotEntriesValue==24)
|
||||
$totalNum=25;
|
||||
else if($trunkTimeSlotEntriesValue==32)
|
||||
$totalNum=32;
|
||||
echo "<table border=0 width=50%>";
|
||||
echo "<tr bgcolor=#cecece>";
|
||||
echo "<td width=45%>Select All Time Slots</td>";
|
||||
echo "<td width=5%><input type=checkbox name=\"cbSelectAll\" onClick=\"javascript:selectAll('$totalNum');\">";
|
||||
echo "</tr>";
|
||||
//do not need time slot 0
|
||||
|
||||
for($i=1;$i<$totalNum;$i++)
|
||||
{
|
||||
$cbname="cb_".$i;
|
||||
|
||||
$newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4);
|
||||
$tmpWhere=getLevelWhere("2.4.3.1.4");
|
||||
$sql="select readValue from OBJ_320.param_99 where $tmpWhere and instanceNo='$newInstanceNo' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
|
||||
//do not set dchanal time slot
|
||||
if($row[readValue] != 5)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td width=40%>Time Slot-$i</td>";
|
||||
echo "<td width=10%><input type=checkbox name=\"$cbname\">";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo "<p><input type=submit value=Set><p>";
|
||||
|
||||
|
||||
echo "</form>";
|
||||
|
||||
echo "<b>Remark:</b><br>";
|
||||
?>
|
||||
446
wxc2_omc/configuration/paramConfiguration/mscNITZ.php
Executable file
446
wxc2_omc/configuration/paramConfiguration/mscNITZ.php
Executable file
@@ -0,0 +1,446 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function closeWindow(sysId,tableOid,table_type,instanceNo)
|
||||
{
|
||||
window.opener.location.href="./param_edit.php?sysId="+sysId+"&tableOid="+tableOid+"&table_type="+table_type+"&instanceNo="+instanceNo;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
if($DEBUG)echo "sysId=$sysId<br>param_oid=$param_oid<br>";
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST")
|
||||
{
|
||||
echo "coding_scheme_select=$coding_scheme_select<br>";
|
||||
echo "network_name_text=$network_name_text<br>";
|
||||
echo "ci_select=$ci_select<br>";
|
||||
echo "time_update_option_select=$time_update_option_select<br>";
|
||||
echo "time_zone_select=$time_zone_select<br>";
|
||||
|
||||
$network_name_7bit_vec=string8bitTo7bit($network_name_text);
|
||||
$network_name_7bit_hexlen=sizeof($network_name_7bit_vec);
|
||||
$network_name_7bit_hexlen=$global_len;
|
||||
$network_name_7bit_hexstr="";
|
||||
for($i=0;$i<$network_name_7bit_hexlen;$i++)
|
||||
{
|
||||
$tmp=dechex($network_name_7bit_vec[$i]);
|
||||
$tmp=omc_keep_length($tmp,0,2);
|
||||
$network_name_7bit_hexstr.=$tmp;
|
||||
}
|
||||
$network_name_7bit_hexstr=omc_keep_length($network_name_7bit_hexstr,0,62,0);
|
||||
$tmp=dechex($network_name_7bit_hexlen);
|
||||
$tmp=omc_keep_length($tmp,0,2);
|
||||
$last_hex_value=$tmp;
|
||||
|
||||
$spare_bit_num=strlen($network_name_text)%8;
|
||||
$byte3bin="1";
|
||||
if($coding_scheme_select == 0)
|
||||
$byte3bin.="000";
|
||||
else
|
||||
$byte3bin.="001";
|
||||
if($ci_select == 1)
|
||||
$byte3bin.="1";
|
||||
else
|
||||
$byte3bin.="0";
|
||||
|
||||
$spare_bit_num_bin=decbin($spare_bit_num);
|
||||
$spare_bit_num_bin=omc_keep_length($spare_bit_num_bin,0,3);
|
||||
$byte3bin.=$spare_bit_num_bin;
|
||||
|
||||
$byte3hex=omc_keep_length(dechex(bindec($byte3bin)),0,2);
|
||||
$last_hex_value.=$byte3hex;
|
||||
$last_hex_value.=$network_name_7bit_hexstr;
|
||||
|
||||
$time_update_option_hex=omc_keep_length(dechex($time_update_option_select),0,2);
|
||||
$time_zone_hex=omc_keep_length(dechex($time_zone_select),0,2);
|
||||
|
||||
$last_hex_value.=$time_update_option_hex;
|
||||
$last_hex_value.=$time_zone_hex;
|
||||
echo "last_hex_value=$last_hex_value<br>";
|
||||
$levels=getLevelWhere($param_oid);
|
||||
$updSql = "UPDATE OBJ_320.param_99 SET initValue='$last_hex_value' WHERE $levels and instanceNo='$instanceNo' ";
|
||||
mysqli_query($pubConn,$updSql);
|
||||
echo mysqli_error($pubConn);
|
||||
echo "";
|
||||
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "closeWindow('$sysId','$tableOid','$table_type','$instanceNo');\n";
|
||||
echo "</script>\n";
|
||||
|
||||
}
|
||||
|
||||
$pubDb="OMC_PUB";
|
||||
|
||||
$mscTable="OBJ_320.param_99";
|
||||
$levels=getLevelWhere($param_oid);
|
||||
$sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo";
|
||||
$res=mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($res);
|
||||
$initValue=$rows[initValue];
|
||||
//$initValue="0484d4f29c0e0000000000000000000000000000000000000000000000000000000101";
|
||||
$readValue=$rows[readValue];
|
||||
|
||||
|
||||
//decode
|
||||
$byte3=substr($initValue,2,2);
|
||||
$byte3bin=decbin(hexdec($byte3));
|
||||
$coding_scheme_value=bindec(substr($byte3bin,1,3));
|
||||
$ci_value=bindec(substr($byte3bin,4,1));
|
||||
$spare_bit_num=bindec(substr($byte3bin,5,3));
|
||||
$network_name_len=hexdec(substr($initValue,0,2));
|
||||
$network_name_value=substr($initValue,4,$network_name_len*2);
|
||||
$network_name_vec=string7bitTo8bit($network_name_value);
|
||||
$network_name_l=$global_len;
|
||||
if($spare_bit_num == 0 && $network_name_len != 0)
|
||||
$network_name_l++;
|
||||
//$network_name_l-=$network_name_l/8;
|
||||
|
||||
$network_name_value="";
|
||||
|
||||
for($i=0;$i<$network_name_l;$i++)
|
||||
{
|
||||
$network_name_value.=chr($network_name_vec[$i]);
|
||||
}
|
||||
//echo "network_name_value=$network_name_value,$network_name_l";
|
||||
//exit();
|
||||
$time_update_option_value=hexdec(substr($initValue,66,2));
|
||||
$time_zone_value=hexdec(substr($initValue,68,2));
|
||||
|
||||
/*
|
||||
echo "coding_scheme_value=$coding_scheme_value<br>";
|
||||
echo "ci_value=$ci_value<br>";
|
||||
echo "network_name_len=$network_name_len,network_name_value=$network_name_value<br>";
|
||||
echo "time_update_option_value=$time_update_option_value<br>";
|
||||
echo "time_zone_value=$time_zone_value<br>";
|
||||
*/
|
||||
|
||||
echo "<form name=myform method=post action=\"./mscNITZ.php\">";
|
||||
echo "<table border=0>";
|
||||
|
||||
//Coding Scheme
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Coding Scheme";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select size=1 name=\"coding_scheme_select\">";
|
||||
$coding_scheme_label=array(0=>"7-bit");
|
||||
for($i=0;$i<sizeof($coding_scheme_label);$i++)
|
||||
{
|
||||
if($coding_scheme_value == $i)
|
||||
echo "<option value=$i selected>{$coding_scheme_label[$i]}</option>";
|
||||
else
|
||||
echo "<option value=$i>{$coding_scheme_label[$i]}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//CI
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Add CI";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select size=1 name=\"ci_select\">";
|
||||
$ci_label=array(0=>"Off",1=>"On");
|
||||
for($i=0;$i<sizeof($ci_label);$i++)
|
||||
{
|
||||
if($ci_value == $i)
|
||||
echo "<option value=$i selected>{$ci_label[$i]}</option>";
|
||||
else
|
||||
echo "<option value=$i>{$ci_label[$i]}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Network name
|
||||
echo "<tr>";
|
||||
echo "<td>Network Name</td>";
|
||||
echo "<td>";
|
||||
echo "<input type=text maxlength=32 class=text name=\"network_name_text\" value=\"$network_name_value\">";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Time update option
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Time Update Option";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select size=1 name=\"time_update_option_select\">";
|
||||
$tup_label=array(0=>"None",1=>"Time zone",2=>"Time zone and time");
|
||||
for($i=0;$i<sizeof($tup_label);$i++)
|
||||
{
|
||||
if($time_update_option_value == $i)
|
||||
echo "<option value=$i selected>{$tup_label[$i]}</option>";
|
||||
else
|
||||
echo "<option value=$i>{$tup_label[$i]}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Time zone
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Time Zone";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select size=1 name=\"time_zone_select\">";
|
||||
$time_zone_value_label=array(
|
||||
176,
|
||||
172,
|
||||
168,
|
||||
164,
|
||||
160,
|
||||
156,
|
||||
152,
|
||||
148,
|
||||
146,
|
||||
144,
|
||||
142,
|
||||
140,
|
||||
136,
|
||||
132,
|
||||
0,
|
||||
4,
|
||||
8,
|
||||
12,
|
||||
16,
|
||||
18,
|
||||
20,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
26,
|
||||
28,
|
||||
32,
|
||||
36,
|
||||
38,
|
||||
40,
|
||||
44,
|
||||
48,
|
||||
52
|
||||
);
|
||||
|
||||
$time_zone_string_label=array(
|
||||
"GMT-12:00",
|
||||
"GMT-11:00",
|
||||
"GMT-10:00",
|
||||
"GMT-09:00",
|
||||
"GMT-08:00",
|
||||
"GMT-07:00",
|
||||
"GMT-06:00",
|
||||
"GMT-05:00",
|
||||
"GMT-04:30",
|
||||
"GMT-04:00",
|
||||
"GMT-03:30",
|
||||
"GMT-03:00",
|
||||
"GMT-02:00",
|
||||
"GMT-01:00",
|
||||
"GMT",
|
||||
"GMT+01:00",
|
||||
"GMT+02:00",
|
||||
"GMT+03:00",
|
||||
"GMT+04:00",
|
||||
"GMT+04:30",
|
||||
"GMT+05:00",
|
||||
"GMT+05:30",
|
||||
"GMT+05:45",
|
||||
"GMT+06:00",
|
||||
"GMT+06:30",
|
||||
"GMT+07:00",
|
||||
"GMT+08:00",
|
||||
"GMT+09:00",
|
||||
"GMT+09:30",
|
||||
"GMT+10:00",
|
||||
"GMT+11:00",
|
||||
"GMT+12:00",
|
||||
"GMT+13:00"
|
||||
);
|
||||
for($i=0;$i<sizeof($time_zone_value_label);$i++)
|
||||
{
|
||||
if($time_zone_value == $time_zone_value_label[$i])
|
||||
echo "<option value={$time_zone_value_label[$i]} selected>{$time_zone_string_label[$i]}</option>";
|
||||
else
|
||||
echo "<option value={$time_zone_value_label[$i]}>{$time_zone_string_label[$i]}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo "<br><b>Remark:</b><br><br>";
|
||||
echo "Network Identity and Time Zone<br><br>";
|
||||
echo "- Coding Scheme: Indicate that 7-bit or UCS2 coding scheme is used.<br>";
|
||||
echo "- Add CI: Indicate whether the MS should add the letters for the Country's Initials to the text string.<br>";
|
||||
echo "- Network Name: A text string is to pass to the MS via NITZ.<br>";
|
||||
echo "- Time Update Option: Determine whether time and time zone info is transferred to MS via NITZ.<br>";
|
||||
echo "- Time Zone: Specify the local time zone.<br>";
|
||||
|
||||
echo "<br>";
|
||||
echo "<input value=\"Set\" type=submit class=button >";
|
||||
echo " <input type=reset value=Reset class=button>";
|
||||
|
||||
echo "<input type=hidden name=\"sysId\" value=$sysId>";
|
||||
echo "<input type=hidden name=\"tableOid\" value=$tableOid>";
|
||||
echo "<input type=hidden name=\"table_type\" value=$table_type>";
|
||||
echo "<input type=hidden name=\"instanceNo\" value=$instanceNo>";
|
||||
echo "<input type=hidden name=\"param_oid\" value=$param_oid>";
|
||||
echo "</form>";
|
||||
|
||||
$global_len=0;
|
||||
function string8bitTo7bit($strin)
|
||||
{
|
||||
global $global_len;
|
||||
$len=strlen($strin);
|
||||
if($len <= 0)
|
||||
return "";
|
||||
|
||||
$global_len=$len-floor($len/8);;
|
||||
|
||||
for($i=0;$i<$len;$i++)
|
||||
{
|
||||
$inHex[$i]=ord($strin[$i]);
|
||||
switch($inHex[$i])
|
||||
{
|
||||
//'@'
|
||||
case 64:
|
||||
$inHex[$i]=0x00;
|
||||
break;
|
||||
//'$'
|
||||
case 36:
|
||||
$inHex[$i]=0x02;
|
||||
break;
|
||||
//'_'
|
||||
case 95:
|
||||
$inHex[$i]=0x11;
|
||||
break;
|
||||
//'['
|
||||
case 91:
|
||||
$inHex[$i]=0x28;
|
||||
break;
|
||||
//']'
|
||||
case 93:
|
||||
$inHex[$i]=0x29;
|
||||
break;
|
||||
//'/'
|
||||
case 47:
|
||||
$inHex[$i]=0x2f;
|
||||
break;
|
||||
//'''
|
||||
case 96:
|
||||
$inHex[$i]=0x27;
|
||||
break;
|
||||
//'{'
|
||||
case 123:
|
||||
$inHex[$i]=0x28;
|
||||
break;
|
||||
//'}'
|
||||
case 125:
|
||||
$inHex[$i]=0x29;
|
||||
break;
|
||||
case 0x82:
|
||||
$inHex[$i]=0x05;
|
||||
break;
|
||||
case 0x85:
|
||||
$inHex[$i]=0x7F;
|
||||
break;
|
||||
case 0x8A:
|
||||
$inHex[$i]=0x04;
|
||||
break;
|
||||
case 0x8D:
|
||||
$inHex[$i]=0x07;
|
||||
break;
|
||||
case 0x95:
|
||||
$inHex[$i]=0x08;
|
||||
break;
|
||||
case 0x97:
|
||||
$inHex[$i]=0x06;
|
||||
break;
|
||||
case 0x9D:
|
||||
$inHex[$i]=0x03;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$n=0;
|
||||
$index=0;
|
||||
for($i=0;$i<=$len;$i++)
|
||||
{
|
||||
if($i<$len-1)
|
||||
{
|
||||
$mid1=$inHex[$i]+0;
|
||||
$mid2=$inHex[$i+1]+0;
|
||||
$cur=($mid1 >> $n) |(($mid2 << (7-$n)) & 0xff);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mid1=$inHex[$i];
|
||||
$cur=($mid1 >> $n) & 0xff;
|
||||
}
|
||||
$outHex[$index++]=$cur;
|
||||
echo "$cur ";
|
||||
$n=($n+1)%7;
|
||||
if($n==0 )
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
//for($i=0;$i<$index;$i++)
|
||||
// $strout[$i]=chr($outHex[$i]);
|
||||
|
||||
return $outHex;
|
||||
}
|
||||
|
||||
function string7bitTo8bit($strin)
|
||||
{
|
||||
global $global_len;
|
||||
|
||||
$len=strlen($strin);
|
||||
|
||||
$ti=0;
|
||||
for($i=0;$i<$len;$i+=2)
|
||||
{
|
||||
$tmp=substr($strin,$i,2);
|
||||
$inHex[$ti]=hexdec($tmp);
|
||||
$ti++;
|
||||
}
|
||||
|
||||
$global_len=$ti+floor($ti/8);
|
||||
|
||||
|
||||
$n=0;
|
||||
$j=0;
|
||||
for($i=0;$i <= $ti;)
|
||||
{
|
||||
if($i>0)
|
||||
{
|
||||
$mid1=$inHex[$i];
|
||||
$mid2=$inHex[$i-1];
|
||||
$cur=(($mid1 << $n) & 0x7f) |($mid2 >> (8-$n));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mid1=$inHex[$i] & 0x7f;
|
||||
$cur=$mid1;
|
||||
}
|
||||
$outHex[$j++] = $cur;
|
||||
$n =($n+1)%8;
|
||||
if($n!=0)
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $outHex;
|
||||
}
|
||||
|
||||
?>
|
||||
765
wxc2_omc/configuration/paramConfiguration/param_comm.inc
Executable file
765
wxc2_omc/configuration/paramConfiguration/param_comm.inc
Executable file
@@ -0,0 +1,765 @@
|
||||
<script language="Javascript">
|
||||
function MouseOverColor(obj)
|
||||
{
|
||||
obj.bgColor="#eaeaea";
|
||||
}
|
||||
|
||||
function MouseOutColor(obj)
|
||||
{
|
||||
obj.bgColor="white";
|
||||
}
|
||||
|
||||
|
||||
function correctPNG()
|
||||
{
|
||||
for(var i=0; i<document.images.length; i++)
|
||||
{
|
||||
var img = document.images[i]
|
||||
var imgName = img.src.toUpperCase()
|
||||
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
|
||||
{
|
||||
var imgID = (img.id) ? "id='" + img.id + "' " : ""
|
||||
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
|
||||
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
|
||||
var imgStyle = "display:inline-block;" + img.style.CSSText
|
||||
if (img.align == "left") imgStyle = "float:left;" + imgStyle
|
||||
if (img.align == "right") imgStyle = "float:right;" + imgStyle
|
||||
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
|
||||
var strNewHTML = "<span " + imgID + imgClass + imgTitle
|
||||
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
|
||||
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
|
||||
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
|
||||
img.outerHTML = strNewHTML
|
||||
i = i-1
|
||||
}
|
||||
}
|
||||
}
|
||||
window.attachEvent("onload", correctPNG);
|
||||
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$PARAM_OID_PREFIX="2";
|
||||
define(MAX_SHOW_ROW_NUM,4);
|
||||
|
||||
define(UNKNOWN_TYPE,-1);
|
||||
define(LEAF_TYPE,0);
|
||||
define(SCALAR_TABLE_TYPE,1);
|
||||
define(COLUMN_TABLE_TYPE,2);
|
||||
define(ENTRY_TYPE,3);
|
||||
|
||||
$type_label=array(-1=>"unknown",0=>"LEAF_TYPE",1=>"SCALAR_TABLE_TYPE",2=>"COLUMN_TABLE_TYPE",3=>"ENTRY_TYPE");
|
||||
|
||||
//access
|
||||
define(ACCESS_TABLE_NAME,0);
|
||||
define(ACCESS_ENTRY,21);
|
||||
define(ACCESS_READ_WRITE,19);
|
||||
define(ACCESS_READ_ONLY,18);
|
||||
define(ACCESS_INDEX_CREATE_SPE,48);
|
||||
|
||||
//value type
|
||||
define(VALUE_NONE,0);
|
||||
define(VALUE_STRING,2);
|
||||
define(VALUE_INT,3);
|
||||
define(VALUE_IP,5);
|
||||
define(VALUE_TIMESTAMP,8);
|
||||
define(VALUE_OPAQUE,9);
|
||||
|
||||
//style
|
||||
define(SHOW_HIDE,0);
|
||||
define(SHOW_SELECT,1);
|
||||
define(SHOW_TEXTBOX,2);
|
||||
define(SHOW_LABEL,3);
|
||||
|
||||
//create method
|
||||
define(MANUAL_CREATE,0);
|
||||
define(AUTO_CREATE,1);
|
||||
|
||||
//nest table element
|
||||
define(TABLE_ENTRY,0);
|
||||
define(TABLE_ENTRIES,1);
|
||||
define(TABLE_CREATE,2);
|
||||
|
||||
//sysTypeNo
|
||||
define(SYSTYPENO_MSC,320);
|
||||
define(SYSTYPENO_SMSC,350);
|
||||
define(SYSTYPENO_SMPP,260);
|
||||
define(SYSTYPENO_OPPS,375);
|
||||
define(SYSTYPENO_PPS,360);
|
||||
define(SYSTYPENO_MTP3,222);
|
||||
define(SYSTYPENO_SCCP,223);
|
||||
define(SYSTYPENO_AAS,311);
|
||||
define(SYSTYPENO_VSS,390);
|
||||
define(SYSTYPENO_VLR,325);
|
||||
define(SYSTYPENO_HLR,330);
|
||||
define(SYSTYPENO_AUC,340);
|
||||
define(SYSTYPENO_SMEG,355);
|
||||
define(SYSTYPENO_EIR,380);
|
||||
define(SYSTYPENO_MRFC,385);
|
||||
define(SYSTYPENO_PALIM,378);
|
||||
define(SYSTYPENO_RLS,379);
|
||||
define(SYSTYPENO_MHC,386);
|
||||
define(SYSTYPENO_IUUPGW,389);
|
||||
function showTable($oids)
|
||||
{
|
||||
global $paraConfTable,$paraTable,$keyId,$objects;
|
||||
|
||||
$objects[$keyId]["oid"]=$oids;
|
||||
$oidLevel=getLevel($oids);
|
||||
//echo "oidLevel=$oidLevel<br>";
|
||||
$sql="select * from $paraConfTable where $oidLevel order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
$tmpKeyId=$keyId;
|
||||
if($num != 0)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$objects[$keyId]["name_1"]=$row[name_1];
|
||||
$objects[$keyId]["name_2"]=$row[name_2];
|
||||
//if(!strstr($objects[$keyId]["name_1"],"Table") && !strstr($objects[$keyId]["name_1"],"Entry"))
|
||||
$objects[$keyId]["nest_num"]=$num-1;
|
||||
$objects[$keyId]["type"]=-1;
|
||||
$objects[$keyId]["maxAccess"]=$row[maxAccess]+0;
|
||||
$objects[$keyId]["desc_1"]=$row[desc_1];
|
||||
$objects[$keyId]["valueType"]=$row[valueType]+0;
|
||||
$objects[$keyId]["setTemplate_1"]=$row[setTemplate_1];
|
||||
$objects[$keyId]["note_1"]=$row[note_1];
|
||||
$objects[$keyId]["style"]=$row[operType]+0;
|
||||
if(strstr($objects[$keyId]["name_1"],"Entry"))
|
||||
$objects[$keyId]["type"]=ENTRY_TYPE;
|
||||
|
||||
|
||||
}
|
||||
//nest
|
||||
if($num > 1)
|
||||
{
|
||||
$keyId++;
|
||||
|
||||
$isTableExsit=0;
|
||||
$isEntryExsit=0;
|
||||
do
|
||||
{
|
||||
if(strstr($row[name_1],"Table"))
|
||||
$isTableExsit=1;
|
||||
if(strstr($row[name_1],"Entry"))
|
||||
$isEntryExsit=1;
|
||||
$nextOids="";
|
||||
for($i=1;$i<=10;$i++)
|
||||
{
|
||||
$level="level_".$i;
|
||||
if(($row[$level]+0) > 0)
|
||||
$nextOids.=".{$row[$level]}";
|
||||
}
|
||||
$nextOids=substr($nextOids,1);
|
||||
if($nextOids != $oids)
|
||||
{
|
||||
showTable($nextOids);
|
||||
//echo "<br>$nextOids<br>";
|
||||
}
|
||||
}while($row=@mysqli_fetch_array($res));
|
||||
|
||||
if($isTableExsit && $isEntryExsit)
|
||||
{
|
||||
$objects[$tmpKeyId]["type"]=COLUMN_TABLE_TYPE;
|
||||
}
|
||||
else if($isTableExsit == 0 && $isEntryExsit == 0)
|
||||
{
|
||||
$objects[$tmpKeyId]["type"]=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$objects[$keyId]["type"]=LEAF_TYPE;
|
||||
$keyId++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showParamInReadOnly($keyId,$sysId)
|
||||
{
|
||||
global $objects;
|
||||
|
||||
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
if(checkIndependSystem($sysTypeNo))//Plat
|
||||
$paraTable=$objDb.".param_".$sysNo;
|
||||
else
|
||||
$paraTable=$objDb.".param_99";
|
||||
|
||||
$oid=$objects[$keyId]['oid'];
|
||||
$oidwhere=getLevelWhere($oid);
|
||||
$sql="select initValue from $paraTable where $oidwhere and instanceNo='0000' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
if($num != 0)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$returnvalue=$row[initValue];
|
||||
if(($objects[$keyId]["style"] == SHOW_LABEL || $objects[$keyId]["style"] == SHOW_SELECT )&& $objects[$keyId]["valueType"] == VALUE_INT)
|
||||
{
|
||||
if(trim($objects[$keyId]["setTemplate_1"]) == "")
|
||||
return $returnvalue;
|
||||
$options=explode(";",$objects[$keyId]["setTemplate_1"]);
|
||||
for($ii=0;$ii<sizeof($options);$ii++)
|
||||
{
|
||||
$tmp=explode("=",$options[$ii]);
|
||||
$val=$tmp[0];
|
||||
$opt=$tmp[1];
|
||||
if($returnvalue == $opt)
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$returnvalue="--";
|
||||
}
|
||||
|
||||
//discard the postfix E of the opaque
|
||||
if($objects[$keyId]["valueType"] == 9)
|
||||
{
|
||||
$split=explode("[unit]",$objects[$keyId]["setTemplate_1"]);
|
||||
$len=sizeof($split);
|
||||
//only one unit
|
||||
//if($len == 2)
|
||||
{
|
||||
$split2=explode("keepHex-low-",$objects[$keyId]["setTemplate_1"]);
|
||||
$repl=substr($split2[1],0,1);
|
||||
$returnvalue=str_replace($repl," ",$returnvalue);
|
||||
}
|
||||
}
|
||||
|
||||
if(trim($returnvalue) == "")
|
||||
$returnvalue="--";
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
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+=2;
|
||||
if($levelNo<=10)
|
||||
$levelWhere.=" AND level_$levelNo=0 ";
|
||||
return($levelWhere);
|
||||
}
|
||||
|
||||
function getParamValue($sysId,$oid,$instanceNo)
|
||||
{
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
|
||||
|
||||
|
||||
if(checkIndependSystem($sysTypeNo))//Plat
|
||||
$paraTable=$objDb.".param_".$sysNo;
|
||||
else
|
||||
$paraTable=$objDb.".param_99";
|
||||
$oidWhere=getLevelWhere($oid);
|
||||
|
||||
if(strstr($instanceNo,"."))
|
||||
$sql="select initValue from $paraTable where $oidWhere and instanceNo='$instanceNo' ";
|
||||
else
|
||||
$sql="select initValue from $paraTable where $oidWhere and instanceNo=$instanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=mysqli_num_rows($res);
|
||||
if($num == 0)
|
||||
return "--";
|
||||
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$originalValue=$row[initValue];
|
||||
|
||||
return $originalValue;
|
||||
}
|
||||
|
||||
function getShowNameOfTable($name,$keyId)
|
||||
{
|
||||
global $objects;
|
||||
|
||||
if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:"))
|
||||
{
|
||||
$new_name=explode("Name:",$objects[$keyId]['desc_1']);
|
||||
return str_replace(";","",$new_name[sizeof($new_name)-1]);
|
||||
}
|
||||
|
||||
$len=strlen($name);
|
||||
$result="";
|
||||
|
||||
if($name[0]>='a' && $name[0]<='z')
|
||||
$result.=chr(ord($name[0])-32);
|
||||
for($i=1;$i<$len;$i++)
|
||||
{
|
||||
if($i != 1)
|
||||
if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z')
|
||||
$result.=" ";
|
||||
|
||||
if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z')
|
||||
$result.=" ";
|
||||
|
||||
$result.=$name[$i];
|
||||
|
||||
if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9'))
|
||||
$result.=" ";
|
||||
if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9'))
|
||||
$result.=" ";
|
||||
}
|
||||
|
||||
$result=str_replace("Table","",$result);
|
||||
$result=str_replace("Entry","",$result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getShowNameOfField($name,$keyId)
|
||||
{
|
||||
global $objects;
|
||||
|
||||
if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:"))
|
||||
{
|
||||
$new_name=explode("Name:",$objects[$keyId]['desc_1']);
|
||||
return str_replace(";","",$new_name[sizeof($new_name)-1]);
|
||||
}
|
||||
|
||||
$len=strlen($name);
|
||||
$result="";
|
||||
|
||||
for($j=0;$j<$len;$j++)
|
||||
{
|
||||
if($name[$j]>='A' && $name[$j]<='Z')
|
||||
break;
|
||||
}
|
||||
for($i=$j;$i<$len;$i++)
|
||||
{
|
||||
if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z')
|
||||
$result.=" ";
|
||||
|
||||
if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z')
|
||||
$result.=" ";
|
||||
|
||||
$result.=$name[$i];
|
||||
|
||||
if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9'))
|
||||
$result.=" ";
|
||||
if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9'))
|
||||
$result.=" ";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function translateValueToOpt($keyId,$value)
|
||||
{
|
||||
global $objects;
|
||||
|
||||
$operType=$objects[$keyId]['style'];
|
||||
$valueType=$objects[$keyId]['valueType'];
|
||||
$template=$objects[$keyId]['setTemplate_1'];
|
||||
|
||||
if(($operType == SHOW_LABEL || $operType == SHOW_SELECT) && $valueType == VALUE_INT)
|
||||
{
|
||||
if(trim($template) == "")
|
||||
return $value;
|
||||
$options=explode(";",$template);
|
||||
for($ii=0;$ii<sizeof($options);$ii++)
|
||||
{
|
||||
$tmp=explode("=",$options[$ii]);
|
||||
$val=$tmp[0];
|
||||
$opt=$tmp[1];
|
||||
if($value == $opt)
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function getTableNameByOid($sysId,$oid)
|
||||
{
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
|
||||
$oidWhere=getLevelWhere($oid);
|
||||
$sql="select name_1 from $paraConfTable where $oidWhere ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=mysqli_num_rows($res);
|
||||
if($num == 0)
|
||||
return "--";
|
||||
|
||||
$row=@mysqli_fetch_array($res);
|
||||
return $row[name_1];
|
||||
}
|
||||
|
||||
function checkTableNest($sysId,$table_oid)
|
||||
{
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
|
||||
$tmpwhere=getLevelWhere($table_oid);
|
||||
|
||||
$sql="select * from $paraConfTable where $tmpwhere and name_1 like '%CreateEntry%' ";
|
||||
//echo "$sql<hr>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=mysqli_num_rows($res);
|
||||
if($num > 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
tableName: the name of the table, rountingSelection for example. case-ignored
|
||||
$type: TABLE_ENTRY, TABLE_ENTRIES, TABLE_CREATE
|
||||
*/
|
||||
function findRelationOid($tableName,$type,$sysTypeNo)
|
||||
{
|
||||
$tableName=strtolower($tableName);
|
||||
$dbtable="OBJ_".$sysTypeNo.".paramConf";
|
||||
if($type == TABLE_ENTRY)
|
||||
$likestr=$tableName."Entry";
|
||||
else if($type == TABLE_ENTRIES)
|
||||
$likestr=$tableName."Entries";
|
||||
else if($type == TABLE_CREATE)
|
||||
$likestr="CreateEntry".$tableName;
|
||||
|
||||
$sql="select * from $dbtable where name_1 like '%$likestr%' ";
|
||||
//echo "<br>$sql<br>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=mysqli_num_rows($res);
|
||||
if($num == 0)
|
||||
return "";
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$findOid="";
|
||||
for($i=1;$i<=10;$i++)
|
||||
{
|
||||
if($row["level_".$i] == '0')
|
||||
break;
|
||||
$findOid.=$row["level_".$i].".";
|
||||
}
|
||||
$findOid=substr($findOid,0,strlen($findOid)-1);
|
||||
//PrintInfo("tableName=$tableName,dbtable=$dbtable,oid=$findOid");
|
||||
return $findOid;
|
||||
}
|
||||
|
||||
function getTableLevel($tableOid,$sysTypeNo)
|
||||
{
|
||||
$tableWhere=getLevelWhere($tableOid);
|
||||
$database="OBJ_".$sysTypeNo.".paramConf";
|
||||
$sql="select desc_1 from $database where $tableWhere ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$desc_1=$row[desc_1];
|
||||
$tmp=explode("level:",$desc_1);
|
||||
$level=$tmp[1]+0;
|
||||
return $level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showTitle($page,$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name,$table_type=1)
|
||||
{
|
||||
if($page == "edit")
|
||||
{
|
||||
$tableName=getTableNameByOid($sysId,$tableOid);
|
||||
$tmp=explode("Entry",$tableName);
|
||||
$titleTableName=$tmp[0];
|
||||
//printInfo("show_table instanceNo=".$instanceNo.",tableOid=".$tableOid.",$tableName");
|
||||
$level=getTableLevel($tableOid,$sysTypeNo);
|
||||
$titlelevel=$level;
|
||||
$titleTableOid=$tableOid;
|
||||
$titleInstanceNo=$instanceNo;
|
||||
echo "<p><a href=\"param_show_down.php?tableOid=2&sysId=$sysId&instanceNo=0000&table_type=0\">";
|
||||
echo "<b>$module_name</b></a>";
|
||||
while(1)
|
||||
{
|
||||
//get table name
|
||||
$tableName=getTableNameByOid($sysId,$titleTableOid);
|
||||
//check whether it have the new name
|
||||
$clevel=getLevelWhere($titleTableOid);
|
||||
$dbtable="OBJ_".$sysTypeNo.".paramConf";
|
||||
$oidsplit=explode(".",$titleTableOid);
|
||||
$oidsize=sizeof($oidsplit)+1;
|
||||
$zerowhere=" level_$oidsize=0 ";
|
||||
$checksql="select * from $dbtable where $clevel and $zerowhere and desc_1 like '%Name:%' ";
|
||||
$checkres=@mysqli_query($pubConn,$checksql);
|
||||
$checknum=mysqli_num_rows($checkres);
|
||||
if($checknum == 1)
|
||||
{
|
||||
$checkrow=@mysqli_fetch_array($checkres);
|
||||
$new_name=explode("Name:",$checkrow[desc_1]);
|
||||
$title_new_name[$level]=str_replace(";","",$new_name[sizeof($new_name)-1]);
|
||||
}
|
||||
else
|
||||
$title_new_name[$level]="none";
|
||||
|
||||
$tableName=str_replace("Entry","",$tableName);
|
||||
//echo "tableOid=$titleTableOid,tableName=$tableName instanceNo=$titleInstanceNo";
|
||||
//echo "<a href=\"param_show_table.php?sysId=$sysId&table_type=1&tableOid=$titleTableOid&instanceNo=$titleInstanceNo\">$tableName</a>";
|
||||
$title_oid[$level]=$titleTableOid;
|
||||
$title_name[$level]=$tableName;
|
||||
$title_instanceNo[$level]=$titleInstanceNo;
|
||||
|
||||
$titleTableOid=findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo);
|
||||
if($titleTableOid == "")
|
||||
break;
|
||||
|
||||
$ttmp=explode(".",$titleTableOid);
|
||||
$sizet=sizeof($ttmp)-1;
|
||||
$titleTableOid="";
|
||||
for($ti=0;$ti<$sizet;$ti++)
|
||||
{
|
||||
$titleTableOid.="{$ttmp[$ti]}.";
|
||||
}
|
||||
$titleTableOid=substr($titleTableOid,0,strlen($titleTableOid)-1);
|
||||
|
||||
$ttmp=explode(".",$titleInstanceNo);
|
||||
$sizet=sizeof($ttmp);
|
||||
if($sizet == 1)
|
||||
$titleInstanceNo="0000";
|
||||
else
|
||||
{
|
||||
$titleInstanceNo="";
|
||||
for($ti=0;$ti<$sizet-1;$ti++)
|
||||
{
|
||||
$titleInstanceNo.="{$ttmp[$ti]}.";
|
||||
}
|
||||
$titleInstanceNo=substr($titleInstanceNo,0,strlen($titleInstanceNo)-1);
|
||||
}
|
||||
$level--;
|
||||
}
|
||||
for($index=1;$index<=$titlelevel;$index++)
|
||||
{
|
||||
if($index == 1)
|
||||
$thisinstance="0000";
|
||||
else
|
||||
$thisinstance=$title_instanceNo[$index-1];
|
||||
echo "> ";
|
||||
echo "<a href=\"param_show_table.php?sysId=$sysId&table_type=1&tableOid={$title_oid[$index]}&instanceNo={$thisinstance}\">";
|
||||
$showName=getShowNameOfTable($title_name[$index],-1);
|
||||
|
||||
if($title_new_name[$index] != "none")
|
||||
$showName=$title_new_name[$index];
|
||||
|
||||
echo "<b>{$showName}</b></a>";
|
||||
$thisinstance=$title_instanceNo[$index];
|
||||
$ttmp=explode(".",$thisinstance);
|
||||
$instanceShow=$ttmp[sizeof($ttmp)-1]+0;
|
||||
if($index == $titlelevel)
|
||||
echo " <b>$instanceShow</b> ";
|
||||
else
|
||||
{
|
||||
echo "<a href=\"param_edit.php?sysId=$sysId&table_type=1&tableOid={$title_oid[$index]}&instanceNo={$thisinstance}\";>";
|
||||
echo " <b>$instanceShow</b> ";
|
||||
echo "</a>";
|
||||
}
|
||||
}
|
||||
echo "<br>";
|
||||
}
|
||||
else if($page == "show")
|
||||
{
|
||||
$tableName=getTableNameByOid($sysId,$tableOid);
|
||||
$tmp=explode("Entry",$tableName);
|
||||
$titleTableName=$tmp[0];
|
||||
//printInfo("show_table instanceNo=".$instanceNo.",tableOid=".$tableOid.",$tableName");
|
||||
$level=getTableLevel($tableOid,$sysTypeNo);
|
||||
$titlelevel=$level;
|
||||
$titleTableOid=$tableOid;
|
||||
$titleInstanceNo=$instanceNo;
|
||||
echo "<p><a href=\"param_show_down.php?tableOid=2&sysId=$sysId&instanceNo=0000&table_type=0\">";
|
||||
echo "<b>$module_name</b></a>";
|
||||
while(1)
|
||||
{
|
||||
//get table name
|
||||
$tableName=getTableNameByOid($sysId,$titleTableOid);
|
||||
//check whether it have the new name
|
||||
$clevel=getLevelWhere($titleTableOid);
|
||||
$dbtable="OBJ_".$sysTypeNo.".paramConf";
|
||||
$oidsplit=explode(".",$titleTableOid);
|
||||
$oidsize=sizeof($oidsplit)+1;
|
||||
$zerowhere=" level_$oidsize=0 ";
|
||||
$checksql="select * from $dbtable where $clevel and $zerowhere and desc_1 like '%Name:%' ";
|
||||
$checkres=@mysqli_query($pubConn,$checksql);
|
||||
$checknum=mysqli_num_rows($checkres);
|
||||
if($checknum == 1)
|
||||
{
|
||||
$checkrow=@mysqli_fetch_array($checkres);
|
||||
$new_name=explode("Name:",$checkrow[desc_1]);
|
||||
$title_new_name[$level]=str_replace(";","",$new_name[sizeof($new_name)-1]);
|
||||
}
|
||||
else
|
||||
$title_new_name[$level]="none";
|
||||
|
||||
$tableName=str_replace("Entry","",$tableName);
|
||||
//echo "tableOid=$titleTableOid,tableName=$tableName instanceNo=$titleInstanceNo";
|
||||
//echo "<a href=\"param_show_table.php?sysId=$sysId&table_type=1&tableOid=$titleTableOid&instanceNo=$titleInstanceNo\">$tableName</a>";
|
||||
$title_oid[$level]=$titleTableOid;
|
||||
$title_name[$level]=$tableName;
|
||||
$title_instanceNo[$level]=$titleInstanceNo;
|
||||
|
||||
$titleTableOid=findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo);
|
||||
if($titleTableOid == "")
|
||||
break;
|
||||
|
||||
$ttmp=explode(".",$titleTableOid);
|
||||
$sizet=sizeof($ttmp)-1;
|
||||
$titleTableOid="";
|
||||
for($ti=0;$ti<$sizet;$ti++)
|
||||
{
|
||||
$titleTableOid.="{$ttmp[$ti]}.";
|
||||
}
|
||||
$titleTableOid=substr($titleTableOid,0,strlen($titleTableOid)-1);
|
||||
|
||||
$ttmp=explode(".",$titleInstanceNo);
|
||||
$sizet=sizeof($ttmp);
|
||||
if($sizet == 1)
|
||||
$titleInstanceNo="0000";
|
||||
else
|
||||
{
|
||||
$titleInstanceNo="";
|
||||
for($ti=0;$ti<$sizet-1;$ti++)
|
||||
{
|
||||
$titleInstanceNo.="{$ttmp[$ti]}.";
|
||||
}
|
||||
$titleInstanceNo=substr($titleInstanceNo,0,strlen($titleInstanceNo)-1);
|
||||
}
|
||||
$level--;
|
||||
}
|
||||
for($index=1;$index<=$titlelevel;$index++)
|
||||
{
|
||||
echo "> ";
|
||||
echo "<a href=\"param_show_table.php?sysId=$sysId&table_type=1&tableOid={$title_oid[$index]}&instanceNo={$title_instanceNo[$index]}\">";
|
||||
$showName=getShowNameOfTable($title_name[$index],-1);
|
||||
|
||||
if($title_new_name[$index] != "none")
|
||||
$showName=$title_new_name[$index];
|
||||
|
||||
echo "<b>{$showName}</b></a>";
|
||||
if($index == $titlelevel)
|
||||
{
|
||||
$instanceShow="";
|
||||
}
|
||||
else
|
||||
{
|
||||
$thisinstance=$title_instanceNo[$index+1];
|
||||
$ttmp=explode(".",$thisinstance);
|
||||
$instanceShow=$ttmp[sizeof($ttmp)-1]+0;
|
||||
}
|
||||
echo "<a href=\"param_edit.php?sysId=$sysId&table_type=1&tableOid={$title_oid[$index]}&instanceNo={$thisinstance}\";>";
|
||||
echo " <b>$instanceShow</b> ";
|
||||
echo "</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
This function is for the special issue of getting msc timeslot
|
||||
Get the timeslot parameter from plat which the Group ID specify in trunk
|
||||
*/
|
||||
function GetTrunkGroupID($tgno,$trunkno)
|
||||
{
|
||||
$trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"trunkEntry");
|
||||
|
||||
$tgno_w=omc_keep_length($tgno,"0",4);
|
||||
$trunkno_w=omc_keep_length($trunkno,"0",4);
|
||||
$instance=$tgno_w.".".$trunkno_w;
|
||||
|
||||
oidSysCommSend("320_99_99", 0, $trunk_table_oid, -1, $instance);
|
||||
|
||||
$trunkGroupID_oid=GetOIDByName(SYSTYPENO_MSC,"trunkGroupID");
|
||||
$oidWhere=getLevelWhere($trunkGroupID_oid);
|
||||
|
||||
$sql="select * from OBJ_320.param_99 where $oidWhere and instanceNo= '$instance' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$value=$row[readValue]+0;
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function GetSystemStatus($sysTypeNo,$sysNo,$subSysNo=0)
|
||||
{
|
||||
$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")));
|
||||
|
||||
$sql="select * from OMC_PUB.sysInfo where sysTypeNo=$sysTypeNo and sysNo=$sysNo and subSysNo=$subSysNo ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=mysqli_num_rows($res);
|
||||
if($num == 0)
|
||||
return 0;
|
||||
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$baseStat=$row[baseStat]+0;
|
||||
if($baseStat == 0)
|
||||
return 0;
|
||||
|
||||
$updateTime=$row[updateTime];
|
||||
if($updateTime < $due_date || $updateTime > $ove_date)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function PrintInfo($info)
|
||||
{
|
||||
$command="echo '$info' >> /tmp/omcdebug.txt ";
|
||||
system($command);
|
||||
}
|
||||
?>
|
||||
807
wxc2_omc/configuration/paramConfiguration/param_edit.php
Executable file
807
wxc2_omc/configuration/paramConfiguration/param_edit.php
Executable file
@@ -0,0 +1,807 @@
|
||||
<?php
|
||||
|
||||
require("../../inc/header.inc");
|
||||
require("../sub_inc/operWebFunc.inc");
|
||||
require("param_comm.inc");
|
||||
?>
|
||||
|
||||
<script language="Javascript">
|
||||
|
||||
document.write("<div id='EMS_TIP_WINDOW' style=\"z-index:1000;display:none;position:absolute;border-color:#000000;border-style:solid;border-width:1px;\" ></div>");
|
||||
|
||||
function getEvent()
|
||||
{
|
||||
if(document.all)
|
||||
return window.event;
|
||||
func=getEvent.caller;
|
||||
|
||||
while(func!=null){
|
||||
var arg0=func.arguments[0];
|
||||
if(arg0)
|
||||
{
|
||||
if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation))
|
||||
return arg0;
|
||||
|
||||
}
|
||||
func=func.caller;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function showTipWindow(tip)
|
||||
{
|
||||
if(tip.length == 0)
|
||||
return;
|
||||
var pos_x;
|
||||
var pos_y;
|
||||
var event=getEvent();
|
||||
if (navigator.appName=='Microsoft Internet Explorer')
|
||||
{
|
||||
pos_x=event.x;
|
||||
pos_y=event.y+document.body.scrollTop;
|
||||
}
|
||||
else if (navigator.appName=='Netscape')
|
||||
{
|
||||
pos_x=event.pageX;
|
||||
pos_y=event.pageY;
|
||||
}
|
||||
|
||||
document.getElementById("EMS_TIP_WINDOW").style.top=pos_y;
|
||||
document.getElementById("EMS_TIP_WINDOW").style.left=pos_x+40;
|
||||
document.getElementById("EMS_TIP_WINDOW").style.backgroundColor='#eeeeee';
|
||||
document.getElementById("EMS_TIP_WINDOW").style.display='';
|
||||
document.getElementById("EMS_TIP_WINDOW").innerHTML=tip;
|
||||
}
|
||||
|
||||
function hideTipWindow()
|
||||
{
|
||||
document.getElementById("EMS_TIP_WINDOW").style.display='none';
|
||||
}
|
||||
|
||||
function addObject(createMethod,createInstanceNo,sysId,tableOid,table_type)
|
||||
{
|
||||
if(createMethod == 0)
|
||||
createIndex=document.myform.index_select.value;
|
||||
else
|
||||
createIndex=1;
|
||||
|
||||
window.location.href="param_edit.php?create=1&createMethod="+createMethod+"&createIndex="+createIndex+"&createInstanceNo="+createInstanceNo+"&sysId="+sysId+"&tableOid="+tableOid+"&table_type="+table_type;
|
||||
|
||||
}
|
||||
|
||||
function openNITZ(sysId,tableOid,table_type,instanceNo,param_oid)
|
||||
{
|
||||
URL="./mscNITZ.php?sysId="+sysId+"&tableOid="+tableOid+"&table_type="+table_type+"&instanceNo="+instanceNo+"¶m_oid="+param_oid;
|
||||
var setWindow = open(URL, 'newWin', 'toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=yes,width=400,height=350');
|
||||
//setWindow.focus();
|
||||
}
|
||||
|
||||
</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
|
||||
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>";
|
||||
|
||||
|
||||
//echo "tableOid=$tableOid,sysId=$sysId,table_type=$table_type,instanceNo=$instanceNo<br>";
|
||||
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
$pubDb='OMC_PUB';
|
||||
|
||||
$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$module_name=$row[sysTypeName];
|
||||
|
||||
if(checkIndependSystem($sysTypeNo))//Plat
|
||||
$paraTable=$objDb.".param_".$sysNo;
|
||||
else
|
||||
$paraTable=$objDb.".param_99";
|
||||
|
||||
|
||||
//Get all
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST")
|
||||
{
|
||||
|
||||
if($get)
|
||||
{
|
||||
//scalar table
|
||||
if($table_type == 0)
|
||||
{
|
||||
getParam($commInfoArr);
|
||||
}
|
||||
//column table
|
||||
else
|
||||
{
|
||||
//Get the timeslot parameter from the plat(trunk group id)
|
||||
$timeslot_table_oid=GetOIDByName(SYSTYPENO_MSC,"timeSlotEntry");
|
||||
if($sysTypeNo == SYSTYPENO_MSC && $tableOid == $timeslot_table_oid)
|
||||
{
|
||||
$tmps=explode(".",$instanceNo);
|
||||
$grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0);
|
||||
if($grounp_id == 1)
|
||||
$tmpSysId="320_1_0";
|
||||
else
|
||||
$tmpSysId="320_0_0";
|
||||
|
||||
if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id))
|
||||
$tmpSysId="320_99_99";
|
||||
|
||||
$commIdStr=oidSysCommSend($tmpSysId,0,$tableOid,$selectedSysId=-1,$instanceNo);
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
}
|
||||
else
|
||||
{
|
||||
$commIdStr=oidSysCommSend($sysId,0,$tableOid,$selectedSysId=-1,$instanceNo);
|
||||
echo "oidSysCommSend($sysId,0,$tableOid,$selectedSysId=-1,$instanceNo);<br>";
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if($set)
|
||||
{
|
||||
//scalar table
|
||||
if($table_type == 0)
|
||||
{
|
||||
$len=sizeof($setCommInfoArr);
|
||||
$commIdStr="";
|
||||
for($i=0;$i<$len;$i++)
|
||||
{
|
||||
$tmpCommIdStr = oidSysCommSend($setCommInfoArr[$i][sysId],3,$setCommInfoArr[$i][oid],-1);
|
||||
$commIdStr=$commIdStr.$tmpCommIdStr;
|
||||
}
|
||||
if($len>0)
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
}
|
||||
//column table
|
||||
else
|
||||
{
|
||||
$commIdStr=oidSysCommSend($sysId,3,$tableOid,$selectedSysId=-1,$instanceNo);
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
}
|
||||
|
||||
}
|
||||
else if($lock || $unlock)
|
||||
{
|
||||
$tmpWhere=getLevelWhere($adminStatOid);
|
||||
if($lock)
|
||||
$initValue=0;
|
||||
else
|
||||
$initValue=1;
|
||||
|
||||
$updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo=$instanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$updateSql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
mysqli_query($pubConn,$updateSql);
|
||||
$commIdStr=oidSysCommSend($sysId,3,$adminStatOid,$selectedSysId=-1,$instanceNo);
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
}
|
||||
else if($podUpdateToPod)
|
||||
{
|
||||
$tmpWhere=getLevelWhere($podUpdateToPodOid);
|
||||
//if($lock)
|
||||
$initValue=1;
|
||||
// else
|
||||
// $initValue=1;
|
||||
|
||||
$updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo=$instanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$updateSql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
mysqli_query($pubConn,$updateSql);
|
||||
$commIdStr=oidSysCommSend($sysId,3,$podUpdateToPodOid,$selectedSysId=-1,$instanceNo);
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
}
|
||||
}
|
||||
|
||||
//create
|
||||
if($create == 1)
|
||||
{
|
||||
//echo "createIndex=$createIndex,createInstanceNo=$createInstanceNo,createOid=$createOid,sysId=$sysId,tableOid=$tableOid,table_type=$table_type<br>";
|
||||
$level=getTableLevel($tableOid,$sysTypeNo);
|
||||
$tmpwhere=getLevelWhere($tableOid);
|
||||
$newInstanceNo=omc_keep_length($createIndex,'0',4);
|
||||
if($createMethod == AUTO_CREATE)
|
||||
$createIndex=1;
|
||||
|
||||
$sql="replace into $paraTable set initValue='$createIndex',instanceNo='$createInstanceNo'";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.=",subSysNo='$subSysNo' ";
|
||||
|
||||
//nest table
|
||||
if($level > 1)
|
||||
{
|
||||
$createTableName=getTableNameByOid($sysId,$tableOid);
|
||||
$createTableName=str_replace("Entry","",$createTableName);
|
||||
$createOid=findRelationOid($createTableName,TABLE_CREATE,$sysTypeNo);
|
||||
$entriesOid=findRelationOid($createTableName,TABLE_ENTRIES,$sysTypeNo);
|
||||
//PrintInfo("createOid=".$createOid);
|
||||
//PrintInfo("entriesOid=".$entriesOid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$orderBy="order by level_1 desc,level_2 desc,level_3 desc,level_4 desc,level_5 desc,level_6 desc,level_7 desc,level_8 desc,level_9 desc,level_10 desc";
|
||||
$sql1="select * from $paraConfTable where $tmpwhere and name_1 like '%Index' $orderBy";
|
||||
$res=@mysqli_query($pubConn,$sql1);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$createOid="";
|
||||
for($i=1;$i<=10;$i++)
|
||||
{
|
||||
if($row["level_".$i] == '0')
|
||||
break;
|
||||
$createOid.=$row["level_".$i].".";
|
||||
}
|
||||
$createOid=substr($createOid,0,strlen($createOid)-1);
|
||||
//echo "createOid=$createOid<br>";
|
||||
}
|
||||
|
||||
$indexOidArr=explode(".",$createOid);
|
||||
for($i=0;$i<sizeof($indexOidArr);$i++)
|
||||
$sql=$sql.",level_".($i+1)."=".$indexOidArr[$i];
|
||||
//echo "$sql<br>";
|
||||
mysqli_query($pubConn,$sql);
|
||||
|
||||
//nest table
|
||||
if($level > 1)
|
||||
{
|
||||
$commIdStr=oidSysCommSend($sysId,9,$createOid,$selectedSysId=-1,$createInstanceNo);
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
|
||||
if($createMethod == AUTO_CREATE)
|
||||
{
|
||||
$indexLevelWhere=getLevelWhere($createOid);
|
||||
$indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$indexSql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
$indexres=@mysqli_query($pubConn,$indexSql);
|
||||
$indexrow=@mysqli_fetch_array($indexres);
|
||||
$newIndex=$indexrow[readValue]+0;
|
||||
}
|
||||
|
||||
|
||||
$tmpwhere=getLevelWhere($tableOid);
|
||||
$sql="delete from $paraTable WHERE $tmpwhere ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
if($DEBUG)echo "<br>clearSql=$clearSql";
|
||||
mysqli_query($pubConn,$sql);
|
||||
|
||||
$commIdStr=oidSysCommSend($sysId,5,$tableOid,$selectedSysId=-1,"");
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
|
||||
$commIdStr=oidSysCommSend($sysId,0,$entriesOid,$selectedSysId=-1,$createInstanceNo);
|
||||
//echo "oidSysCommSend($sysId,0,$entriesOid,$selectedSysId=-1,$createInstanceNo);<br>";
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo&createpage=$createpage");
|
||||
|
||||
if($createMethod == AUTO_CREATE)
|
||||
$newInstanceNo=omc_keep_length($newIndex,'0',4);
|
||||
|
||||
$instanceNo=$createInstanceNo.".".$newInstanceNo;
|
||||
}
|
||||
else
|
||||
{
|
||||
$commIdStr=oidSysCommSend($sysId,9,$createOid,$selectedSysId=-1,$createInstanceNo);
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
|
||||
//some table create instance auto
|
||||
if($createMethod == AUTO_CREATE)
|
||||
{
|
||||
$wheretest=getLevelWhere($createOid);
|
||||
$sqltest="select * from $paraTable where $wheretest and instanceNo='0000' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sqltest.="and subSysNo='$subSysNo' ";
|
||||
|
||||
$restest=@mysqli_query($pubConn,$sqltest);
|
||||
$numtest=mysqli_num_rows($restest);
|
||||
$rowtest=@mysqli_fetch_array($restest);
|
||||
$thisnew=$rowtest[readValue];
|
||||
$thisnew=omc_keep_length($thisnew,'0',4);
|
||||
}
|
||||
|
||||
$sql="delete from $paraTable WHERE $tmpwhere ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sqltest.="and subSysNo='$subSysNo' ";
|
||||
|
||||
if($DEBUG)echo "<br>clearSql=$clearSql";
|
||||
mysqli_query($pubConn,$sql);
|
||||
|
||||
|
||||
$commIdStr=oidSysCommSend($sysId,5,$tableOid,$selectedSysId=-1,"");
|
||||
checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
|
||||
$instanceNo=$newInstanceNo;
|
||||
if($createMethod == AUTO_CREATE)
|
||||
$instanceNo=$thisnew;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
echo "<form name=\"myform\" method=\"POST\" action=\"$PHP_SELF\">";
|
||||
|
||||
if($table_type == 1)
|
||||
{
|
||||
if($createpage == 1)
|
||||
{
|
||||
showTitle("show",$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
showTitle("edit",$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<p><a href=\"param_show_down.php?tableOid=2&sysId=$sysId&instanceNo=0000&table_type=0\">";
|
||||
echo "<b>$module_name</b></a> > ";
|
||||
}
|
||||
|
||||
//create page
|
||||
if($createpage == 1)
|
||||
{
|
||||
//echo "sysId=$sysId,tableOid=$tableOid,instanceNo=$instanceNo<br>";
|
||||
//get the kind of creation, auto or manual
|
||||
//get the table level
|
||||
$level=getTableLevel($tableOid,$sysTypeNo);
|
||||
|
||||
//nest table
|
||||
if($level > 1)
|
||||
{
|
||||
$createTableName=getTableNameByOid($sysId,$tableOid);
|
||||
$createTableName=str_replace("Entry","",$createTableName);
|
||||
$createEntryOid=findRelationOid($createTableName,TABLE_CREATE,$sysTypeNo);
|
||||
$checkWhere=getLevelWhere($createEntryOid);
|
||||
$checksql="select * from $paraConfTable where $checkWhere ";
|
||||
$checkres=@mysqli_query($pubConn,$checksql);
|
||||
$num=mysqli_num_rows($checkres);
|
||||
if($num != 1)
|
||||
echo "The table not include create entry column<br>";
|
||||
else
|
||||
{
|
||||
$checkrow=@mysqli_fetch_array($checkres);
|
||||
if($checkrow[setTemplate_2] == "create=1")
|
||||
$create_method=AUTO_CREATE;
|
||||
else
|
||||
$create_method=MANUAL_CREATE;
|
||||
}
|
||||
//PrintInfo("createTableName=".$createTableName.",createEntryOid=".$createEntryOid.",createMethod=".$create_method);
|
||||
}
|
||||
else
|
||||
{
|
||||
$checkWhere=getLevelWhere($tableOid);
|
||||
$checksql="select * from $paraConfTable where $checkWhere and name_1 like '%Index' ";
|
||||
//echo "$checksql<br>";
|
||||
$checkres=@mysqli_query($pubConn,$checksql);
|
||||
$num=mysqli_num_rows($checkres);
|
||||
if($num != 1)
|
||||
echo "The table not include Index column<br>";
|
||||
else
|
||||
{
|
||||
$checkrow=@mysqli_fetch_array($checkres);
|
||||
if($checkrow[setTemplate_2] == "create=1")
|
||||
$create_method=AUTO_CREATE;
|
||||
else
|
||||
$create_method=MANUAL_CREATE;
|
||||
$createEntryOid="";
|
||||
for($i=1;$i<=10;$i++)
|
||||
{
|
||||
if($checkrow["level_".$i] == '0')
|
||||
break;
|
||||
$createEntryOid.=$checkrow["level_".$i].".";
|
||||
}
|
||||
$createEntryOid=substr($createEntryOid,0,strlen($createEntryOid)-1);
|
||||
}
|
||||
//PrintInfo("createEntryOid=".$createEntryOid.",createMethod=".$create_method);
|
||||
}
|
||||
|
||||
|
||||
if($create_method == AUTO_CREATE)
|
||||
{
|
||||
echo "<p><table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
echo "<tr><td>Index is assigned by $module_name</td>";
|
||||
echo "<td>";
|
||||
echo "<input DISABLED type=\"text\" class=\"text\" size=\"3\" maxLength=\"3\">";
|
||||
|
||||
echo "</td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
echo "<input id=\"add_id\" type=\"button\" onClick=\"javascript:addObject('$create_method','$instanceNo','$sysId','$tableOid','1');\" name=\"add\" value=\"$strAdd\" class=\"button\" style=\"$buttonStyle\">";
|
||||
}
|
||||
else if($create_method == MANUAL_CREATE)
|
||||
{
|
||||
|
||||
//first level
|
||||
//if($last_table_level == 0)
|
||||
$tmpwhere=getLevelWhere($tableOid);
|
||||
$orderBy="order by level_1 desc,level_2 desc,level_3 desc,level_4 desc,level_5 desc,level_6 desc,level_7 desc,level_8 desc,level_9 desc,level_10 desc";
|
||||
$sql="select * from $paraConfTable where $tmpwhere and name_1 like '%Index' $orderBy";
|
||||
//echo "$sql<br>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$minIndex=$row[minValue]+0;
|
||||
$maxIndex=$row[maxValue]+0;
|
||||
|
||||
$createIndexOid="";
|
||||
for($i=1;$i<=10;$i++)
|
||||
{
|
||||
if($row["level_".$i] == '0')
|
||||
break;
|
||||
$createIndexOid.=$row["level_".$i].".";
|
||||
}
|
||||
$createIndexOid=substr($createIndexOid,0,strlen($createIndexOid)-1);
|
||||
//echo "createIndexOid=$createIndexOid,minIndex=$minIndex,maxIndex=$maxIndex<br>";
|
||||
|
||||
$tmpwhere=getLevelWhere($createIndexOid);
|
||||
if($instanceNo != "0000")
|
||||
$sql="select initValue from $paraTable where $tmpwhere and instanceNo like '$instanceNo.%' ";
|
||||
else
|
||||
$sql="select initValue from $paraTable where $tmpwhere ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
//echo "$sql,instanceNo=$instanceNo<br>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
while($row=@mysqli_fetch_array($res))
|
||||
$index_use_flags[$row[initValue]+0]=1;
|
||||
|
||||
|
||||
echo "<p><table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
echo "<tr><td>Please input the index No.</td>";
|
||||
echo "<td>";
|
||||
$no_use_count=0;
|
||||
//auto
|
||||
//if($sysTypeNo == 260 && $tableOid == "2.2.1.1")
|
||||
// echo "<select name=\"index_select\" disabled>";
|
||||
//else
|
||||
echo "<select name=\"index_select\">";
|
||||
for($index=$minIndex;$index<=$maxIndex;$index++)
|
||||
{
|
||||
if($index_use_flags[$index] != 1)
|
||||
{
|
||||
echo "<option value=$index>$index</option>";
|
||||
$no_use_count++;
|
||||
}
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
//table is full
|
||||
if($no_use_count == 0)
|
||||
{
|
||||
echo "<input disabled id=\"add_id\" type=\"submit\" name=\"add\" value=\"$strAdd\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo "<p><table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#cecece\" bgcolor=\"#cecece\">";
|
||||
echo "<tr><td>";
|
||||
echo "Note: The table is full";
|
||||
echo "</td></tr></table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "instanceNo=$instanceNo,table_type=$table_type<br>";
|
||||
echo "<input id=\"add_id\" type=\"button\" onClick=\"javascript:addObject('$create_method','$instanceNo','$sysId','$tableOid','1');\" name=\"add\" value=\"$strAdd\" class=\"button\" style=\"$buttonStyle\">";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</form>";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$keyId=0;
|
||||
showTable($tableOid);
|
||||
|
||||
for($i=0;$i<$keyId;$i++)
|
||||
{
|
||||
if(!$objects[$i]['type'] == LEAF_TYPE && !strstr($objects[$i]['name_1'],"Entry") && !strstr($objects[$i]['name_1'],"Table"))
|
||||
{
|
||||
$objects[$i]['table_type']=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
if($objects[$i]['type'] == UNKNOWN_TYPE)
|
||||
{
|
||||
$objects[$i]['type']=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================
|
||||
//SCALAR_TABLE_TYPE
|
||||
if($table_type == 0)
|
||||
{
|
||||
$commInfoArrNo=0;
|
||||
$setCommInfoArrNo=0;
|
||||
$table_level=0;
|
||||
for($index=0;$index<$keyId;$index++)
|
||||
{
|
||||
if($objects[$index]['type'] == COLUMN_TABLE_TYPE)
|
||||
{
|
||||
echo "</table>";
|
||||
break;
|
||||
}
|
||||
else if($objects[$index]['type'] == SCALAR_TABLE_TYPE)
|
||||
{
|
||||
$table_name=getShowNameOfTable($objects[$index]['name_1'],$index);
|
||||
echo "<b>{$table_name}</b><p>";
|
||||
echo "<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
}
|
||||
else if($objects[$index]['type'] == LEAF_TYPE)
|
||||
{
|
||||
//not accessable
|
||||
if($objects[$index]['maxAccess'] == ACCESS_ENTRY)
|
||||
continue;
|
||||
if(strstr($objects[$index]['desc_1'],"Hidden Parameter"))
|
||||
continue;
|
||||
if(stristr($objects[$index]['name_1'],"Command"))
|
||||
continue;
|
||||
$showName=getShowNameOfTable($objects[$index]['name_1'],$index);
|
||||
echo "<tr>";
|
||||
//title=\"{$objects[$index]['note_1']}\"
|
||||
echo "<td onMouseOver=\"javascript:showTipWindow('{$objects[$index]['note_1']}');\" onMouseOut=\"javascript:hideTipWindow();\">{$showName}</td>";
|
||||
echo "<td>";
|
||||
if($objects[$index]['valueType'] == VALUE_OPAQUE)
|
||||
showParameter($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
else
|
||||
showParameterAdv($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][sysId]\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][oid]\" value=\"{$objects[$index]['oid']}\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][instanceNo]\" value=\"\">";
|
||||
$commInfoArrNo++;
|
||||
|
||||
if($objects[$index]['maxAccess'] == ACCESS_READ_WRITE)
|
||||
{
|
||||
echo "<input type=\"hidden\" name=\"setCommInfoArr[$setCommInfoArrNo][sysId]\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"setCommInfoArr[$setCommInfoArrNo][oid]\" value=\"{$objects[$index]['oid']}\">";
|
||||
echo "<input type=\"hidden\" name=\"setCommInfoArr[$setCommInfoArrNo][instanceNo]\" value=\"\">";
|
||||
$setCommInfoArrNo++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($index == $keyId)
|
||||
echo "</table>";
|
||||
|
||||
}
|
||||
//COLUMN_TABLE_TYPE
|
||||
else if($table_type == 1)
|
||||
{
|
||||
$table_level=0;
|
||||
$this_page_title_object="";
|
||||
for($index=0;$index<$keyId;$index++)
|
||||
{
|
||||
if($objects[$index]['type'] == ENTRY_TYPE)
|
||||
{
|
||||
$this_page_title_object=$objects[$index]['name_1'];
|
||||
|
||||
echo "<br><table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
}
|
||||
else if($objects[$index]['type'] == LEAF_TYPE)
|
||||
{
|
||||
//not accessable
|
||||
if($objects[$index]['maxAccess'] == ACCESS_ENTRY)
|
||||
continue;
|
||||
//row status
|
||||
if(strstr($objects[$index]['name_1'],"RowStatus"))
|
||||
continue;
|
||||
echo "<tr>";
|
||||
|
||||
//whether have lock and unlock button
|
||||
if(strstr($objects[$index]['name_1'],"AdminState"))
|
||||
{
|
||||
$lock_unlock_flag=1;
|
||||
$lock_unlock_oid=$objects[$index]['oid'];
|
||||
}
|
||||
// echo "name_1:$objects[$index]['name_1']<br>";
|
||||
if(strstr($objects[$index]['name_1'],"podUpdateToPod"))
|
||||
{
|
||||
$podUpdateToPod_flag=1;
|
||||
$podUpdateToPod_oid=$objects[$index]['oid'];
|
||||
}
|
||||
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"CreateEntry"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(strstr($objects[$index]['name_1'],"Entries"))
|
||||
{
|
||||
$showName=getShowNameOfField($objects[$index]['name_1'],$index);
|
||||
echo "<td>{$showName}</td>";
|
||||
|
||||
//get the entry value
|
||||
//get the table name
|
||||
$tb=$objects[$index][name_1];
|
||||
$tlen=strlen($tb);
|
||||
$fg=0;
|
||||
$tb1="";
|
||||
for($ti=0;$ti<$tlen;$ti++)
|
||||
{
|
||||
if($tb[$ti] >= 'A' && $tb[$ti] <= 'Z')
|
||||
$fg=1;
|
||||
if($fg==1)
|
||||
$tb1.=$tb[$ti];
|
||||
}
|
||||
$tb2=explode("Entries",$tb1);
|
||||
$tb3=$tb2[0];
|
||||
$entriesOid=findRelationOid($tb3,TABLE_ENTRY,$sysTypeNo);
|
||||
//PrintInfo($entriesOid);
|
||||
|
||||
echo "<td>";
|
||||
$value=getParamValue($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
|
||||
echo "<a href=\"param_show_table.php?tableOid=$entriesOid&instanceNo=$instanceNo&sysId=$sysId\">$value</a>";
|
||||
echo "</td>";
|
||||
//$nextTableOid=
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$showName=getShowNameOfField($objects[$index]['name_1'],$index);
|
||||
//title=\"{$objects[$index]['note_1']}\"
|
||||
echo "<td onMouseOver=\"javascript:showTipWindow('{$objects[$index]['note_1']}');\" onMouseOut=\"javascript:hideTipWindow();\">{$showName}</td>";
|
||||
echo "<td>";
|
||||
if($objects[$index]['valueType'] == VALUE_OPAQUE)
|
||||
{
|
||||
if(stristr($objects[$index]['name_1'],"NITZ"))
|
||||
{
|
||||
$mscTable="OBJ_320.param_99";
|
||||
$levels=getLevelWhere($objects[$index]['oid']);
|
||||
$sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo";
|
||||
$res=mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($res);
|
||||
$initValue=$rows[initValue];
|
||||
$readValue=$rows[readValue];
|
||||
if($initValue == '')
|
||||
$initValue="--";
|
||||
echo "<a href=# onClick=\"javascript:openNITZ('$sysId','$tableOid','$table_type','$instanceNo','{$objects[$index][oid]}');\" >";
|
||||
if(strlen($initValue)>8)
|
||||
$showValue=substr($initValue,0,8);
|
||||
if($initValue == $readValue)
|
||||
echo "<font class=text color=#0000ff>$showValue</font>";
|
||||
else
|
||||
echo "<font class=text color=#008000>$showValue</font>";
|
||||
echo "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
showParameter($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
}
|
||||
}
|
||||
else if(strstr($objects[$index]['name_1'],"Index"))
|
||||
{
|
||||
$value=getParamValue($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
echo "$value";
|
||||
}
|
||||
else if(strstr($objects[$index]['desc_1'],"RelationPoint"))
|
||||
{
|
||||
$tmp1=strstr($objects[$index]['desc_1'],"RelationPoint:");
|
||||
$tmp2=explode(";",$tmp1);
|
||||
$tmp3=explode("RelationPoint:",$tmp2[0]);
|
||||
$rTableOid=$tmp3[1];
|
||||
|
||||
$showvalue=getParamValue($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
|
||||
if(trim($showvalue) == "--" || trim($showvalue)=="")
|
||||
{
|
||||
echo "--";
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp1=explode(" ",$showvalue);
|
||||
$tmp2=$tmp1[1];
|
||||
$tmp3=explode("-",$tmp2);
|
||||
$tmp4=omc_keep_length($tmp3[0],'0',4);
|
||||
$tmp5=omc_keep_length($tmp3[1],'0',4);
|
||||
$rInstanceNo=$tmp4.".".$tmp5;
|
||||
$rWhere=getLevelWhere($rTableOid);
|
||||
$rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere ";
|
||||
$rres=mysqli_query($pubConn,$rsql);
|
||||
$num=mysqli_num_rows($rres);
|
||||
//echo "$rsql";
|
||||
if($num == 0)
|
||||
echo "--";
|
||||
else
|
||||
echo "<a href=\"./param_edit.php?tableOid=$rTableOid&instanceNo=$rInstanceNo&sysId=$sysId&table_type=$table_type\">$showvalue</a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
showParameterAdv($sysId,$objects[$index]['oid'],$instanceNo);
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][sysId]\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][oid]\" value=\"$tableOid\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][instanceNo]\" value=\"$instanceNo\">";
|
||||
|
||||
}
|
||||
|
||||
//=======================================
|
||||
$DEBUG=0;
|
||||
if($DEBUG)
|
||||
{
|
||||
echo "<p>============================test========================<br>";
|
||||
echo "keyId=$keyId<br>";
|
||||
$test_oid_flag=1;
|
||||
$test_name_flag=1;
|
||||
$test_nest_flag=1;
|
||||
$test_type_flag=1;
|
||||
|
||||
for($i=0;$i<$keyId;$i++)
|
||||
{
|
||||
//if($objects[$i]['type'] != LEAF_TYPE && $objects[$i]['type'] != ENTRY_TYPE)
|
||||
{
|
||||
echo "$i-";
|
||||
if($test_oid_flag)
|
||||
echo "oid-{$objects[$i]['oid']}, ";
|
||||
if($test_name_flag)
|
||||
echo "name-{$objects[$i]['name_1']}, ";
|
||||
if($test_nest_flag)
|
||||
echo "nestNum-{$objects[$i]['nest_num']}, ";
|
||||
if($test_type_flag)
|
||||
echo "type-{$type_label[$objects[$i]['type']]}, ";
|
||||
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//lock and unlock
|
||||
if($lock_unlock_flag == 1)
|
||||
{
|
||||
echo "<input type=\"submit\" name=\"lock\" value=\"$strLock\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo " ";
|
||||
echo "<input type=\"submit\" name=\"unlock\" value=\"$strUnlock\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo " ";
|
||||
echo "<input type=\"hidden\" name=\"adminStatOid\" value=\"$lock_unlock_oid\">";
|
||||
}
|
||||
if($podUpdateToPod_flag == 1)
|
||||
{
|
||||
echo "<input type=\"submit\" name=\"podUpdateToPod\" value=\"podUpdateToPod\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo " ";
|
||||
echo "<input type=\"hidden\" name=\"podUpdateToPodOid\" value=\"$podUpdateToPod_oid\">";
|
||||
}
|
||||
|
||||
|
||||
//get all
|
||||
echo "<input type=\"submit\" name=\"get\" value=\"$strGet\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo " ";
|
||||
echo "<input type=\"submit\" name=\"set\" value=\"$strSet\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo " ";
|
||||
|
||||
echo "<input type=\"hidden\" name=\"tableOid\" value=\"$tableOid\">";
|
||||
echo "<input type=\"hidden\" name=\"sysId\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"table_type\" value=\"$table_type\">";
|
||||
echo "<input type=\"hidden\" name=\"instanceNo\" value=\"$instanceNo\">";
|
||||
echo "</form>";
|
||||
adjust_content_tail("down");
|
||||
?>
|
||||
18
wxc2_omc/configuration/paramConfiguration/param_index.php
Executable file
18
wxc2_omc/configuration/paramConfiguration/param_index.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
|
||||
<frameset framespacing="0" border="0" rows="75,*" frameborder="0">
|
||||
<frame name="param_show_up" src="param_show_up.php" scrolling="no" noresize target="param_show_down">
|
||||
<frame name="param_show_down" src="param_show_down.php" scrolling="auto" target="_self">
|
||||
<noframes>
|
||||
<body>
|
||||
|
||||
<p>Your browser can not support frame</p>
|
||||
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
|
||||
</html>
|
||||
764
wxc2_omc/configuration/paramConfiguration/param_show_down.php
Executable file
764
wxc2_omc/configuration/paramConfiguration/param_show_down.php
Executable file
@@ -0,0 +1,764 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("../sub_inc/operWebFunc.inc");
|
||||
require("param_comm.inc");
|
||||
|
||||
//$url_temp=$_SERVER["REQUEST_URI"];
|
||||
//echo "This page URL:$url_temp<br>";
|
||||
//echo "instanceNo=$instanceNo,tableOid=$tableOid<br>";
|
||||
|
||||
?>
|
||||
|
||||
<script language="Javascript">
|
||||
function deleteObject(sysId,oid,instanceNo,tableOid,control)
|
||||
{
|
||||
var reply=confirm("Do you want to delete the selected?");
|
||||
if(reply == true)
|
||||
{
|
||||
window.location.href="param_show_down.php?delete=1&sysId="+sysId+"&deleteOid="+oid+"&deleteInstanceNo="+instanceNo+"&tableOid="+tableOid+"&table_type=0";
|
||||
}
|
||||
else
|
||||
{
|
||||
control.checked=false;
|
||||
}
|
||||
}
|
||||
|
||||
function clickOnMoreHide(where,num,oper)
|
||||
{
|
||||
var cmd;
|
||||
//to change the more button to hide button or reverse
|
||||
if(oper=='show')
|
||||
{
|
||||
cmd="document.all.show"+where+".style.display='none'";
|
||||
eval(cmd);
|
||||
cmd="document.all.hide"+where+".style.display=''";
|
||||
eval(cmd);
|
||||
|
||||
for(var i=4;i<num;i++)
|
||||
{
|
||||
cmd="document.all."+where+i+".style.display=''";
|
||||
eval(cmd);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd="document.all.show"+where+".style.display=''";
|
||||
eval(cmd);
|
||||
cmd="document.all.hide"+where+".style.display='none'";
|
||||
eval(cmd);
|
||||
|
||||
for(var i=4;i<num;i++)
|
||||
{
|
||||
cmd="document.all."+where+i+".style.display='none'";
|
||||
eval(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
var isConfirm=0;
|
||||
function buttonOpt()
|
||||
{
|
||||
if(isConfirm)
|
||||
{
|
||||
isConfirm=0;
|
||||
var res=confirm('Are you sure to do this operation?');
|
||||
if(res == true)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</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
|
||||
adjust_head_frame("down");
|
||||
adjust_title_head_frame("down");
|
||||
adjust_title_tail_frame("down");
|
||||
|
||||
adjust_content_head_frame("down");
|
||||
echo "<br>";
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
$pubDb='OMC_PUB';
|
||||
$sysConfTable = 'sysConf';
|
||||
$sysInfoTable = 'sysInfo';
|
||||
|
||||
$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$module_name=$row[sysTypeName];
|
||||
|
||||
if(checkIndependSystem($sysTypeNo))//Plat
|
||||
$paraTable=$objDb.".param_".$sysNo;
|
||||
else
|
||||
$paraTable=$objDb.".param_99";
|
||||
|
||||
//check the system whether exist
|
||||
if(($sysNo == '99') || ($subSysNo == '99')){
|
||||
if($sysNo == '99'){
|
||||
$sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias
|
||||
FROM $sysInfoTable,$sysConfTable
|
||||
WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo
|
||||
AND $sysInfoTable.sysTypeNo = '$sysTypeNo'
|
||||
";
|
||||
}else{
|
||||
$sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias
|
||||
FROM $sysInfoTable,$sysConfTable
|
||||
WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo
|
||||
AND $sysInfoTable.sysTypeNo = '$sysTypeNo'
|
||||
AND sysNo = '$sysNo'
|
||||
";
|
||||
}
|
||||
if($DEBUG)echo "sysIdSql(1) = $sysIdSql<br>";
|
||||
$result = mysqli_query($pubConn,$sysIdSql);
|
||||
echo mysqli_error($pubConn);
|
||||
$rowsNum=mysqli_num_rows($result);
|
||||
$rows=mysqli_fetch_array($result);
|
||||
$sysTypeName=$rows[sysTypeName];
|
||||
if($rowsNum < 1){
|
||||
echo " </td></tr></table>$strUninstalled<br>";
|
||||
exit();
|
||||
}
|
||||
}else{
|
||||
$sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias
|
||||
FROM $sysInfoTable,$sysConfTable
|
||||
WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo
|
||||
AND $sysInfoTable.sysTypeNo = '$sysTypeNo'
|
||||
AND sysNo = '$sysNo'
|
||||
AND subSysNo = '$subSysNo'
|
||||
";
|
||||
if($DEBUG) echo "sysIdSql(2) = $sysIdSql<br>";
|
||||
$result = mysqli_query($pubConn,$sysIdSql);
|
||||
echo mysqli_error($pubConn);
|
||||
$rowsNum=mysqli_num_rows($result);
|
||||
$rows=mysqli_fetch_array($result);
|
||||
$sysTypeName=$rows[sysTypeName];
|
||||
if($rowsNum < 1){
|
||||
echo " </td></tr></table>$strUninstalled<br>";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
//echo "sysId=$sysId<br>";
|
||||
//echo "paraConfTable=$paraConfTable,paraTable=$paraTable<br>";
|
||||
|
||||
//delete
|
||||
if($delete == 1)
|
||||
{
|
||||
//echo "Now delete the object,deleteOid=$deleteOid,deleteInstanceNo=$deleteInstanceNo";
|
||||
$deleteOid=trim($deleteOid);
|
||||
$tmpwhere=getLevelWhere($deleteOid);
|
||||
$sql="update $paraTable set initValue= '6' where $tmpwhere and instanceNo='$deleteInstanceNo' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
mysqli_query($pubConn,$sql);
|
||||
$commIdStr=oidSysCommSend($sysId,3,$deleteOid,$selectedSysId=-1,$deleteInstanceNo);
|
||||
checkState($commIdStr,"./param_show_down.php?sysId=$sysId");
|
||||
|
||||
//command success,delete the record in the db
|
||||
$etmp=explode(".",$deleteOid);
|
||||
$elen=sizeof($etmp);
|
||||
$deleteTableOid="";
|
||||
for($ti=0;$ti<$elen-1;$ti++)
|
||||
$deleteTableOid.=$etmp[$ti].".";
|
||||
$deleteTableOid=substr($deleteTableOid,0,strlen($deleteTableOid)-1);
|
||||
//echo "deleteTableOid=$deleteTableOid<br>";
|
||||
$tmpwhere=getLevelWhere($deleteTableOid);
|
||||
$sql="delete from $paraTable where $tmpwhere and instanceNo=$deleteInstanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
//echo "$sql<br>";
|
||||
mysqli_query($pubConn,$sql);
|
||||
|
||||
//When delete an object, then get all the table
|
||||
$getArr[0][sysId]=$sysId;
|
||||
$getArr[0][oid]=$deleteTableOid;
|
||||
$getArr[0][instanceNo]="";
|
||||
getParam($getArr);
|
||||
}
|
||||
|
||||
//Get all
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST")
|
||||
{
|
||||
if($get)
|
||||
{
|
||||
getParam($commInfoArr);
|
||||
}
|
||||
|
||||
if($set)
|
||||
{
|
||||
//print_r($commInfoArr);
|
||||
$commIndex=0;
|
||||
for($i=0;$i<sizeof($commInfoArr);$i++)
|
||||
{
|
||||
$oidwhere=getLevelWhere($commInfoArr[$i][oid]);
|
||||
$sql="select name_1,desc_1,maxAccess from $paraConfTable where $oidwhere ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
if($row[maxAccess] == ACCESS_ENTRY && strstr($row[desc_1],"Table Parameter"))
|
||||
{
|
||||
$oidwhere=str_replace("level","T1.level",$oidwhere);
|
||||
$checksql="SELECT T1.level_1,T1.level_2,T1.level_3,T1.level_4,T1.level_5,T1.level_6,T1.level_7,T1.level_8,T1.level_9,T1.level_10,T1.instanceNo,T1.initValue,T1.readValue,T2.valueType FROM $paraTable AS T1,$paraConfTable AS T2 WHERE $oidwhere AND T1.level_1 = T2.level_1 AND T1.level_2 = T2.level_2 AND T1.level_3 = T2.level_3 AND T1.level_4 = T2.level_4 AND T1.level_5 = T2.level_5 AND T1.level_6 = T2.level_6 AND T1.level_7 = T2.level_7 AND T1.level_8 = T2.level_8 AND T1.level_9 = T2.level_9 AND T1.level_10 = T2.level_10 AND T2.maxAccess='19' ORDER BY T1.level_1,T1.level_2,T1.level_3,T1.level_4,T1.level_5,T1.level_6,T1.level_7,T1.level_8,T1.level_9,T1.level_10,instanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$checksql="SELECT T1.level_1,T1.level_2,T1.level_3,T1.level_4,T1.level_5,T1.level_6,T1.level_7,T1.level_8,T1.level_9,T1.level_10,T1.instanceNo,T1.initValue,T1.readValue,T2.valueType FROM $paraTable AS T1,$paraConfTable AS T2 WHERE $oidwhere AND T1.subSysNo='$subSysNo' AND T1.level_1 = T2.level_1 AND T1.level_2 = T2.level_2 AND T1.level_3 = T2.level_3 AND T1.level_4 = T2.level_4 AND T1.level_5 = T2.level_5 AND T1.level_6 = T2.level_6 AND T1.level_7 = T2.level_7 AND T1.level_8 = T2.level_8 AND T1.level_9 = T2.level_9 AND T1.level_10 = T2.level_10 AND T2.maxAccess='19' ORDER BY T1.level_1,T1.level_2,T1.level_3,T1.level_4,T1.level_5,T1.level_6,T1.level_7,T1.level_8,T1.level_9,T1.level_10,instanceNo ";
|
||||
|
||||
|
||||
$checkres=@mysqli_query($pubConn,$checksql);
|
||||
$num=@mysqli_num_rows($checkres);
|
||||
if($num==0)
|
||||
continue;
|
||||
|
||||
$setCommInfoArr[$commIndex][sysId]=$sysId;
|
||||
$setCommInfoArr[$commIndex][oid]=$commInfoArr[$i][oid];
|
||||
$setCommInfoArr[$commIndex][instanceNo]='';
|
||||
$commIndex++;
|
||||
//echo "{$commInfoArr[$i][sysId]} {$commInfoArr[$i][oid]} {$commInfoArr[$i][instanceNo]}<br>";
|
||||
}
|
||||
|
||||
if($row[maxAccess] == ACCESS_READ_WRITE && !strstr($row[name_1],"Command"))
|
||||
{
|
||||
$setCommInfoArr[$commIndex][sysId]=$sysId;
|
||||
$setCommInfoArr[$commIndex][oid]=$commInfoArr[$i][oid];
|
||||
$setCommInfoArr[$commIndex][instanceNo]='';
|
||||
$commIndex++;
|
||||
//echo "{$commInfoArr[$i][sysId]} {$commInfoArr[$i][oid]} {$commInfoArr[$i][instanceNo]}<br>";
|
||||
}
|
||||
}
|
||||
/*
|
||||
for($i=0;$i<sizeof($setCommInfoArr);$i++)
|
||||
{
|
||||
echo "{$setCommInfoArr[$i][sysId]} {$setCommInfoArr[$i][oid]} {$setCommInfoArr[$i][instanceNo]}<br>";
|
||||
}
|
||||
*/
|
||||
|
||||
setParam($setCommInfoArr);
|
||||
}
|
||||
|
||||
//command button
|
||||
$commlen=sizeof($commands);
|
||||
for($ci=0;$ci<$commlen;$ci++)
|
||||
{
|
||||
$paraName="command_id_".$ci;
|
||||
if($$paraName)
|
||||
{
|
||||
$tmpwhere=getLevelWhere($commands[$ci][oid]);
|
||||
$oidstr=str_replace(".",",",$commands[$ci][oid]);
|
||||
$oidsep=explode(".",$commands[$ci][oid]);
|
||||
$oidlen=sizeof($oidsep);
|
||||
$valuestr="";
|
||||
for($oi=0;$oi<$oidlen;$oi++)
|
||||
{
|
||||
$valuestr.="level_".($oi+1);
|
||||
if($oi != ($oidlen-1))
|
||||
$valuestr.=",";
|
||||
}
|
||||
$delSql="delete from $paraTable where $tmpwhere and instanceNo='0000' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$delSql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
mysqli_query($pubConn,$delSql);
|
||||
$insertSql="insert into $paraTable($valuestr,instanceNo,initValue,readValue) values($oidstr,'0000',{$commands[$ci][val]},{$commands[$ci][val]}) ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$insertSql="insert into $paraTable($valuestr,instanceNo,initValue,readValue,subSysNo) values($oidstr,'0000',{$commands[$ci][val]},{$commands[$ci][val]},{$subSysNo}) ";
|
||||
|
||||
mysqli_query($pubConn,$insertSql);
|
||||
echo mysqli_error($pubConn);
|
||||
|
||||
//echo "send command {$commands[$ci][oid]} {$commands[$ci][val]}<br>";
|
||||
$commIdStr=oidSysCommSend($sysId,3,$commands[$ci][oid],$selectedSysId=-1,"0000");
|
||||
checkState($commIdStr,"./param_show_down.php?sysId=$sysId");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$keyId=0;
|
||||
showTable($PARAM_OID_PREFIX);
|
||||
|
||||
|
||||
for($i=0;$i<$keyId;$i++)
|
||||
{
|
||||
if(!$objects[$i]['type'] == LEAF_TYPE && !strstr($objects[$i]['name_1'],"Entry") && !strstr($objects[$i]['name_1'],"Table"))
|
||||
{
|
||||
$objects[$i]['table_type']=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
if($objects[$i]['type'] == UNKNOWN_TYPE)
|
||||
{
|
||||
$objects[$i]['type']=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
}
|
||||
//*************************************************************************
|
||||
$table_level=0;
|
||||
$commInfoArrNo=0;
|
||||
//command button
|
||||
$commandCount=0;
|
||||
echo "<form name=\"myform\" method=\"POST\" action=\"$PHP_SELF\" onsubmit=\"return buttonOpt();\">";
|
||||
for($index=0;$index<$keyId;$index++)
|
||||
{
|
||||
$level_count[$table_level]--;
|
||||
$pre=strlen($objects[$index-1]['oid']);
|
||||
$now=strlen($objects[$index]['oid']);
|
||||
//echo "pre=$pre,now=$now<br>";
|
||||
|
||||
switch($objects[$index]["type"])
|
||||
{
|
||||
|
||||
case SCALAR_TABLE_TYPE:
|
||||
//echo "SCALAR_TABLE_TYPE {$objects[$index]['name_1']}<br>";
|
||||
$table_level++;
|
||||
$level_count[$table_level]=$objects[$index]['nest_num'];
|
||||
$table_type[$table_level]=SCALAR_TABLE_TYPE;
|
||||
$table_name[$table_level]=$objects[$index]['name_1'];
|
||||
$table_oid[$table_level]=$objects[$index]["oid"];
|
||||
|
||||
if($objects[$index]['name_1'] == "parameter")
|
||||
{
|
||||
//echo "<b>$module_name</b>";
|
||||
continue;
|
||||
}
|
||||
echo "<table border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\" >";
|
||||
$rownum=$level_count[$table_level]+1;
|
||||
$showName=getShowNameOfTable($table_name[$table_level],$index);
|
||||
if($objects[$index+1]["type"] != COLUMN_TABLE_TYPE)
|
||||
{
|
||||
$countWhere=getLevelWhere($objects[$index]['oid']);
|
||||
$countSql="select * from $paraConfTable where $countWhere and Not (desc_1 = 'Hidden Parameter' or name_1 like '%Command%') ";
|
||||
$countRes=mysqli_query($pubConn,$countSql);
|
||||
echo mysqli_error($pubConn);
|
||||
$countNum=mysqli_num_rows($countRes);
|
||||
if($countNum > 1)
|
||||
echo "<tr><td width=10% rowspan=1 bgcolor=#cecece><b>$showName</b></td>";
|
||||
}
|
||||
|
||||
$table_title_id[$table_level]="title_".$table_name[$table_level]."_id";
|
||||
|
||||
if($DEBUG)
|
||||
{
|
||||
for($s=0;$s<$table_level;$s++)
|
||||
echo "..";
|
||||
echo "start table({$objects[$index]['name_1']}) {$table_level}<br>";
|
||||
}
|
||||
break;
|
||||
case COLUMN_TABLE_TYPE:
|
||||
//echo "COLUMN_TABLE_TYPE {$objects[$index]['name_1']}<br>";
|
||||
$table_level++;
|
||||
$level_count[$table_level]=$objects[$index+1]['nest_num']+1;
|
||||
$table_type[$table_level]=COLUMN_TABLE_TYPE;
|
||||
$table_name[$table_level]=$objects[$index]['name_1'];
|
||||
|
||||
$nlevel=getTableLevel($objects[$index]['oid'].".1",$sysTypeNo);
|
||||
|
||||
if($nlevel > 1)
|
||||
{
|
||||
echo "<table style=\"display:none\" border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\" >";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<table border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\" >";
|
||||
}
|
||||
//echo "<caption>{$table_name[$table_level]}</caption>";
|
||||
|
||||
$rownum=$level_count[$table_level]+1;
|
||||
$showName=getShowNameOfTable($table_name[$table_level],$index);
|
||||
echo "<tr><td width=10%><b>$showName</b></td><td>";
|
||||
|
||||
if($DEBUG)
|
||||
{
|
||||
for($s=0;$s<$table_level;$s++)
|
||||
echo "..";
|
||||
echo "start table({$objects[$index]['name_1']}) {$table_level}<br>";
|
||||
}
|
||||
break;
|
||||
case ENTRY_TYPE:
|
||||
//echo "ENTRY_TYPE {$objects[$index]['name_1']}<br>";
|
||||
$table_oid[$table_level]=$objects[$index]["oid"];
|
||||
|
||||
//skip the timeslot
|
||||
if($sysTypeNo == SYSTYPENO_MSC && $objects[$index]["oid"] == "2.4.3.1")
|
||||
break;
|
||||
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][sysId]\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][oid]\" value=\"{$objects[$index]['oid']}\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][instanceNo]\" value=\"\">";
|
||||
$commInfoArrNo++;
|
||||
break;
|
||||
case LEAF_TYPE:
|
||||
//not accessable
|
||||
if($objects[$index]['maxAccess'] == ACCESS_ENTRY)
|
||||
break;
|
||||
if($table_type[$table_level] == SCALAR_TABLE_TYPE)
|
||||
{
|
||||
//$table_oid[$table_level]
|
||||
if(strstr($objects[$index]['desc_1'],"Hidden Parameter"))
|
||||
continue;
|
||||
//command button
|
||||
if(stristr($objects[$index]['name_1'],"Command"))
|
||||
{
|
||||
$commandKeyIdList[$commandCount]=$index;
|
||||
$commandCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$showValue=showParamInReadOnly($index,$sysId);
|
||||
echo "<tr><td>";
|
||||
echo "<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\" >";
|
||||
$showName=getShowNameOfTable($objects[$index]['name_1'],$index);
|
||||
echo "<tr><td width=30%>$showName</td>";
|
||||
echo "<td><a class=text href=\"param_edit.php?tableOid={$table_oid[$table_level]}&sysId=$sysId&instanceNo=0000&table_type=0\"><font color=blue>$showValue</font></td>";
|
||||
echo "</table>";
|
||||
echo "</td></tr>";
|
||||
|
||||
//if the scalar leaf not exist in the db, insert it first
|
||||
$checklevel=getLevelWhere($objects[$index]['oid']);
|
||||
$checksql="select * from $paraTable where $checklevel and instanceNo='0000' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$checksql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
$checkres=mysqli_query($pubConn,$checksql);
|
||||
echo mysqli_error($pubConn);
|
||||
$checknum=mysqli_num_rows($checkres);
|
||||
if($checknum == 0)
|
||||
{
|
||||
$insertlevel=str_replace("AND",",",$checklevel);
|
||||
$insertsql="replace into $paraTable set initValue='',instanceNo='0000',$insertlevel ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$insertsql="replace into $paraTable set subSysNo='$subSysNo',initValue='',instanceNo='0000',$insertlevel ";
|
||||
|
||||
mysqli_query($pubConn,$insertsql);
|
||||
echo mysqli_error($pubConn);
|
||||
}
|
||||
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][sysId]\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][oid]\" value=\"{$objects[$index]['oid']}\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[$commInfoArrNo][instanceNo]\" value=\"\">";
|
||||
$commInfoArrNo++;
|
||||
|
||||
}
|
||||
else if($table_type[$table_level] == COLUMN_TABLE_TYPE)
|
||||
{
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"Index"))
|
||||
{
|
||||
$showKeyIdListIndex=0;
|
||||
if($table_hide_flag[$table_level] == 1)
|
||||
echo "<table cellpadding=\"3\" cellspacing=\"0\" style=\"display:none\" border=0 width=100%>";
|
||||
else
|
||||
echo "<table cellpadding=\"3\" cellspacing=\"0\" border=0 width=100%>";
|
||||
echo "<tr bgcolor=\"#cecece\">";
|
||||
}
|
||||
|
||||
$showName=getShowNameOfField($objects[$index]['name_1'],$index);
|
||||
|
||||
if(strstr($objects[$index]['desc_1'],"Key Parameter"))
|
||||
{
|
||||
if(strstr($objects[$index]['name_1'],"RowStatus"))
|
||||
{
|
||||
$table_delete_flags[$table_level]=1;
|
||||
echo "<td align=right>Delete</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
echo "<a href=\"param_show_table.php?tableOid={$table_oid[$table_level]}&sysId=$sysId&table_type=1&sort=$showKeyIdListIndex&instanceNo=0000\">";
|
||||
echo "{$showName}</a></td>";
|
||||
}
|
||||
$showKeyIdList[$showKeyIdListIndex]=$index;
|
||||
$showKeyIdListIndex++;
|
||||
}
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"RowStatus"))
|
||||
{
|
||||
echo "</tr>";
|
||||
echo "<td>";
|
||||
if($table_hide_flag[$table_level] == 1)
|
||||
continue;
|
||||
$indexKeyId=-1;
|
||||
$entries_count=0;
|
||||
|
||||
for($tt=0;$tt<$showKeyIdListIndex;$tt++)
|
||||
{
|
||||
$id=$showKeyIdList[$tt];
|
||||
if(strstr($objects[$id]['name_1'],"Index"))
|
||||
$indexKeyId=$id;
|
||||
else if(strstr($objects[$id]['name_1'],"RowStatus"))
|
||||
$rowstatusKeyId=$id;
|
||||
else if(strstr($objects[$id]['name_1'],"Entries"))
|
||||
{
|
||||
$entriesKeyIds[$entries_count]=$id;
|
||||
|
||||
//get table name
|
||||
$tb=$objects[$id][name_1];
|
||||
$tlen=strlen($tb);
|
||||
$fg=0;
|
||||
$tb1="";
|
||||
for($ti=0;$ti<$tlen;$ti++)
|
||||
{
|
||||
if($tb[$ti] >= 'A' && $tb[$ti] <= 'Z')
|
||||
$fg=1;
|
||||
if($fg==1)
|
||||
$tb1.=$tb[$ti];
|
||||
}
|
||||
$tb2=explode("Entries",$tb1);
|
||||
$tb3=$tb2[0];
|
||||
//PrintInfo("table3=".$tb3);
|
||||
$entriesOid=findRelationOid($tb3,TABLE_ENTRY,$sysTypeNo);
|
||||
$entries_oids[$entries_count]=$entriesOid;
|
||||
$entries_count++;
|
||||
}
|
||||
else
|
||||
$select_list.=$objects[$id]['name_1'].",";
|
||||
}
|
||||
|
||||
$tmplevel=getLevelWhere($objects[$indexKeyId]['oid']);
|
||||
//and instanceNo <> '0000'
|
||||
$sql="select instanceNo from $paraTable where $tmplevel order by instanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$instanceCount=0;
|
||||
while($row=@mysqli_fetch_array($res))
|
||||
{
|
||||
$instanceList[$instanceCount]=$row[instanceNo];
|
||||
$instanceCount++;
|
||||
}
|
||||
$tableName=$table_name[$table_level];
|
||||
for($tt=0;$tt<$instanceCount;$tt++)
|
||||
{
|
||||
if($tt>MAX_SHOW_ROW_NUM-1)
|
||||
echo "\n<tr id=\"$tableName$tt\" style=\"display:none\" onMouseOver=\"javascript:MouseOverColor(this);\" onMouseOut=\"javascript:MouseOutColor(this);\">";
|
||||
else
|
||||
echo "\n<tr id=\"$tableName$tt\" onMouseOver=\"javascript:MouseOverColor(this);\" onMouseOut=\"javascript:MouseOutColor(this);\">";
|
||||
//echo "<tr>";
|
||||
for($jj=0;$jj<$showKeyIdListIndex;$jj++)
|
||||
{
|
||||
|
||||
$id=$showKeyIdList[$jj];
|
||||
$tmplevel=getLevelWhere($objects[$id]['oid']);
|
||||
$sql="select initValue from $paraTable where instanceNo='{$instanceList[$tt]}' and $tmplevel ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$rowObj[$tt][$jj]=$row[initValue];
|
||||
if($id == $indexKeyId)
|
||||
{
|
||||
echo "<td>";
|
||||
echo "<a href=\"param_edit.php?tableOid={$table_oid[$table_level]}&sysId=$sysId&table_type=1&instanceNo={$instanceList[$tt]}\">";
|
||||
echo "{$rowObj[$tt][$jj]}";
|
||||
echo "</a>";
|
||||
}
|
||||
//$table_delete_flags[$table_level]=1;
|
||||
else if($id == $rowstatusKeyId)
|
||||
{
|
||||
echo "<td align=right>";
|
||||
if($table_delete_flags[$table_level] == 1)
|
||||
{
|
||||
echo "<input type=\"checkbox\" onClick=\"javascript:deleteObject('$sysId','{$objects[$id]['oid']}','{$instanceList[$tt]}','2',this);\">";
|
||||
}
|
||||
}
|
||||
//feake
|
||||
else if($entries_count>0 && in_array($id,$entriesKeyIds))
|
||||
{
|
||||
$sizet=sizeof($entriesKeyIds);
|
||||
//PrintInfo("entries=".$entriesKeyIds[0]);
|
||||
for($si=0;$si<$sizet;$si++)
|
||||
{
|
||||
if($id == $entriesKeyIds[$si])
|
||||
{
|
||||
//printf("keyId=".$entriesKeyIds[$si]);
|
||||
$tmpOid=$entries_oids[$si];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo "<td>";
|
||||
echo "<a href=\"param_show_table.php?tableOid={$tmpOid}&sysId=$sysId&table_type=1&instanceNo={$instanceList[$tt]}\">";
|
||||
echo "{$rowObj[$tt][$jj]}";
|
||||
echo "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
if(trim($rowObj[$tt][$jj]) == "")
|
||||
echo "--";
|
||||
else
|
||||
{
|
||||
$showValue=translateValueToOpt($id,$rowObj[$tt][$jj]);
|
||||
echo "{$showValue}";
|
||||
}
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "</td></tr>";
|
||||
|
||||
if($objects[$indexKeyId]['maxAccess'] == ACCESS_INDEX_CREATE_SPE)
|
||||
{
|
||||
echo "<tr><td><a href=\"param_edit.php?createpage=1&sysId=$sysId&tableOid={$table_oid[$table_level]}&instanceNo=0000&table_type=1\">New</a></td>";
|
||||
for($si=0;$si<$showKeyIdListIndex-1;$si++)
|
||||
{
|
||||
echo "<td>--</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
if($instanceCount>MAX_SHOW_ROW_NUM)
|
||||
{
|
||||
echo "<tr id='show$tableName' style=\"display:block\"><td><a href=\"javascript:clickOnMoreHide('$tableName','$instanceCount','show')\"><nobr>More >></a></td></tr>";
|
||||
echo "<tr id='hide$tableName' style=\"display:none\"><td><a href=\"javascript:clickOnMoreHide('$tableName','$instanceCount','hide')\"><nobr><< Hide </a></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
}
|
||||
if($DEBUG)
|
||||
{
|
||||
for($s=0;$s<$table_level+1;$s++)
|
||||
echo "..";
|
||||
echo "LEAF_TYPE {$objects[$index]['name_1']}<br>";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "UNKNOWN_TYPE {$objects[$index]['name_1']}<br>";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if($table_level>1 &&($index)<$keyId && strlen($objects[$index+1]['oid']) < strlen($objects[$index]['oid']))
|
||||
{
|
||||
echo "</table><p>";
|
||||
if($DEBUG)
|
||||
{
|
||||
for($s=0;$s<$table_level;$s++)
|
||||
echo "..";
|
||||
echo "close table level=$table_level<br>";
|
||||
}
|
||||
$table_level--;
|
||||
}
|
||||
if($level_count[$table_level] <= 0)
|
||||
{
|
||||
echo "</table><p>";
|
||||
if($DEBUG)
|
||||
{
|
||||
for($s=0;$s<$table_level;$s++)
|
||||
echo "..";
|
||||
echo "close table level=$table_level<br>";
|
||||
}
|
||||
$table_level--;
|
||||
}
|
||||
}
|
||||
|
||||
if($table_level == 1)
|
||||
{
|
||||
echo "</table>";
|
||||
if($DEBUG)
|
||||
{
|
||||
echo "..";
|
||||
echo "close table level=$table_level<br>";
|
||||
}
|
||||
$table_level--;
|
||||
}
|
||||
|
||||
echo "<input id=\"get_id\" type=\"submit\" name=\"get\" value=\"$strGet\" class=\"button\">";
|
||||
|
||||
//whether have set all button
|
||||
$sql="select * from OMC_PUB.sysMibConf where sysTypeNo='$sysTypeNo' and setAllFlag='1' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
if($num > 0)
|
||||
echo "<input id=\"set_id\" type=\"submit\" name=\"set\" value=\"$strSet\" class=\"button\">";
|
||||
|
||||
|
||||
echo "<input type=\"hidden\" name=\"tableOid\" value=\"$tableOid\">";
|
||||
echo "<input type=\"hidden\" name=\"sysId\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"table_type\" value=\"$table_type\">";
|
||||
echo "<input type=\"hidden\" name=\"instanceNo\" value=\"$instanceNo\">";
|
||||
|
||||
//command button
|
||||
$command_index=0;
|
||||
for($i=0;$i<$commandCount;$i++)
|
||||
{
|
||||
$keyId=$commandKeyIdList[$i];
|
||||
//echo "command-$i {$objects[$keyId]['name_1']}<br>";
|
||||
|
||||
|
||||
$template=trim($objects[$keyId]["setTemplate_1"]);
|
||||
$options=explode(";",$template);
|
||||
for($ii=0;$ii<sizeof($options);$ii++)
|
||||
{
|
||||
$tmp=explode("=",$options[$ii]);
|
||||
$val=$tmp[0];
|
||||
$opt=$tmp[1];
|
||||
//echo "$val - $opt<br>";
|
||||
$showName=getShowNameOfTable($val,-1);
|
||||
echo " ";
|
||||
echo "<input id=\"command_id_{$command_index}\" type=\"submit\" onclick=\"isConfirm=1;\" name=\"command_id_{$command_index}\" value=\"$showName\" class=\"button\">";
|
||||
|
||||
echo "<input type=\"hidden\" name=\"commands[$command_index][oid]\" value=\"{$objects[$keyId][oid]}\">";
|
||||
echo "<input type=\"hidden\" name=\"commands[$command_index][val]\" value=\"$opt\">";
|
||||
//echo "<input type=\"hidden\" name=\"commInfoArr[0][instanceNo]\" value=\"\">";
|
||||
$command_index++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</form>";
|
||||
//=============test
|
||||
|
||||
$DEBUG=0;
|
||||
if($DEBUG)
|
||||
{
|
||||
echo "<p>============================test========================<br>";
|
||||
echo "keyId=$keyId<br>";
|
||||
$test_oid_flag=1;
|
||||
$test_name_flag=1;
|
||||
$test_nest_flag=1;
|
||||
$test_type_flag=1;
|
||||
|
||||
for($i=0;$i<$keyId;$i++)
|
||||
{
|
||||
//if($objects[$i]['type'] != LEAF_TYPE && $objects[$i]['type'] != ENTRY_TYPE)
|
||||
{
|
||||
echo "$i-";
|
||||
if($test_oid_flag)
|
||||
echo "oid-{$objects[$i]['oid']}, ";
|
||||
if($test_name_flag)
|
||||
echo "name-{$objects[$i]['name_1']}, ";
|
||||
if($test_nest_flag)
|
||||
echo "nestNum-{$objects[$i]['nest_num']}, ";
|
||||
if($test_type_flag)
|
||||
echo "type-{$type_label[$objects[$i]['type']]}, ";
|
||||
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
adjust_content_tail("down");
|
||||
?>
|
||||
534
wxc2_omc/configuration/paramConfiguration/param_show_table.php
Executable file
534
wxc2_omc/configuration/paramConfiguration/param_show_table.php
Executable file
@@ -0,0 +1,534 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("../sub_inc/operWebFunc.inc");
|
||||
require("param_comm.inc");
|
||||
?>
|
||||
|
||||
<script language="Javascript">
|
||||
function deleteObject(sysId,oid,instanceNo,tableOid,oldInstance,control)
|
||||
{
|
||||
var reply=confirm("Do you want to delete the selected?");
|
||||
if(reply == true)
|
||||
{
|
||||
window.location.href="param_show_table.php?delete=1&sysId="+sysId+"&deleteOid="+oid+"&deleteInstanceNo="+instanceNo+"&tableOid="+tableOid+"&table_type=0&instanceNo="+oldInstance;
|
||||
}
|
||||
else
|
||||
{
|
||||
control.checked=false;
|
||||
}
|
||||
}
|
||||
|
||||
function lockTimeSlot(sysId,instanceNo,oidStr,tableOid,opt)
|
||||
{
|
||||
URL="./lockTimeSlot.php?sysId="+sysId+"&oidStr="+oidStr+"&instanceNo="+instanceNo+"&tableOid="+tableOid+"&opt="+opt;
|
||||
//window.alert(URL);
|
||||
var msgWindow = open(URL, 'newWin', 'toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=yes,width=400,height=350');
|
||||
msgWindow.focus();
|
||||
}
|
||||
</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
|
||||
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>";
|
||||
|
||||
|
||||
$sysIdArr=explode('_',$sysId);
|
||||
$sysTypeNo=$sysIdArr[0];
|
||||
$sysNo=$sysIdArr[1];
|
||||
$subSysNo=$sysIdArr[2];
|
||||
$objDb='OBJ_'.$sysTypeNo;
|
||||
$paraConfTable=$objDb.'.paramConf';
|
||||
$pubDb='OMC_PUB';
|
||||
|
||||
$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$module_name=$row[sysTypeName];
|
||||
|
||||
if(checkIndependSystem($sysTypeNo))//Plat
|
||||
$paraTable=$objDb.".param_".$sysNo;
|
||||
else
|
||||
$paraTable=$objDb.".param_99";
|
||||
|
||||
|
||||
//feake
|
||||
showTitle("show",$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name);
|
||||
|
||||
|
||||
echo "<form name=\"myform\" method=\"POST\" action=\"$PHP_SELF\">";
|
||||
//delete
|
||||
if($delete == 1)
|
||||
{
|
||||
//echo "Now delete the object,sysId=$sysId,tableOid=$tableOid,deleteOid=$deleteOid,deleteInstanceNo=$deleteInstanceNo";
|
||||
$deleteOid=trim($deleteOid);
|
||||
$tmpwhere=getLevelWhere($deleteOid);
|
||||
$sql="update $paraTable set initValue='6' where $tmpwhere and instanceNo='$deleteInstanceNo' ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
//echo "$sql<br>";
|
||||
mysqli_query($pubConn,$sql);
|
||||
$commIdStr=oidSysCommSend($sysId,3,$deleteOid,$selectedSysId=-1,$deleteInstanceNo);
|
||||
//echo "oidSysCommSend($sysId,3,$deleteOid,$selectedSysId=-1,$deleteInstanceNo);<br>";
|
||||
checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
|
||||
//update the entries num
|
||||
$tlevel=getTableLevel($tableOid,$sysTypeNo);
|
||||
if($tlevel > 1)
|
||||
{
|
||||
$entriesTableName=getTableNameByOid($sysId,$tableOid);
|
||||
$entriesTableName=str_replace("Entry","",$entriesTableName);
|
||||
$entriesOid=findRelationOid($entriesTableName,TABLE_ENTRIES,$sysTypeNo);
|
||||
$entriesInstanceNo=substr($deleteInstanceNo,0,strlen($deleteInstanceNo)-5);
|
||||
$commIdStr=oidSysCommSend($sysId,0,$entriesOid,$selectedSysId=-1,$entriesInstanceNo);
|
||||
checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo");
|
||||
|
||||
//echo "entriesTableName=$entriesTableName,entriesOid=$entriesOid,entriesInstanceNo=$entriesInstanceNo<br>";
|
||||
//echo "deleteOid=$deleteOid,deleteInstanceNo=$deleteInstanceNo,tableOid=$tableOid,tlevel=$tlevel<br>";
|
||||
}
|
||||
|
||||
//command success,delete the record in the db
|
||||
//echo "deleteOid=$deleteOid<br>";
|
||||
$etmp=explode(".",$deleteOid);
|
||||
$elen=sizeof($etmp);
|
||||
$deleteTableOid="";
|
||||
for($ti=0;$ti<$elen-1;$ti++)
|
||||
$deleteTableOid.=$etmp[$ti].".";
|
||||
$deleteTableOid=substr($deleteTableOid,0,strlen($deleteTableOid)-1);
|
||||
//echo "deleteTableOid=$deleteTableOid<br>";
|
||||
$tmpwhere=getLevelWhere($deleteTableOid);
|
||||
$sql="delete from $paraTable where $tmpwhere and instanceNo=$deleteInstanceNo ";
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$sql.="and subSysNo='$subSysNo' ";
|
||||
|
||||
|
||||
//echo "$sql<br>";
|
||||
mysqli_query($pubConn,$sql);
|
||||
|
||||
//When delete an object, then get all the table
|
||||
$getArr[0][sysId]=$sysId;
|
||||
$getArr[0][oid]=$tableOid;
|
||||
//echo "table=$tableOid,instanceNo=$instanceNo<br>";
|
||||
$level=getTableLevel($tableOid,$sysTypeNo);
|
||||
if($level > 1 && $level < 4)
|
||||
$getArr[0][instanceNo]=$instanceNo;
|
||||
else
|
||||
$getArr[0][instanceNo]="";
|
||||
getParam($getArr);
|
||||
}
|
||||
|
||||
//Get all
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST")
|
||||
{
|
||||
if($get)
|
||||
{
|
||||
//Get the timeslot parameter from the plat(trunk group id)
|
||||
$trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"timeSlotEntry");
|
||||
if($sysTypeNo == SYSTYPENO_MSC && $tableOid == $trunk_table_oid)
|
||||
{
|
||||
$tmps=explode(".",$instanceNo);
|
||||
$grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0);
|
||||
if($grounp_id == 1)
|
||||
$commInfoArr[0][sysId]="320_1_0";
|
||||
else
|
||||
$commInfoArr[0][sysId]="320_0_0";
|
||||
if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id))
|
||||
$commInfoArr[0][sysId]="320_99_99";
|
||||
}
|
||||
|
||||
getParam($commInfoArr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$keyId=0;
|
||||
showTable($tableOid);
|
||||
|
||||
|
||||
for($i=0;$i<$keyId;$i++)
|
||||
{
|
||||
if(!$objects[$i]['type'] == LEAF_TYPE && !strstr($objects[$i]['name_1'],"Entry") && !strstr($objects[$i]['name_1'],"Table"))
|
||||
{
|
||||
$objects[$i]['table_type']=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
if($objects[$i]['type'] == UNKNOWN_TYPE)
|
||||
{
|
||||
$objects[$i]['type']=SCALAR_TABLE_TYPE;
|
||||
}
|
||||
}
|
||||
$indexObjectNum=0;
|
||||
$showObjectNum=0;
|
||||
$entries_count=0;
|
||||
for($index=0;$index<$keyId;$index++)
|
||||
{
|
||||
|
||||
if($objects[$index]['type'] == ENTRY_TYPE)
|
||||
{
|
||||
//echo "<b>{$objects[$index]['name_1']}</b><p>";
|
||||
echo "<table border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=#cecece>";
|
||||
}
|
||||
else if($objects[$index]['type'] == LEAF_TYPE)
|
||||
{
|
||||
|
||||
if(strstr($objects[$index]['desc_1'],"Key Parameter"))
|
||||
{
|
||||
$displayName=getShowNameOfField($objects[$index]['name_1'],$index);
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"RowStatus"))
|
||||
echo "<td align=right>Delete</td>";
|
||||
else
|
||||
{
|
||||
echo "<td><a href=\"param_show_table.php?tableOid=$tableOid&sysId=$sysId&instanceNo=$instanceNo&table_type=$table_type&sort=$showObjectNum\">";
|
||||
echo "{$displayName}</a></td>";
|
||||
}
|
||||
$showObjectList[$showObjectNum]=$index;
|
||||
$showObjectNum++;
|
||||
}
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"Index"))
|
||||
{
|
||||
$indexObjectList[$indexObjectNum]=$index;
|
||||
$indexObjectNum++;
|
||||
}
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"Entries"))
|
||||
{
|
||||
//$nextEntriesKeyId=$index;
|
||||
$entries_keyId[$entries_count]=$index;
|
||||
|
||||
$tb=$objects[$index]['name_1'];
|
||||
$tlen=strlen($tb);
|
||||
$fg=0;
|
||||
$tb1="";
|
||||
for($ti=0;$ti<$tlen;$ti++)
|
||||
{
|
||||
if($tb[$ti] >= 'A' && $tb[$ti] <= 'Z')
|
||||
$fg=1;
|
||||
if($fg==1)
|
||||
$tb1.=$tb[$ti];
|
||||
}
|
||||
$tb2=explode("Entries",$tb1);
|
||||
$tb3=$tb2[0];
|
||||
//PrintInfo("table3=".$tb3);
|
||||
$entriesOid=findRelationOid($tb3,TABLE_ENTRY,$sysTypeNo);
|
||||
$objects[$index]['nextEntryOid']=$entriesOid;
|
||||
|
||||
|
||||
$entries_count++;
|
||||
|
||||
}
|
||||
|
||||
if(strstr($objects[$index]['name_1'],"RowStatus"))
|
||||
{
|
||||
$rowstatusKeyId=$index;
|
||||
$deleteOid=$objects[$index]['oid'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
echo "</tr>";
|
||||
//show the object rows
|
||||
for($i=0;$i<$showObjectNum;$i++)
|
||||
{
|
||||
|
||||
$sKeyId=$showObjectList[$i];
|
||||
$valueTypes[$i]=$objects[$sKeyId]['valueType'];
|
||||
$objectStyles[$i]=$objects[$sKeyId]['style'];
|
||||
if($sKeyId == $indexObjectList[$indexObjectNum-1])
|
||||
$showIndexPos=$i;
|
||||
//if($sKeyId == $nextEntriesKeyId)
|
||||
if($entries_count>0 && in_array($sKeyId,$entries_keyId))
|
||||
{
|
||||
//$nextEntriesPos=$i;
|
||||
$entries_keyId_pos[$i]=$sKeyId;
|
||||
$entries_pos[$sKeyId]=$i;
|
||||
}
|
||||
if($sKeyId == $rowstatusKeyId)
|
||||
$rowstatusPos=$i;
|
||||
$selectLevel=getLevelWhere($objects[$sKeyId]['oid']);
|
||||
$orderBy="order by instanceNo ";
|
||||
$tablelevel=getTableLevel($tableOid,$sysTypeNo);
|
||||
|
||||
if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99)
|
||||
$selectLevel.=" and subSysNo='$subSysNo' ";
|
||||
|
||||
if($instanceNo == "0000")
|
||||
{
|
||||
if($tablelevel>1)
|
||||
{
|
||||
$likestr="";
|
||||
for($tl=0;$tl<$tablelevel-1;$tl++)
|
||||
$likestr.="0000.";
|
||||
$likestr.="%";
|
||||
$sql="select initValue,instanceNo from $paraTable where $selectLevel and instanceNo like '$likestr' $orderBy";
|
||||
}
|
||||
else
|
||||
$sql="select initValue,instanceNo from $paraTable where $selectLevel $orderBy";
|
||||
}
|
||||
else
|
||||
//and instanceNo<>'0000'
|
||||
$sql="select initValue,instanceNo from $paraTable where $selectLevel and instanceNo like '$instanceNo.%' $orderBy";
|
||||
//echo "$sql<br>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$objectIndex=0;
|
||||
while($row=@mysqli_fetch_array($res))
|
||||
{
|
||||
if(strstr($objects[$sKeyId]['name_1'],"Index"))
|
||||
$showValue=$row[initValue]+0;
|
||||
else
|
||||
$showValue=translateValueToOpt($sKeyId,$row[initValue]);
|
||||
$objectValues[$i][$objectIndex]=$showValue;
|
||||
$objectKeyId[$i][$objectIndex]=$sKeyId;
|
||||
$objectInstanceNo[$i][$objectIndex]=$row[instanceNo];
|
||||
$objectIndex++;
|
||||
}
|
||||
}
|
||||
if(!isset($sort))
|
||||
$sort=0;
|
||||
//echo "style=$objectStyles[$sort],valueType=$valueTypes[$sort]<br>";
|
||||
if($objectIndex > 0)
|
||||
{
|
||||
if(is_numeric($objectValues[$sort][0]))
|
||||
asort($objectValues[$sort],SORT_NUMERIC);
|
||||
else
|
||||
asort($objectValues[$sort],SORT_STRING);
|
||||
}
|
||||
if($objectIndex > 0)
|
||||
{
|
||||
$ki=0;
|
||||
foreach ($objectValues[$sort] as $key => $val)
|
||||
{
|
||||
$keys[$ki]=$key;
|
||||
$ki++;
|
||||
//echo "$key = $val<br>";
|
||||
}
|
||||
}
|
||||
|
||||
//for($i=0;$i<$objectIndex;$i++)
|
||||
if($objectIndex > 0)
|
||||
{
|
||||
foreach($keys as $skey => $i)
|
||||
{
|
||||
//if($i == $sort)
|
||||
// array_multisort($objectValues[$i], SORT_DESC);
|
||||
echo "<tr onMouseOver=\"javascript:MouseOverColor(this);\" onMouseOut=\"javascript:MouseOutColor(this);\">";
|
||||
for($j=0;$j<$showObjectNum;$j++)
|
||||
{
|
||||
//$nowpos=array_search($j,$entries_pos);
|
||||
if($showIndexPos == $j)
|
||||
{
|
||||
echo "<td>";
|
||||
|
||||
echo "<a href=\"param_edit.php?tableOid=$tableOid&sysId=$sysId&table_type=1&instanceNo={$objectInstanceNo[$j][$i]}\">";
|
||||
echo "{$objectValues[$j][$i]} ";
|
||||
echo "</a>";
|
||||
//echo "index $tableOid ";
|
||||
}
|
||||
//else if($nextEntriesPos == $j)
|
||||
else if($entries_count>0 && in_array($j,$entries_pos))
|
||||
{
|
||||
$entriesKeyId=$entries_keyId_pos[$j];
|
||||
//PrintInfo("nextEntriesOid=".$objects[$entriesKeyId]['nextEntryOid']);
|
||||
$nextEntryOid=$objects[$entriesKeyId]['nextEntryOid'];
|
||||
|
||||
echo "<td>";
|
||||
echo "<a href=\"param_show_table.php?tableOid=$nextEntryOid&sysId=$sysId&table_type=1&instanceNo={$objectInstanceNo[$j][$i]}\">";
|
||||
echo "{$objectValues[$j][$i]} </a>";
|
||||
}
|
||||
else if($rowstatusPos == $j)
|
||||
{
|
||||
echo "<td align=right>";
|
||||
//echo "{$objectInstanceNo[$j][$i]}";
|
||||
echo "<input type=\"checkbox\" onClick=\"javascript:deleteObject('$sysId','$deleteOid','{$objectInstanceNo[$j][$i]}','$tableOid','$instanceNo',this);\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
$rKeyId=$objectKeyId[$j][$i];
|
||||
if(strstr($objects[$rKeyId]['desc_1'],"RelationPoint"))
|
||||
{
|
||||
$tmp1=strstr($objects[$rKeyId]['desc_1'],"RelationPoint:");
|
||||
$tmp2=explode(";",$tmp1);
|
||||
$tmp3=explode("RelationPoint:",$tmp2[0]);
|
||||
$rTableOid=$tmp3[1];
|
||||
|
||||
$showvalue=$objectValues[$j][$i];
|
||||
|
||||
if(trim($showvalue) == "--" || trim($showvalue)=="")
|
||||
{
|
||||
echo "--";
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp1=explode(" ",$showvalue);
|
||||
$tmp2=$tmp1[1];
|
||||
$tmp3=explode("-",$tmp2);
|
||||
$tmp4=omc_keep_length($tmp3[0],'0',4);
|
||||
$tmp5=omc_keep_length($tmp3[1],'0',4);
|
||||
$rInstanceNo=$tmp4.".".$tmp5;
|
||||
$rWhere=getLevelWhere($rTableOid);
|
||||
$rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere ";
|
||||
$rres=mysqli_query($pubConn,$rsql);
|
||||
$num=mysqli_num_rows($rres);
|
||||
//echo "$rsql";
|
||||
if($num == 0)
|
||||
echo "--";
|
||||
else
|
||||
echo "<a href=\"./param_edit.php?tableOid=$rTableOid&instanceNo=$rInstanceNo&sysId=$sysId&table_type=1\">$showvalue</a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "{$objectValues[$j][$i]} ";
|
||||
}
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
//check whether this table can add instance
|
||||
$haveNewLink=0;
|
||||
$level=getTableLevel($tableOid,$sysTypeNo);
|
||||
//nest table
|
||||
if($level > 1)
|
||||
{
|
||||
$nowTableName=getTableNameByOid($sysId,$tableOid);
|
||||
$nowTableName=str_replace("Entry","",$nowTableName);
|
||||
$createEntryOid=findRelationOid($nowTableName,TABLE_CREATE,$sysTypeNo);
|
||||
//PrintInfo("nowTableName=".$nowTableName.",createEntryOid=".$createEntryOid);
|
||||
if($createEntryOid != "")
|
||||
$haveNewLink=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$checkWhere=getLevelWhere($tableOid);
|
||||
$sql="select * from $paraConfTable where $checkWhere and maxAccess='48' and name_1 like '%Index' ";
|
||||
//echo "$sql<br>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=mysqli_num_rows($res);
|
||||
if($num == 1)
|
||||
$haveNewLink=1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($haveNewLink == 1)
|
||||
{
|
||||
echo "<td><a href=\"param_edit.php?createpage=1&sysId=$sysId&tableOid=$tableOid&instanceNo=$instanceNo&table_type=1\">New</a></td>";
|
||||
|
||||
for($j=0;$j<$showObjectNum-1;$j++)
|
||||
echo "<td>--</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
|
||||
$DEBUG=0;
|
||||
if($DEBUG)
|
||||
{
|
||||
echo "<p>============================test========================<br>";
|
||||
echo "keyId=$keyId<br>";
|
||||
$test_oid_flag=1;
|
||||
$test_name_flag=1;
|
||||
$test_nest_flag=1;
|
||||
$test_type_flag=1;
|
||||
|
||||
for($i=0;$i<$keyId;$i++)
|
||||
{
|
||||
//if($objects[$i]['type'] != LEAF_TYPE && $objects[$i]['type'] != ENTRY_TYPE)
|
||||
{
|
||||
echo "$i-";
|
||||
if($test_oid_flag)
|
||||
echo "oid-{$objects[$i]['oid']}, ";
|
||||
if($test_name_flag)
|
||||
echo "name-{$objects[$i]['name_1']}, ";
|
||||
if($test_nest_flag)
|
||||
echo "nestNum-{$objects[$i]['nest_num']}, ";
|
||||
if($test_type_flag)
|
||||
echo "type-{$type_label[$objects[$i]['type']]}, ";
|
||||
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
//echo "<hr>sysId=$sysId,tableOid=$tableOid,instanceNo=$instanceNo<hr>";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][sysId]\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][oid]\" value=\"$tableOid\">";
|
||||
//for get the instance 0
|
||||
if($instanceNo=="0000")
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][instanceNo]\" value=\"\">";
|
||||
else
|
||||
echo "<input type=\"hidden\" name=\"commInfoArr[0][instanceNo]\" value=\"$instanceNo\">";
|
||||
|
||||
|
||||
//get all
|
||||
echo "<input id=\"get_id\" type=\"submit\" name=\"get\" value=\"$strGet\" class=\"button\" style=\"$buttonStyle\">";
|
||||
echo "<input type=\"hidden\" name=\"tableOid\" value=\"$tableOid\">";
|
||||
echo "<input type=\"hidden\" name=\"sysId\" value=\"$sysId\">";
|
||||
echo "<input type=\"hidden\" name=\"table_type\" value=\"$table_type\">";
|
||||
echo "<input type=\"hidden\" name=\"instanceNo\" value=\"$instanceNo\">";
|
||||
|
||||
|
||||
//lock the time slot
|
||||
if($sysTypeNo == SYSTYPENO_MSC && $tableOid == '2.4.3.1')
|
||||
{
|
||||
//{$sysTypeNo} {$tableOid} {$objects[$index][oid]}
|
||||
echo "<input id=\"Lock\" type=\"button\" name=\"locktimeslot\" value=\"Lock\" class=\"button\" style=\"$buttonStyle\" onClick=\"Javascript:lockTimeSlot('$sysId','$instanceNo','{$objects[$index][oid]}','$tableOid','lock');\">";
|
||||
echo "<input id=\"Unlock\" type=\"button\" name=\"unlocktimeslot\" value=\"Unlock\" class=\"button\" style=\"$buttonStyle\" onClick=\"Javascript:lockTimeSlot('$sysId','$instanceNo','{$objects[$index][oid]}','$tableOid','unlock');\">";
|
||||
//echo "<a href=\"Javascript:lockTimeSlot('$sysId','$instanceNo','{$objects[$index][oid]}','$tableOid')\" style=\"display:compact;float:right;border-color:black;border:none;\">";
|
||||
//echo "<img width=20 height=20 src=\"../../images/lock.png\"></a>";
|
||||
}
|
||||
|
||||
|
||||
//if not get timeslot, get the timeslot first
|
||||
if($sysTypeNo == SYSTYPENO_MSC && $tableOid == "2.4.3.1")
|
||||
{
|
||||
$dualTableLevelWhere="T1.level_1=T2.level_1 AND
|
||||
T1.level_2=T2.level_2 AND
|
||||
T1.level_3=T2.level_3 AND
|
||||
T1.level_4=T2.level_4 AND
|
||||
T1.level_5=T2.level_5 AND
|
||||
T1.level_6=T2.level_6 AND
|
||||
T1.level_7=T2.level_7 AND
|
||||
T1.level_8=T2.level_8 AND
|
||||
T1.level_9=T2.level_9 AND
|
||||
T1.level_10=T2.level_10";
|
||||
$count=0;
|
||||
$database=$objDb;
|
||||
$selSql = "SELECT T1.* FROM $paraTable AS T1,$paraConfTable AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tsIndex' and instanceNo like '$instanceNo.%' ";
|
||||
$selRes = @mysqli_query($pubConn,$selSql);
|
||||
$count=mysqli_num_rows($selRes);
|
||||
if($count==0)
|
||||
{
|
||||
if($hasEnter!=1)
|
||||
{
|
||||
$hasEnter=1;
|
||||
echo "<input type=\"hidden\" name=\"hasEnter\" value=\"1\">";
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "document.getElementById(\"get_id\").click();\n";
|
||||
echo "</script>\n";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "</form>";
|
||||
adjust_content_tail("down");
|
||||
?>
|
||||
274
wxc2_omc/configuration/paramConfiguration/param_show_up.php
Executable file
274
wxc2_omc/configuration/paramConfiguration/param_show_up.php
Executable file
@@ -0,0 +1,274 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("param_comm.inc");
|
||||
?>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
function selectSysType()
|
||||
{
|
||||
var baseURL,addURL,URL;
|
||||
baseURL='<?php echo"$PHP_SELF";?>?systype_no_select=';
|
||||
addURL=document.selectform.systype_no_select.value;
|
||||
URL=baseURL+addURL;
|
||||
window.location=URL;
|
||||
}
|
||||
|
||||
function selectSysID()
|
||||
{
|
||||
var baseURL,addURL,URL;
|
||||
baseURL='param_show_down.php?sysId=';
|
||||
addURL=document.selectform.system_id_select.value;
|
||||
URL=baseURL+addURL;
|
||||
window.parent.param_show_down.location=URL;
|
||||
}
|
||||
</script>
|
||||
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');javascript:selectSysID();" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<!--
|
||||
<body onload="javascript:selectSysID();">
|
||||
-->
|
||||
<?
|
||||
echo "<base target=\"param_show_down\">";
|
||||
//global variables
|
||||
define(EMS_APP_ID,0);
|
||||
define(MSS_APP_ID,9);
|
||||
define(VSS_APP_ID,8);
|
||||
define(AAS_APP_ID,11);
|
||||
|
||||
if(!isset($systype_no_select))
|
||||
$systype_no_select=320;
|
||||
if(!isset($system_id_select))
|
||||
$system_id_select="320_99_99";
|
||||
|
||||
|
||||
//help id
|
||||
if($systype_no_select == SYSTYPENO_MSC)
|
||||
$helpId="2.1.1.1";
|
||||
else if($systype_no_select == SYSTYPENO_AAS)
|
||||
$helpId="2.1.3.1";
|
||||
else if($systype_no_select == SYSTYPENO_VLR)
|
||||
$helpId="2.1.1.2";
|
||||
else if($systype_no_select == SYSTYPENO_VLR)
|
||||
$helpId="2.1.1.2";
|
||||
else if($systype_no_select == SYSTYPENO_HLR)
|
||||
$helpId="2.1.1.3";
|
||||
else if($systype_no_select == SYSTYPENO_AUC)
|
||||
$helpId="2.1.1.4";
|
||||
else if($systype_no_select == SYSTYPENO_SMSC)
|
||||
$helpId="2.1.1.5";
|
||||
else if($systype_no_select == SYSTYPENO_SMEG)
|
||||
$helpId="2.1.1.8";
|
||||
else if($systype_no_select == SYSTYPENO_OPPS)
|
||||
$helpId="2.1.1.9";
|
||||
else if($systype_no_select == SYSTYPENO_EIR)
|
||||
$helpId="2.1.1.7";
|
||||
else if($systype_no_select == SYSTYPENO_VSS)
|
||||
$helpId="2.1.3.2";
|
||||
else if($systype_no_select == SYSTYPENO_MRFC)
|
||||
$helpId="2.66";
|
||||
else if($systype_no_select == SYSTYPENO_PALIM)
|
||||
$helpId="2.1.1.12";
|
||||
else if($systype_no_select == SYSTYPENO_RLS)
|
||||
$helpId="2.1.1.13";
|
||||
else
|
||||
$helpId="2.1.1.1";
|
||||
adjust_head_frame("up");
|
||||
adjust_title_head_frame("up");
|
||||
|
||||
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\">";
|
||||
echo "Configuration > $strNetwork > Parameter";
|
||||
echo "</td>";
|
||||
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
|
||||
showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td align=\"left\">";
|
||||
|
||||
echo "<form method=\"post\" name=\"selectform\" action=\"$PHP_SELF\">";
|
||||
|
||||
echo "Module:";
|
||||
echo "<select name=\"systype_no_select\" onChange=\"javascript:selectSysType();\">";
|
||||
$sql="select sysTypeNo,sysTypeName,maxSysNum,maxSubSysNum from OMC_PUB.sysConf where needParamConf = '1' order by sysTypeNo ";
|
||||
//echo "sql=$sql<br>";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
do
|
||||
{
|
||||
$sysTypeNo=$row[sysTypeNo]+0;
|
||||
if($sysTypeNo == 311 ||
|
||||
$sysTypeNo == 320 ||
|
||||
$sysTypeNo == 340 ||
|
||||
$sysTypeNo == 380 ||
|
||||
$sysTypeNo == 330 ||
|
||||
$sysTypeNo == 375 ||
|
||||
$sysTypeNo == 355 ||
|
||||
$sysTypeNo == 260 ||
|
||||
$sysTypeNo == 350 ||
|
||||
$sysTypeNo == 325 ||
|
||||
$sysTypeNo == 225 ||
|
||||
$sysTypeNo == 385 ||
|
||||
// $sysTypeNo == 360 ||
|
||||
$sysTypeNo == 390 ||
|
||||
$sysTypeNo == 378 ||
|
||||
$sysTypeNo == 379 ||
|
||||
$sysTypeNo == 386 ||
|
||||
$sysTypeNo == 389
|
||||
)
|
||||
{
|
||||
echo "<option value=\"$row[sysTypeNo]\" ";
|
||||
if($row[sysTypeNo] == $systype_no_select && isset($row[sysTypeNo]))
|
||||
{
|
||||
echo "selected";
|
||||
$sysTypeName=$row[sysTypeName];
|
||||
$maxSysNum=$row[maxSysNum];
|
||||
$maxSubSysNum=$row[maxSubSysNum];
|
||||
}
|
||||
echo ">";
|
||||
echo "$row[sysTypeName]";
|
||||
echo "</option>";
|
||||
}
|
||||
}while($row=@mysqli_fetch_array($res));
|
||||
echo "</select>";
|
||||
echo " ";
|
||||
echo "System ID:";
|
||||
echo "<select name=\"system_id_select\" onChange=\"javascript:selectSysID()\">";
|
||||
//application
|
||||
if(floor($systype_no_select/100) == 3)
|
||||
{
|
||||
$sysid=$systype_no_select."_99_99";
|
||||
//The AAS do not need public parameter setting
|
||||
if($systype_no_select != SYSTYPENO_AAS && $systype_no_select != SYSTYPENO_TMG && $systype_no_select != SYSTYPENO_AMRMG && $systype_no_select != SYSTYPENO_GbC && $systype_no_select != SYSTYPENO_VSS)
|
||||
{
|
||||
if($system_id_select == $sysid)
|
||||
echo "<option value=\"$sysid\" selected>";
|
||||
else
|
||||
echo "<option value=\"$sysid\">";
|
||||
echo "{$sysTypeName}_pub</option>";
|
||||
}
|
||||
|
||||
for($i=0;$i<$maxSysNum;$i++)
|
||||
{
|
||||
$sysid=$systype_no_select."_".$i."_0";
|
||||
echo "<option value=\"$sysid\" ";
|
||||
if($sysid == $system_id_select)
|
||||
echo "selected";
|
||||
echo ">";
|
||||
echo "{$sysTypeName}_{$i}</option>";
|
||||
}
|
||||
}
|
||||
//platform
|
||||
else
|
||||
{
|
||||
//mtp3,sccp
|
||||
if($systype_no_select == SYSTYPENO_MTP3 || $systype_no_select == SYSTYPENO_SCCP)
|
||||
{
|
||||
for($i=0;$i<$maxSysNum;$i++)
|
||||
{
|
||||
//Now,only VSS MSS and AAS use MTP3 or SSCP Parameters
|
||||
if($i == MSS_APP_ID || $i == AAS_APP_ID || $i == VSS_APP_ID)
|
||||
{
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_Pub)';
|
||||
$sysId=$systype_no_select.'_'.$i.'_99';
|
||||
//default display MSS
|
||||
if(MSS_APP_ID == $i)
|
||||
{
|
||||
echo "<option value=\"$sysId\" selected>$sysName</option>";
|
||||
}else{
|
||||
echo "<option value=\"$sysId\">$sysName</option>";
|
||||
}
|
||||
/*
|
||||
for($j=0;$j<$PlatTypeDefArr[$i][maxSysNum];$j++)
|
||||
{
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_'.$j.')';
|
||||
$sysId =$systype_no_select.'_'.$i.'_'.$j;
|
||||
echo "<option value=\"$sysId\">$sysName</option>";
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
//other platform
|
||||
else
|
||||
{
|
||||
for($i=0;$i<$maxSysNum;$i++)
|
||||
{
|
||||
//Now,only MSS use other plat modules' Parameters
|
||||
if($systype_no_select == SYSTYPENO_SMPP)
|
||||
{
|
||||
if($i == MSS_APP_ID || $i == VSS_APP_ID || $i == EMS_APP_ID)
|
||||
{
|
||||
//ISSUE-3
|
||||
if($i == MSS_APP_ID)
|
||||
{
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_pub)';
|
||||
$sysId =$systype_no_select.'_'.$i.'_99';
|
||||
if(MSS_APP_ID == $i)
|
||||
echo "<option value=\"$sysId\" selected>$sysName</option>";
|
||||
else
|
||||
echo "<option value=\"$sysId\">$sysName</option>";
|
||||
}
|
||||
else if($i == EMS_APP_ID)
|
||||
{
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_0)';
|
||||
$sysId =$systype_no_select.'_'.$i.'_0';
|
||||
echo "<option value=\"$sysId\" selected>$sysName</option>";
|
||||
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_1)';
|
||||
$sysId =$systype_no_select.'_'.$i.'_1';
|
||||
echo "<option value=\"$sysId\" selected>$sysName</option>";
|
||||
}
|
||||
else if($i == VSS_APP_ID)
|
||||
{
|
||||
for($si=0;$si<10;$si++)
|
||||
{
|
||||
$sysName=$sysTypeName."(".$PlatTypeDefArr[$i][remark]."_$si)";
|
||||
$sysId =$systype_no_select."_".$i."_$si";
|
||||
echo "<option value=\"$sysId\" selected>$sysName</option>";
|
||||
}
|
||||
}
|
||||
|
||||
//now the system is all public
|
||||
/*
|
||||
for($j=0;$j<$PlatTypeDefArr[$i][maxSysNum];$j++)
|
||||
{
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_'.$j.')';
|
||||
$sysId=$systype_no_select.'_'.$i.'_'.$j;
|
||||
echo "<option value=\"$sysId\">$sysName</option>";
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($i == MSS_APP_ID)
|
||||
{
|
||||
$sysName=$sysTypeName.'('.$PlatTypeDefArr[$i][remark].'_pub)';
|
||||
$sysId =$systype_no_select.'_'.$i.'_99';
|
||||
if(MSS_APP_ID == $i)
|
||||
echo "<option value=\"$sysId\" selected>$sysName</option>";
|
||||
else
|
||||
echo "<option value=\"$sysId\">$sysName</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</select>";
|
||||
|
||||
|
||||
echo "</td>";
|
||||
echo "<td> </td>";
|
||||
echo "</table>";
|
||||
|
||||
|
||||
adjust_title_tail_frame("up");
|
||||
adjust_content_head_frame("up");
|
||||
adjust_content_tail_frame("up");
|
||||
//echo "sysTypeName=$sysTypeName,maxSysNum=$maxSysNum,maxSubSysNum=$maxSubSysNum,systype_no_select=$systype_no_select<br>";
|
||||
|
||||
?>
|
||||
</body>
|
||||
Reference in New Issue
Block a user