init web ems all
This commit is contained in:
928
wxc2_omc/account/sub_inc/getParameter.php
Executable file
928
wxc2_omc/account/sub_inc/getParameter.php
Executable file
@@ -0,0 +1,928 @@
|
||||
<?php
|
||||
require("../../inc/lib.inc");
|
||||
$Debug = 0;
|
||||
$language = $lan;
|
||||
$tmp1 = str_replace('.','_',$oidStr);
|
||||
$id = 'ID_' . $sysId . '_' . $tmp1 . '_' . $order . '_ist' . $instanceNo;
|
||||
$newId = "New".$id;
|
||||
$inputID = 'Input'.$id;
|
||||
$saveId = 'Save'.$id;
|
||||
|
||||
|
||||
function getLevelWhere($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"}'";
|
||||
}
|
||||
}
|
||||
return($levelWhere);
|
||||
}
|
||||
|
||||
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{
|
||||
$errorInfo = "Error in omcStrFill:the defLen < lengh of string!!\\ndefLen=$defLen and string=$string!!";
|
||||
echo "<script language='javascript'>";
|
||||
|
||||
echo "window.alert(\"$errorInfo\");";
|
||||
echo "history.go(-1)";
|
||||
echo "</script>";
|
||||
exit();
|
||||
|
||||
echo "<br>Error in omcStrFill : the defLen < lengh of string!!";
|
||||
echo "<br>defLen=$defLen and string=$string!!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
function getInnerValue($sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$showStr,$inputValueType)
|
||||
{
|
||||
global $language,$Debug,$inputID;
|
||||
$sysIdArr = explode('_',$sysId);
|
||||
$sysTypeNo = $sysIdArr[0];
|
||||
$sysNo = $sysIdArr[1];
|
||||
$subSysNo = $sysIdArr[2];
|
||||
$objDb = 'OBJ_'.$sysTypeNo;
|
||||
$paramTable = 'param_'.$sysNo;
|
||||
|
||||
$sysConfTable = 'OMC_PUB.sysConf';
|
||||
$pubDb ='OMC_PUB';
|
||||
$paramConfTable = $objDb.".paramConf";
|
||||
|
||||
$maxLevelNum = 10;
|
||||
$nInteger = 2;
|
||||
$nOctStr = 4;
|
||||
|
||||
|
||||
|
||||
|
||||
if(strlen($showStr)>0){
|
||||
echo "<input id=\"$inputID\" type=\"text\" class=\"text\" value=\"\" onchange=\"$chechFnc\">";
|
||||
return "";
|
||||
}
|
||||
|
||||
if($Debug) echo "<br>$paramConfTable<br>";
|
||||
//----------------------
|
||||
//ѡ<><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>)
|
||||
}
|
||||
|
||||
if($Debug) echo "<br>getValue = $getValue";
|
||||
|
||||
$objWhereStr = getLevelWhere($oidStr);
|
||||
|
||||
$objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr";
|
||||
$objResult = mysqli_query($pubConn ,$objSql);
|
||||
$objRows = @mysqli_fetch_array($objResult);
|
||||
$totalLen = $objRows[length]*2;
|
||||
$objName = $objRows[$objNameField];
|
||||
$setTemplate = $objRows[$objSetField];
|
||||
$valueType = $objRows[valueType];
|
||||
$minValue = $objRows[minValue];
|
||||
$maxValue = $objRows[maxValue];
|
||||
|
||||
|
||||
$paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' ";
|
||||
$v_Result = mysqli_query($pubConn,$paramSql);
|
||||
$v_Row = mysqli_fetch_array($v_Result);
|
||||
$getValue = $v_Row[0];
|
||||
|
||||
|
||||
//explode by '[remark]'
|
||||
$remarkArr = explode('[remark]',$setTemplate);
|
||||
$remark = $remarkArr[1];
|
||||
//explode by '[unit]'
|
||||
$unitArr = explode('[unit]',$remarkArr[0]);
|
||||
|
||||
//explode by '[u]'
|
||||
$tlvArr = explode('[u]',$unitArr[$order]);
|
||||
|
||||
//Unit Name
|
||||
if($Debug) echo "$tlvArr[0] : $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($getValue,$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')";
|
||||
|
||||
$newBitValue='';
|
||||
for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){
|
||||
$tmpBitValue=substr($bitValue,($byteNum-$bgnByte)*8,8);
|
||||
if($DEBUG) echo "<br>$tmpBitValue=substr($bitValue,($byteNum-$bgnByte)*8,8)";
|
||||
$tmpBitValue = strrev($tmpBitValue);
|
||||
if($DEBUG) echo "<br>$tmpBitValue = strrev($tmpBitValue)";
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$newBitValue=$newBitValue.$tmpBitValue;
|
||||
}
|
||||
|
||||
$catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit
|
||||
if($Debug) echo "<br>bitValue = substr($newBitValue,$bgnBit,$catBitLen)";
|
||||
$bitValue = substr($newBitValue,$bgnBit,$catBitLen);
|
||||
$bitValue = strrev($bitValue);
|
||||
if($Debug) echo "<br>bitValue = $bitValue";
|
||||
}
|
||||
|
||||
//explode by '[v]'
|
||||
$valueArr = explode('[v]',$tlvArr[2]);
|
||||
//$operType = chop($valueArr[0]);
|
||||
$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]);
|
||||
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++;
|
||||
}
|
||||
$charValue = trim($charValue);
|
||||
$inputValue = $charValue;
|
||||
}
|
||||
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{
|
||||
$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;
|
||||
case 'F': //modify zane 20051004
|
||||
$inputValue = str_replace('F','',$inputValue);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
if($Debug) echo "<br>$valueType == $nOctStr";
|
||||
if($def_flag){
|
||||
$inputValue = $defaultVaule;
|
||||
}
|
||||
//echo "valueType:$valueType<br>";
|
||||
//if($valueType == $nOctStr)
|
||||
//echo "getInner----inputValueType:$inputValueType<br>";
|
||||
//$inputValueType=$inputValueType+0;
|
||||
if($valueType==2)
|
||||
{
|
||||
$chechFnc = "checkInput(this,16)";
|
||||
|
||||
if($defArr[0] == 'toAscii')
|
||||
{
|
||||
$inputLen = $byteLen;
|
||||
$chechFnc = "";
|
||||
}
|
||||
elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex')
|
||||
{
|
||||
$inputLen = $byteLen *2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$inputLen = $byteLen *3;
|
||||
}
|
||||
$inputSize = $inputLen + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$chechFnc = "checkInput(this,10)";
|
||||
}
|
||||
|
||||
//=============input type=====================
|
||||
$inputValueType=$inputValueType+0;
|
||||
//echo "getInner----inputValueType:$inputValueType<br>";
|
||||
//===only can input the dec num====
|
||||
if($inputValueType==1)
|
||||
{
|
||||
if($valueType == 4)
|
||||
{
|
||||
$maxValue=hexdec($maxValue);
|
||||
$minValue=hexdec($minValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$maxValue=$maxValue+0;
|
||||
$minValue=$minValue+0;
|
||||
}
|
||||
if($order>1)
|
||||
$chechFnc = "checkInput(this,10)";
|
||||
else
|
||||
$chechFnc = "checkInput(this,10,$maxValue,$minValue)";
|
||||
}
|
||||
//===only can input the hex num====
|
||||
else if($inputValueType==2)
|
||||
{
|
||||
$chechFnc = "checkInput(this,16)";
|
||||
}
|
||||
//====can input all character
|
||||
else if($inputValueType==3)
|
||||
{
|
||||
$chechFnc = "";
|
||||
}
|
||||
//=====can put only dec num but include blank
|
||||
else if($inputValueType==4)
|
||||
{
|
||||
$chechFnc = "checkInput_patch(this)";
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<input id=\"$inputID\" type=\"text\" class=\"text\" value=\"$inputValue\" size=\"$inputSize\" maxLength =\"$inputLen\" onchange=\"$chechFnc\">";
|
||||
return $inputValue;
|
||||
break;
|
||||
}
|
||||
case 'select':
|
||||
{
|
||||
if($valueType == $nOctStr){
|
||||
if($bitValue != ''){
|
||||
$selectValue = BinDec($bitValue);
|
||||
}else{
|
||||
$selectValue = HexDec($byteValue);
|
||||
}
|
||||
}else{
|
||||
$selectValue=$byteValue;
|
||||
}
|
||||
if($def_flag){
|
||||
$selectValue = $defaultVaule;
|
||||
}
|
||||
|
||||
if($Debug) echo "<br>bitValue = $bitValue";
|
||||
if($Debug) echo "<br>selectValue = $selectValue";
|
||||
if($Debug) echo "<br>$valueType =?= $nOctStr(nOctStr)";
|
||||
echo "<select id=\"$inputID\" size=\"1\">";
|
||||
$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>";
|
||||
$selectshwo = "Reserved Value";
|
||||
break;
|
||||
}elseif($defArr[0] == $selectValue){
|
||||
echo "<option value=\"$defArr[0]\" selected>$defArr[1]</option>";
|
||||
$selectshwo ="$selectValue";
|
||||
$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>";
|
||||
$selectshwo = "Undefined Value";
|
||||
}
|
||||
echo "</select>";
|
||||
if($readonly){
|
||||
echo "$selectshwo";
|
||||
}
|
||||
return $selectshwo;
|
||||
break;
|
||||
}
|
||||
default: echo "<br>Error:operType =|$operType|";
|
||||
break;
|
||||
}//end of switch(..)
|
||||
}//end getInnerValue
|
||||
|
||||
function getParamValue(&$titleStr,&$IniEquRead,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$inputValueType)
|
||||
{
|
||||
global $language;
|
||||
//$Debug=1;
|
||||
$sysIdArr = explode('_',$sysId);
|
||||
$sysTypeNo = $sysIdArr[0];
|
||||
$sysNo = $sysIdArr[1];
|
||||
$subSysNo = $sysIdArr[2];
|
||||
$objDb = 'OBJ_'.$sysTypeNo;
|
||||
$paramTable = 'param_'.$sysNo;
|
||||
|
||||
$sysConfTable = 'OMC_PUB.sysConf';
|
||||
$pubDb ='OMC_PUB';
|
||||
$paramConfTable = $objDb.".paramConf";
|
||||
|
||||
$maxLevelNum = 10;
|
||||
$nInteger = 2;
|
||||
$nOctStr = 4;
|
||||
|
||||
|
||||
|
||||
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>)
|
||||
}
|
||||
|
||||
$objWhereStr = getLevelWhere($oidStr);
|
||||
|
||||
$objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr";
|
||||
$objResult = mysqli_query($pubConn ,$objSql);
|
||||
$objRows = @mysqli_fetch_array($objResult);
|
||||
$totalLen = $objRows[length]*2;
|
||||
$objName = $objRows[$objNameField];
|
||||
$setTemplate = $objRows[$objSetField];
|
||||
$valueType = $objRows[valueType];
|
||||
$minValue = $objRows[minValue];
|
||||
$maxValue = $objRows[maxValue];
|
||||
|
||||
//explode by '[remark]'
|
||||
$remarkArr = explode('[remark]',$setTemplate);
|
||||
$remark = $remarkArr[1];
|
||||
//explode by '[unit]'
|
||||
$unitArr = explode('[unit]',$remarkArr[0]);
|
||||
|
||||
//explode by '[u]'
|
||||
$tlvArr = explode('[u]',$unitArr[$order]);
|
||||
|
||||
//Unit Name
|
||||
if($Debug) echo "$tlvArr[0] : $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;
|
||||
|
||||
$paramSql = " SELECT initValue,readValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' ";
|
||||
$v_Result = mysqli_query($pubConn,$paramSql);
|
||||
$v_Row = mysqli_fetch_array($v_Result);
|
||||
$initGetValue = $v_Row[0];
|
||||
$readGetValue = $v_Row[1];
|
||||
|
||||
$initByteValue = substr($initGetValue,$bgnByte*2,$byteLen*2);
|
||||
$readByteValue = substr($readGetValue,$bgnByte*2,$byteLen*2);
|
||||
if($Debug) echo "<br>init:$initByteValue<br>read:$readByteValue";
|
||||
$readBitValue = '';
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
$bitLen = $byteLen*8;//1 byte = 8 bit
|
||||
$readBitValue = DecBin(HexDec($readByteValue));
|
||||
$readBitValue = omcStrFill($readBitValue,$bitLen,'high','0');
|
||||
|
||||
$newBitValue='';
|
||||
for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){
|
||||
$tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8);
|
||||
if($DEBUG) echo "<br>$tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8)";
|
||||
$tmpBitValue = strrev($tmpBitValue);
|
||||
if($DEBUG) echo "<br>$tmpBitValue = strrev($tmpBitValue)";
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$newBitValue=$newBitValue.$tmpBitValue;
|
||||
}
|
||||
|
||||
|
||||
$catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit
|
||||
if($Debug) echo "<br>readBitValue = substr($newBitValue,$bgnBit,$catBitLen)";
|
||||
$readBitValue = substr($newBitValue,$bgnBit,$catBitLen);
|
||||
$readBitValue = strrev($readBitValue);
|
||||
if($Debug) echo "<br>readBitValue = $readBitValue";
|
||||
}
|
||||
$initBitValue = '';
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
$bitLen = $byteLen*8;//1 byte = 8 bit
|
||||
$initBitValue = DecBin(HexDec($initByteValue));
|
||||
$initBitValue = omcStrFill($initBitValue,$bitLen,'high','0');
|
||||
|
||||
$newBitValue='';
|
||||
for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){
|
||||
$tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8);
|
||||
if($DEBUG) echo "<br>$tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8)";
|
||||
$tmpBitValue = strrev($tmpBitValue);
|
||||
if($DEBUG) echo "<br>$tmpBitValue = strrev($tmpBitValue)";
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$newBitValue=$newBitValue.$tmpBitValue;
|
||||
}
|
||||
|
||||
$catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit
|
||||
if($Debug) echo "<br>initBitValue = substr($initBitValue,$bgnBit,$catBitLen)";
|
||||
$initBitValue = substr($newBitValue,$bgnBit,$catBitLen);
|
||||
$initBitValue = strrev($initBitValue);
|
||||
if($Debug) echo "<br>initBitValue = $initBitValue";
|
||||
}
|
||||
$IniEquRead = false;
|
||||
if(strlen($initBitValue)>0)
|
||||
{
|
||||
if($initBitValue==$readBitValue)
|
||||
$IniEquRead = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($initByteValue == $readByteValue)
|
||||
$IniEquRead = true;
|
||||
}
|
||||
//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($initBitValue) > 0){
|
||||
$initParsedValue = BinDec($initBitValue);
|
||||
}else{
|
||||
$initParsedValue = HexDec($initByteValue);
|
||||
}
|
||||
break;
|
||||
case 'keepDec':
|
||||
$initParsedValue = $initByteValue;
|
||||
break;
|
||||
case 'toHex':
|
||||
echo "<br>Error:toHex";
|
||||
break;
|
||||
case 'keepHex':
|
||||
$initParsedValue = $initByteValue;
|
||||
break;
|
||||
case 'toAscii':
|
||||
$charValue = "";
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
echo "<br>Error:toAscii";
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpLen=strlen($initByteValue);
|
||||
for($charCount=0;$charCount<$tmpLen;$charCount++)
|
||||
{
|
||||
$unitByte = substr($initByteValue,$charCount,2);
|
||||
$unitChar = chr(HexDec($unitByte)); // hex -> ascii
|
||||
if($Debug) echo "<br>unitChar=$unitChar";
|
||||
$charValue .= $unitChar;
|
||||
$charCount++;
|
||||
}
|
||||
$charValue = trim($charValue);
|
||||
$initParsedValue = $charValue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "<br>Error:valueType=$defArr[0]";
|
||||
break;
|
||||
}
|
||||
if($Debug) echo "<br>initParsedValue = $initParsedValue";
|
||||
switch($defArr[1])
|
||||
{
|
||||
case 'high':
|
||||
switch($defArr[2])
|
||||
{
|
||||
case '0':
|
||||
if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){
|
||||
//$initParsedValue = str_replace('0','',$initParsedValue);
|
||||
}else{
|
||||
$initParsedValue = $initParsedValue - 0;
|
||||
}
|
||||
break;
|
||||
case 'E':
|
||||
echo "Error:high fill E";
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 'low':
|
||||
if ("toAscii" != $defArr[0])
|
||||
{
|
||||
switch($defArr[2]){
|
||||
case '0':
|
||||
$initParsedValue = str_replace('00','',$initParsedValue);
|
||||
break;
|
||||
case 'E':
|
||||
$initParsedValue = str_replace('E','',$initParsedValue);
|
||||
break;
|
||||
case 'F': //modify zane 20051004
|
||||
$initParsedValue = str_replace('F','',$initParsedValue);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
$returnValue = $initParsedValue;
|
||||
break;
|
||||
}
|
||||
case 'select':
|
||||
{
|
||||
if($valueType == $nOctStr){
|
||||
if($initBitValue != ''){
|
||||
$selectValue = BinDec($initBitValue);
|
||||
}else{
|
||||
$selectValue = HexDec($initByteValue);
|
||||
}
|
||||
}else{
|
||||
$selectValue=$initByteValue;
|
||||
}
|
||||
$isSelected = 0;
|
||||
for($j=1;$j<sizeof($valueArr);$j++){
|
||||
//explode by '[opt]'
|
||||
$defArr = explode('[opt]',$valueArr[$j]);
|
||||
if(sizeof($defArr) < 2){
|
||||
$selectShow = "Reserved Value";
|
||||
break;
|
||||
}elseif($defArr[0] == $selectValue){
|
||||
$selectShow =$defArr[1];
|
||||
$isSelected = 1;
|
||||
}else{
|
||||
//echo "<option value=\"$defArr[0]\">$defArr[1]</option>";
|
||||
}
|
||||
}
|
||||
|
||||
if($isSelected ==0 && $j == sizeof($valueArr)){
|
||||
$selectShow = "Undefined Value";
|
||||
}
|
||||
$returnValue = $selectShow;
|
||||
break;
|
||||
}
|
||||
default: echo "<br>Error:operType =|$operType|";
|
||||
break;
|
||||
}//end of switch(..)
|
||||
if(strlen($returnValue)==0) $returnValue='--';
|
||||
return $returnValue;
|
||||
}//end getParamValue
|
||||
|
||||
function setParamValue($unitValue,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$inputValueType)
|
||||
{
|
||||
global $language;
|
||||
$Debug=0;
|
||||
$sysIdArr = explode('_',$sysId);
|
||||
$sysTypeNo = $sysIdArr[0];
|
||||
$sysNo = $sysIdArr[1];
|
||||
$subSysNo = $sysIdArr[2];
|
||||
$objDb = 'OBJ_'.$sysTypeNo;
|
||||
$paramTable = 'param_'.$sysNo;
|
||||
|
||||
$sysConfTable = 'OMC_PUB.sysConf';
|
||||
$pubDb ='OMC_PUB';
|
||||
$paramConfTable = $objDb.".paramConf";
|
||||
|
||||
$maxLevelNum = 10;
|
||||
$nInteger = 2;
|
||||
$nOctStr = 4;
|
||||
|
||||
|
||||
|
||||
if($Debug) echo "===================<br>unitValue:$unitValue<br>";
|
||||
//----------------------
|
||||
//ѡ<><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>)
|
||||
}
|
||||
|
||||
|
||||
$objWhereStr = getLevelWhere($oidStr);
|
||||
|
||||
$objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr";
|
||||
$objResult = mysqli_query($pubConn ,$objSql);
|
||||
$objRows = @mysqli_fetch_array($objResult);
|
||||
$totalLen = $objRows[length]*2;
|
||||
$objName = $objRows[$objNameField];
|
||||
$setTemplate = $objRows[$objSetField];
|
||||
$valueType = $objRows[valueType];
|
||||
$minValue = $objRows[minValue];
|
||||
$maxValue = $objRows[maxValue];
|
||||
|
||||
|
||||
$paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' ";
|
||||
$v_Result = mysqli_query($pubConn,$paramSql);
|
||||
$v_Row = mysqli_fetch_array($v_Result);
|
||||
$getValue = $v_Row[0];
|
||||
if($Debug) echo "<br>getValue = $getValue";
|
||||
|
||||
|
||||
//explode by '[remark]'
|
||||
$remarkArr = explode('[remark]',$setTemplate);
|
||||
$remark = $remarkArr[1];
|
||||
//explode by '[unit]'
|
||||
$unitArr = explode('[unit]',$remarkArr[0]);
|
||||
|
||||
//explode by '[u]'
|
||||
$tlvArr = explode('[u]',$unitArr[$order]);
|
||||
|
||||
//Unit Name
|
||||
if($Debug) echo "<br>$tlvArr[0] : $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;
|
||||
|
||||
//explode by '[v]'
|
||||
$valueArr = explode('[v]',$tlvArr[2]);
|
||||
//$operType = chop($valueArr[0]);
|
||||
$typeAddTitleArr = explode('[t]',$valueArr[0]);
|
||||
$operType = chop($typeAddTitleArr[0]);
|
||||
$titleStr = chop($typeAddTitleArr[1]);
|
||||
$valueArr[1] = chop($valueArr[1]);
|
||||
|
||||
if($Debug) echo "<br>operType = $operType";
|
||||
if($operType == 'select')
|
||||
{ //select
|
||||
if($valueType == $nOctStr)
|
||||
$changeTypeStr = 'toDec-high-0';
|
||||
else
|
||||
$changeTypeStr = 'keepDec-high-0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$changeTypeStr = $valueArr[1];
|
||||
}
|
||||
$changeTypeArr = explode('-',$changeTypeStr);
|
||||
$changeType = $changeTypeArr[0];
|
||||
$fillWay = $changeTypeArr[1];
|
||||
$fillChar = $changeTypeArr[2];
|
||||
|
||||
$setUnitValue = '';
|
||||
if($Debug)echo "<br>changeType:$changeType";
|
||||
switch($changeType)
|
||||
{
|
||||
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 ";
|
||||
if($Debug)echo "<br>omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)";
|
||||
$bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar);
|
||||
|
||||
if($bgnByte!=$endByte){
|
||||
if($DEBUG) echo "<br>substr($bitValue,0,1+$endBit)";
|
||||
$tmpBitValue=substr($bitValue,0,1+$endBit);
|
||||
$tmpOffset=$endByte.'.0-'.$endByte.'.'.$endBit;
|
||||
|
||||
if($endBit==7){
|
||||
$tmpByteValue=omcStrFill(dechex(bindec($tmpBitValue)),2,$fillWay,$fillChar);
|
||||
$getValue = setBitValue($getValue,$tmpOffset,$tmpByteValue);
|
||||
}else
|
||||
$getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue);
|
||||
|
||||
if($DEBUG)echo "<br>$getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue);";
|
||||
$newBitValue=$tmpBitValue;
|
||||
if($DEBUG) echo "<br>newBitValue=$newBitValue";
|
||||
|
||||
for($byteNum=$endByte-1;$byteNum >= $bgnByte;$byteNum--){
|
||||
if($DEBUG) echo "<br>substr($bitValue,($byteNum-($endByte-1))*8+1+$endBit,8)";
|
||||
$tmpBitValue=substr($bitValue,($byteNum-($endByte-1))*8+1+$endBit,8);
|
||||
|
||||
|
||||
if($byteNum == $bgnByte){
|
||||
$tmpOffset=$bgnByte.'.'.$bgnBit.'-'.$bgnByte.'.7';
|
||||
if($DEBUG)
|
||||
echo "<br>$getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue);";
|
||||
if($bgnBit==0){
|
||||
$tmpByteValue=omcStrFill(dechex(bindec($tmpBitValue)),2,$fillWay,$fillChar);
|
||||
$getValue = setBitValue($getValue,$tmpOffset,$tmpByteValue);
|
||||
}else
|
||||
$getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue);
|
||||
}else{
|
||||
$tmpOffset=$byteNum.'.0-'.$bgnByte.'.7';
|
||||
$getValue = setBitValue($getValue,$tmpOffset,dechex(bindec($tmpBitValue)));
|
||||
}
|
||||
|
||||
if($DEBUG) echo "<br>$newBitValue.$tmpBitValue";
|
||||
$newBitValue=$newBitValue.$tmpBitValue;
|
||||
if($DEBUG) echo "<br>newBitValue=$newBitValue";
|
||||
}
|
||||
$bitValue=$newBitValue;
|
||||
}
|
||||
|
||||
$setUnitValue = $bitValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$setUnitValue = DecHex($unitValue);
|
||||
$strLen = $byteLen*2;
|
||||
$setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar);
|
||||
if($Debug) echo "<br>omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)";
|
||||
}
|
||||
if($Debug) echo "<br>setUnitValue = $setUnitValue";
|
||||
break;
|
||||
case 'keepHex':
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
$bitLen = $endBit - $bgnBit +1;
|
||||
$bitValue = ($unitValue);
|
||||
if($Debug) echo "<br>bitValue = $bitValue ";
|
||||
$bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar);
|
||||
if($Debug) echo "<br>omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)";
|
||||
$setUnitValue = $bitValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$setUnitValue = ($unitValue);
|
||||
$strLen = $byteLen*2;
|
||||
$setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar);
|
||||
if($Debug) echo "<br>omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)";
|
||||
}
|
||||
if($Debug) echo "<br>setUnitValue = $setUnitValue";
|
||||
break;
|
||||
case 'keepDec':
|
||||
//echo "<br>Error:keepDec";
|
||||
$setUnitValue = $unitValue - 0;
|
||||
break;
|
||||
case 'toHex':
|
||||
echo "<br>Error:toHex";
|
||||
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
|
||||
$setUnitValue .= DecHex($decValue);
|
||||
if(strlen($setUnitValue) < 2){
|
||||
$setUnitValue = '0'.$setUnitValue;
|
||||
}
|
||||
}
|
||||
$strLen = $byteLen*2;
|
||||
$setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "Error:Unknown valueType";
|
||||
break;
|
||||
}
|
||||
if($Debug) echo "<br>setUnitValue = $setUnitValue ";
|
||||
//--><-//$lastValue = $setUnitValue.$lastValue;
|
||||
|
||||
if($changeType=='toDec'&&($bgnBit > 0 ||$endBit < 7)&&$bgnByte!=$endByte)
|
||||
$setValue=$getValue;
|
||||
else
|
||||
$setValue = setBitValue($getValue,$tlvArr[1],$setUnitValue);
|
||||
|
||||
$setValue = strtoupper($setValue);
|
||||
$updSql = "UPDATE $paramTable SET initValue = '$setValue'
|
||||
WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo'";
|
||||
if($DEBUG)
|
||||
echo "<br>updSql=$updSql";
|
||||
mysqli_query($pubConn,$updSql);
|
||||
echo mysqli_error($pubConn);
|
||||
}//end setParamValue
|
||||
|
||||
//0: flag
|
||||
echo $flag;
|
||||
echo "###";
|
||||
|
||||
if($flag=='getVar')//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD>
|
||||
{
|
||||
//1: idName
|
||||
echo $newId;
|
||||
echo "###";
|
||||
|
||||
//2: innerStr
|
||||
$oldValue=getInnerValue($sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$showStr,$inputValueType);
|
||||
if(strlen($doingOtherUlr)>0)
|
||||
{
|
||||
$doingOtherUlr .= "&oldValue=$oldValue";
|
||||
$doingOtherUlr=urlencode($doingOtherUlr);
|
||||
}
|
||||
echo " <span id=\"$saveId\" style=\"cursor:pointer\" onclick=\"javascript:getPar('saveVar','$language','$sysId','$oidStr','$order','$instanceNo','$inputID','$doingOtherUlr','$otherWhereStr','$showStr','$inputValueType');\"><font color=\"blue\"><b> SAVE <b></font></span>";
|
||||
}
|
||||
|
||||
if($flag=='saveVar')//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұߵġ<DFB5>Save<76><65>
|
||||
{
|
||||
|
||||
//1: idName
|
||||
echo $id;
|
||||
echo "###";
|
||||
|
||||
//2: innerStr
|
||||
setParamValue($setValue,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$inputValueType);
|
||||
$newValue = getParamValue($titleStr,$IniEquRead,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$inputValueType);
|
||||
if(strlen($showStr))
|
||||
echo $showStr;
|
||||
else
|
||||
echo $newValue;
|
||||
echo "###";
|
||||
|
||||
//3: isEqual
|
||||
if($IniEquRead||strlen($showStr)) //initValue == readValue
|
||||
echo "1";
|
||||
else
|
||||
echo "0";
|
||||
echo "###";
|
||||
|
||||
//4: doingOtherUlr
|
||||
if(strlen($doingOtherUlr)>0)
|
||||
{
|
||||
$doingOtherUlr .= "&newValue=$newValue";
|
||||
}
|
||||
echo $doingOtherUlr;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
466
wxc2_omc/account/sub_inc/operwebfunc.inc
Executable file
466
wxc2_omc/account/sub_inc/operwebfunc.inc
Executable file
@@ -0,0 +1,466 @@
|
||||
<?
|
||||
$settedColor="blue";
|
||||
$notSettedColor="#008000";
|
||||
$inputBkgrdColor = "#E7FEFD";
|
||||
$saveBkgrdColor="#F3F77D";
|
||||
$waitingBkgrdColor = "red";
|
||||
|
||||
function getParamValue(&$titleStr,&$IniEquRead,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='')
|
||||
{
|
||||
global $language;
|
||||
//$DEBUG=1;
|
||||
$sysIdArr = explode('_',$sysId);
|
||||
$sysTypeNo = $sysIdArr[0];
|
||||
$sysNo = $sysIdArr[1];
|
||||
$subSysNo = $sysIdArr[2];
|
||||
$objDb = 'OBJ_'.$sysTypeNo;
|
||||
$paramTable = 'param_'.$sysNo;
|
||||
|
||||
$sysConfTable = 'OMC_PUB.sysConf';
|
||||
$pubDb ='OMC_PUB';
|
||||
$paramConfTable = $objDb.".paramConf";
|
||||
|
||||
$maxLevelNum = 10;
|
||||
$nInteger = 2;
|
||||
$nOctStr = 4;
|
||||
|
||||
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>)
|
||||
}
|
||||
|
||||
$objWhereStr = getLevelWhere($oidStr);
|
||||
|
||||
$objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr";
|
||||
$objResult = mysqli_query($pubConn ,$objSql);
|
||||
$objRows = @mysqli_fetch_array($objResult);
|
||||
$totalLen = $objRows[length]*2;
|
||||
$objName = $objRows[$objNameField];
|
||||
$setTemplate = $objRows[$objSetField];
|
||||
$valueType = $objRows[valueType];
|
||||
$minValue = $objRows[minValue];
|
||||
$maxValue = $objRows[maxValue];
|
||||
|
||||
//explode by '[remark]'
|
||||
$remarkArr = explode('[remark]',$setTemplate);
|
||||
$remark = $remarkArr[1];
|
||||
//explode by '[unit]'
|
||||
$unitArr = explode('[unit]',$remarkArr[0]);
|
||||
|
||||
//explode by '[u]'
|
||||
$tlvArr = explode('[u]',$unitArr[$order]);
|
||||
|
||||
//Unit Name
|
||||
if($DEBUG) echo "$tlvArr[0] : $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;
|
||||
|
||||
$paramSql = " SELECT initValue,readValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' ";
|
||||
$v_Result = mysqli_query($pubConn,$paramSql);
|
||||
$v_Row = mysqli_fetch_array($v_Result);
|
||||
$initGetValue = $v_Row[0];
|
||||
$readGetValue = $v_Row[1];
|
||||
|
||||
$initByteValue = substr($initGetValue,$bgnByte*2,$byteLen*2);
|
||||
$readByteValue = substr($readGetValue,$bgnByte*2,$byteLen*2);
|
||||
if($DEBUG) echo "<br>init:$initByteValue<br>read:$readByteValue";
|
||||
$readBitValue = '';
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
$bitLen = $byteLen*8;//1 byte = 8 bit
|
||||
$readBitValue = DecBin(HexDec($readByteValue));
|
||||
$readBitValue = omcStrFill($readBitValue,$bitLen,'high','0');
|
||||
|
||||
$newBitValue='';
|
||||
for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){
|
||||
$tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8);
|
||||
if($DEBUG) echo "<br>$tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8)";
|
||||
$tmpBitValue = strrev($tmpBitValue);
|
||||
if($DEBUG) echo "<br>$tmpBitValue = strrev($tmpBitValue)";
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$newBitValue=$newBitValue.$tmpBitValue;
|
||||
}
|
||||
|
||||
$catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit
|
||||
if($DEBUG) echo "<br>readBitValue = substr($newBitValue,$bgnBit,$catBitLen)";
|
||||
$readBitValue = substr($newBitValue,$bgnBit,$catBitLen);
|
||||
$readBitValue = strrev($readBitValue);
|
||||
if($DEBUG) echo "<br>readBitValue = $readBitValue";
|
||||
}
|
||||
$initBitValue = '';
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
$bitLen = $byteLen*8;//1 byte = 8 bit
|
||||
$initBitValue = DecBin(HexDec($initByteValue));
|
||||
$initBitValue = omcStrFill($initBitValue,$bitLen,'high','0');
|
||||
|
||||
$newBitValue='';
|
||||
for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){
|
||||
$tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8);
|
||||
if($DEBUG) echo "<br>$tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8)";
|
||||
$tmpBitValue = strrev($tmpBitValue);
|
||||
if($DEBUG) echo "<br>$tmpBitValue = strrev($tmpBitValue)";
|
||||
if($DEBUG) echo "<br>bitValue = $bitValue";
|
||||
$newBitValue=$newBitValue.$tmpBitValue;
|
||||
}
|
||||
|
||||
|
||||
$catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit
|
||||
if($DEBUG) echo "<br>initBitValue = substr($newBitValue,$bgnBit,$catBitLen)";
|
||||
$initBitValue = substr($newBitValue,$bgnBit,$catBitLen);
|
||||
$initBitValue = strrev($initBitValue);
|
||||
if($DEBUG) echo "<br>initBitValue = $initBitValue";
|
||||
}
|
||||
$IniEquRead = false;
|
||||
if(strlen($initBitValue)>0)
|
||||
{
|
||||
if($initBitValue==$readBitValue)
|
||||
$IniEquRead = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($initByteValue == $readByteValue)
|
||||
$IniEquRead = true;
|
||||
}
|
||||
//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($initBitValue) > 0){
|
||||
$initParsedValue = BinDec($initBitValue);
|
||||
}else{
|
||||
$initParsedValue = HexDec($initByteValue);
|
||||
}
|
||||
break;
|
||||
case 'keepDec':
|
||||
$initParsedValue = $initByteValue;
|
||||
break;
|
||||
case 'toHex':
|
||||
echo "<br>Error:toHex";
|
||||
break;
|
||||
case 'keepHex':
|
||||
$initParsedValue = $initByteValue;
|
||||
break;
|
||||
case 'toAscii':
|
||||
$charValue = "";
|
||||
if($bgnBit > 0 ||$endBit < 7)
|
||||
{
|
||||
echo "<br>Error:toAscii";
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpLen=strlen($initByteValue);
|
||||
for($charCount=0;$charCount<$tmpLen;$charCount++)
|
||||
{
|
||||
$unitByte = substr($initByteValue,$charCount,2);
|
||||
$unitChar = chr(HexDec($unitByte)); // hex -> ascii
|
||||
if($DEBUG) echo "<br>unitChar=$unitChar";
|
||||
$charValue .= $unitChar;
|
||||
$charCount++;
|
||||
}
|
||||
$charValue = trim($charValue);
|
||||
$initParsedValue = $charValue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "<br>Error:valueType=$defArr[0]";
|
||||
break;
|
||||
}
|
||||
if($DEBUG) echo "<br>initParsedValue = $initParsedValue";
|
||||
switch($defArr[1])
|
||||
{
|
||||
case 'high':
|
||||
switch($defArr[2])
|
||||
{
|
||||
case '0':
|
||||
if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){
|
||||
//$initParsedValue = str_replace('0','',$initParsedValue);
|
||||
}else{
|
||||
$initParsedValue = $initParsedValue - 0;
|
||||
}
|
||||
break;
|
||||
case 'E':
|
||||
echo "Error:high fill E";
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 'low':
|
||||
if ("toAscii" != $defArr[0])
|
||||
{
|
||||
switch($defArr[2]){
|
||||
case '0':
|
||||
$initParsedValue = str_replace('00','',$initParsedValue);
|
||||
break;
|
||||
case 'E':
|
||||
$initParsedValue = str_replace('E','',$initParsedValue);
|
||||
break;
|
||||
case 'F': //modify zane 20051004
|
||||
$initParsedValue = str_replace('F','',$initParsedValue);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
$returnValue = $initParsedValue;
|
||||
break;
|
||||
}
|
||||
case 'select':
|
||||
{
|
||||
if($valueType == $nOctStr){
|
||||
if($initBitValue != ''){
|
||||
$selectValue = BinDec($initBitValue);
|
||||
}else{
|
||||
$selectValue = HexDec($initByteValue);
|
||||
}
|
||||
}else{
|
||||
$selectValue=$initByteValue;
|
||||
}
|
||||
$isSelected = 0;
|
||||
for($j=1;$j<sizeof($valueArr);$j++){
|
||||
//explode by '[opt]'
|
||||
$defArr = explode('[opt]',$valueArr[$j]);
|
||||
if(sizeof($defArr) < 2){
|
||||
$selectShow = "Reserved Value";
|
||||
break;
|
||||
}elseif($defArr[0] == $selectValue){
|
||||
$selectShow =$defArr[1];
|
||||
$isSelected = 1;
|
||||
}else{
|
||||
//echo "<option value=\"$defArr[0]\">$defArr[1]</option>";
|
||||
}
|
||||
}
|
||||
|
||||
if($isSelected ==0 && $j == sizeof($valueArr)){
|
||||
$selectShow = "Undefined Value";
|
||||
}
|
||||
$returnValue = $selectShow;
|
||||
break;
|
||||
}
|
||||
default: echo "<br>Error:operType =|$operType|";
|
||||
break;
|
||||
}//end of switch(..)
|
||||
if(strlen($returnValue)==0) $returnValue='--';
|
||||
return $returnValue;
|
||||
}//end getParamValue
|
||||
|
||||
function showParameter($sysId,$oidStr,$order,$inputValueType,$instanceNo=0,$doingOtherUlr='',$otherWhereStr='',$showStr='')
|
||||
{
|
||||
global $language,$notSettedColor,$settedColor;
|
||||
$tmp1 = str_replace('.','_',$oidStr);
|
||||
$id = 'ID_' . $sysId . '_' . $tmp1 . '_' . $order . '_ist' . $instanceNo;
|
||||
$newId = "New".$id;
|
||||
$showValue = getParamValue($titleStr,$IniEquRead,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr);
|
||||
if($IniEquRead)$color = $settedColor;
|
||||
else $color = $notSettedColor;
|
||||
$doingOtherUlr=urlencode($doingOtherUlr);
|
||||
if(strlen($showStr))
|
||||
{
|
||||
$color = $settedColor;
|
||||
$showValue = $showStr;
|
||||
}
|
||||
//$otherWhereStr=urlencode($otherWhereStr);
|
||||
echo "<span id=\"$id\" title=\"$titleStr\" style=\"cursor:pointer\" onclick=\"javascript:getPar('getVar','$language','$sysId','$oidStr','$order','$instanceNo','0','$doingOtherUlr','$otherWhereStr','$showStr','$inputValueType');\"><font color=\"$color\">$showValue</font></span>";
|
||||
echo "<span id=\"$newId\" style=\"display:none\" ></span>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
var globalID;
|
||||
function getPar(flag,lan,sysId,oidStr,order,instanceNo,inputID,doingOtherUlr,otherWhereStr,showStr,inputValueType)
|
||||
{
|
||||
|
||||
var ulr="../sub_inc/getParameter.php?flag="+flag+"&lan="+lan+"&sysId="+sysId+"&oidStr="+oidStr+"&order="+order+"&instanceNo="+instanceNo;
|
||||
if(flag=='saveVar')
|
||||
{
|
||||
var setValue = document.getElementById(inputID).value;
|
||||
ulr = ulr + "&setValue=" + setValue;
|
||||
}
|
||||
ulr = ulr+"&doingOtherUlr="+doingOtherUlr+"&otherWhereStr="+otherWhereStr+"&showStr="+showStr+"&inputValueType="+inputValueType;
|
||||
var browser = navigator.appName;
|
||||
if(browser == "Microsoft Internet Explorer")
|
||||
{
|
||||
request_o = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
else
|
||||
{
|
||||
request_o = new XMLHttpRequest();
|
||||
}
|
||||
//alert(ulr);
|
||||
request_o.open("GET",ulr,"false");
|
||||
request_o.onreadystatechange = updateID;
|
||||
request_o.send(null);
|
||||
}
|
||||
function updateID()
|
||||
{
|
||||
if(request_o.readyState == 4)
|
||||
{
|
||||
var strResult = request_o.responseText;
|
||||
var arrResult = strResult.split("###");
|
||||
var flag = arrResult[0];
|
||||
var idName = arrResult[1];
|
||||
var innerStr = arrResult[2];
|
||||
//alert(strResult+"00");
|
||||
if(flag=='getVar')
|
||||
{
|
||||
var getVarId = idName.substr(3);//ID...
|
||||
var InputId = "Input"+getVarId;
|
||||
var saveId = "Save" + getVarId;
|
||||
document.getElementById(getVarId).style.display="none";
|
||||
document.getElementById(idName).style.display="";
|
||||
}
|
||||
if(flag=='saveVar')
|
||||
{
|
||||
globalID = idName;
|
||||
var saveVarId = "New"+idName;//NewID...
|
||||
document.getElementById(saveVarId).style.display="none";
|
||||
document.getElementById(idName).style.display="";
|
||||
document.getElementById(idName).style.cursor="pointer";
|
||||
var isEqual = arrResult[3];
|
||||
if(isEqual == '1') color="<?php echo $settedColor;?>";
|
||||
else color = "<?php echo $notSettedColor;?>";
|
||||
document.getElementById(idName).style.color = color;
|
||||
//alert(innerStr);
|
||||
var doingOtherUlr = arrResult[4];
|
||||
if(doingOtherUlr.length>0)
|
||||
{
|
||||
//alert(doingOtherUlr);
|
||||
doingOther(doingOtherUlr);
|
||||
}
|
||||
}
|
||||
document.getElementById(idName).innerHTML = innerStr;
|
||||
if(flag == 'getVar')
|
||||
{
|
||||
document.getElementById(InputId).style.background="<?php echo $inputBkgrdColor;?>";
|
||||
document.getElementById(saveId).style.background="<?php echo $saveBkgrdColor;?>";
|
||||
//alert(document.getElementById(InputId).value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doingOther(ulr)
|
||||
{
|
||||
var browser = navigator.appName;
|
||||
if(browser == "Microsoft Internet Explorer")
|
||||
{
|
||||
request_o = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
else
|
||||
{
|
||||
request_o = new XMLHttpRequest();
|
||||
}
|
||||
request_o.open("GET",ulr,"false");
|
||||
request_o.onreadystatechange = otherReturn;
|
||||
request_o.send(null);
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫΪwaitingBkgrdColor
|
||||
function otherReturn()
|
||||
{
|
||||
if(request_o.readyState == 3)//û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
//var strResult = request_o.responseText;
|
||||
document.getElementById(globalID).style.background="<?php echo $waitingBkgrdColor;?>";
|
||||
}
|
||||
if(request_o.readyState == 4)//<2F><><EFBFBD><EFBFBD>
|
||||
{
|
||||
document.getElementById(globalID).style.background="";
|
||||
}
|
||||
}
|
||||
|
||||
function checkInput(term,flag,maxValue,minValue)
|
||||
{
|
||||
term.value = term.value.toUpperCase();
|
||||
if (flag == 16)
|
||||
{
|
||||
var checkOK = "0123456789ABCDEF";
|
||||
var showmsg ="Parameter must be a hexadecimal value";
|
||||
}
|
||||
else
|
||||
{
|
||||
var checkOK = "0123456789";
|
||||
var showmsg ="Parameter must be a decimal value";
|
||||
}
|
||||
|
||||
var checkStr = term.value;
|
||||
var allValid = true;
|
||||
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(checkStr == '')
|
||||
{
|
||||
showmsg = "Parameter can't be blank";
|
||||
alert(showmsg+"<22><>");
|
||||
}
|
||||
|
||||
if (!allValid){
|
||||
alert(showmsg+"<22><>");
|
||||
term.focus();
|
||||
term.value = 0;
|
||||
return (false);
|
||||
}
|
||||
if (maxValue != 0)
|
||||
{
|
||||
/*
|
||||
if (checkStr >= maxValue)
|
||||
{
|
||||
showmsg = "Parameter must less then "+ maxValue;
|
||||
alert(showmsg+"<22><>");
|
||||
term.value = maxValue;
|
||||
term.focus();
|
||||
return (false);
|
||||
}
|
||||
*/
|
||||
}
|
||||
if (minValue != '')
|
||||
{
|
||||
/*
|
||||
if (checkStr < minValue)
|
||||
{
|
||||
maxValue = maxValue;
|
||||
showmsg = "Parameter must between "+ minValue + " and " + maxValue;
|
||||
alert(showmsg+"<22><>");
|
||||
term.value = minValue;
|
||||
term.focus();
|
||||
return (false);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
</script>
|
||||
81
wxc2_omc/account/sub_inc/sub_chinese_gb.inc
Executable file
81
wxc2_omc/account/sub_inc/sub_chinese_gb.inc
Executable file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
$strCallISDN ="<EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strBeginTime ="<EFBFBD><EFBFBD>ʼʱ<EFBFBD><EFBFBD>";
|
||||
$strCalledISDN ="<EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strConverseTime ="ͨ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>(<28><>)";
|
||||
$strEndTime ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>";
|
||||
$strCallerE1Slot ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>E1/ʱ϶";
|
||||
$strCalledE1Slot ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>E1/ʱ϶";
|
||||
$strCallerTrunkGroup ="<EFBFBD><EFBFBD><EFBFBD>о<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strIncomingTrunkGroup ="<EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strOutgoingTrunkGroup ="<EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strCauseTerm ="<EFBFBD>ж<EFBFBD>ԭ<EFBFBD><EFBFBD>";
|
||||
$strServiceType ="ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strSeizureTime ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>";
|
||||
$strAnswerTime ="Ӧ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>";
|
||||
$strReleaseTime ="<EFBFBD>ж<EFBFBD>ʱ<EFBFBD><EFBFBD>";
|
||||
$strHlrInterrogation ="HLR<EFBFBD><EFBFBD>ѯ";
|
||||
$strLocationUpdate ="λ<EFBFBD>ø<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strRecordingEntity ="<EFBFBD><EFBFBD>¼ʵ<EFBFBD><EFBFBD>";
|
||||
$strRoutingNumber ="·<EFBFBD>ɺ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strNumberOfForwarding ="ǰת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strInterrogationResult ="ѯ<EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strIntTimeStamp ="ѯ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>";
|
||||
$strOldLocation ="<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ";
|
||||
$strNewLocation ="<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ";
|
||||
$strUpdateResult ="<EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strUpdateTimeStamp ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>";
|
||||
$strClassmark ="<EFBFBD>ȼ<EFBFBD><EFBFBD><EFBFBD>Ϣ";
|
||||
$strFee ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Ԫ)";
|
||||
$strBalance ="<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD>";
|
||||
$strLocalCallOut ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strLocalCallIn ="<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strTrunkCallOut ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>";
|
||||
$strNDDCallOut ="<EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>;";
|
||||
$strHMTCallOut ="<EFBFBD>۰<EFBFBD>̨<EFBFBD><EFBFBD>;";
|
||||
$strIDDCallOut ="<EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD>;";
|
||||
$strTrunkCallIn ="<EFBFBD><EFBFBD><EFBFBD>ֺ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strPeriodicCharge ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strIncrementValue ="<EFBFBD>˹<EFBFBD><EFBFBD><EFBFBD>ֵ";
|
||||
$strDecreaseValue ="<EFBFBD>˹<EFBFBD><EFBFBD>۷<EFBFBD>";
|
||||
$strRechargeSuccess ="<EFBFBD><EFBFBD>ֵ<EFBFBD>ɹ<EFBFBD>";
|
||||
$strRechargeFailure ="<EFBFBD><EFBFBD>ֵʧ<EFBFBD><EFBFBD>";
|
||||
|
||||
//add by lilong
|
||||
$strDescription ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strTariffRentChargeType ="<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strTariffRentAccordingToDate ="ÿ<EFBFBD><EFBFBD>";
|
||||
$strTariffRentAccordingToPeriod ="ÿ<EFBFBD><EFBFBD>";
|
||||
$strBasicTariff ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strResideZone ="<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strChargingPrefix ="<EFBFBD><EFBFBD>ͷ";
|
||||
$strCountryDistrict ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>";
|
||||
$strUnitChargingTimeSecond ="<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>λ(s)";
|
||||
$strMinimumChargingUnit ="<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>λ(s)";
|
||||
$strBasicFee ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strBasicLongDistance ="<EFBFBD><EFBFBD>;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strBasicInitial ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strDiscount ="<EFBFBD>ۿ<EFBFBD>";
|
||||
$strTariffDiscountTimeSection ="ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strSpecialDay ="<EFBFBD>ڼ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strReload ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strSourceIP ="ԴIP";
|
||||
|
||||
//added by xiehua 2003-05-13
|
||||
$strSMS ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ";
|
||||
$strCallForwrd ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>";
|
||||
$strConferenceCall ="<EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strRoaming ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strCloseUserGroup ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>";
|
||||
$strTariffNoRecords ="û<EFBFBD>з<EFBFBD><EFBFBD><EFBFBD>$tariff_id"."<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>¼ ";
|
||||
$strCdrMSC ="MSC<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strCdrPPS ="PPS<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strCdrSMSC ="<EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD>¼";
|
||||
$strSupplementary ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
$strAdvanced ="<EFBFBD><EFBFBD>";
|
||||
$strRechargeCard ="<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>";
|
||||
$strFreshCard ="<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>";
|
||||
$strUsedCard ="<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>";
|
||||
$strCapitalCharacter ="<EFBFBD><EFBFBD>д<EFBFBD>ַ<EFBFBD>";
|
||||
$strParaMustBeAHexNumber ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
?>
|
||||
133
wxc2_omc/account/sub_inc/sub_config.inc
Executable file
133
wxc2_omc/account/sub_inc/sub_config.inc
Executable file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
//<2F>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if($language == 'eng'){
|
||||
require("../sub_inc/sub_english.inc");
|
||||
}else{
|
||||
require("../sub_inc/sub_chinese_gb.inc");
|
||||
}
|
||||
|
||||
if($thisOmcType==1){
|
||||
$DEFAULT_SYS="GMSC";
|
||||
}elseif($thisOmcType==9){
|
||||
$DEFAULT_SYS="HBSC";
|
||||
}elseif($thisOmcType==10){
|
||||
$DEFAULT_SYS="SN";
|
||||
}else{
|
||||
$DEFAULT_SYS="MSC";
|
||||
}
|
||||
|
||||
//****************************************************************
|
||||
//<2F><><EFBFBD><EFBFBD>:
|
||||
// decodeTelNumber($srcNumber,$keepLenCode='E')
|
||||
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
|
||||
// <09><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>OSI<53><49><EFBFBD>뷽<EFBFBD><EBB7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9>ʵ绰<CAB5><E7BBB0><EFBFBD><EFBFBD>$srcNumber,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>
|
||||
//
|
||||
//
|
||||
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
|
||||
// $keepLenCode,<2C><>λ<EFBFBD>ַ<EFBFBD>һ<EFBFBD><D2BB>Ϊ'E'<27><>'F'
|
||||
//
|
||||
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>
|
||||
// <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD>
|
||||
//
|
||||
//<2F><><EFBFBD>ߣ<EFBFBD>
|
||||
//
|
||||
//<2F><EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
|
||||
//NO.1
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//ʱ<>䣺
|
||||
//<2F><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||||
//----------------------------------------------------------
|
||||
function decodeTelNumber($srcNumber,$keepLenCode='E')
|
||||
{
|
||||
$srcNumber=substr($srcNumber,2); //ȥ<><C8A5>ǰ<EFBFBD><C7B0><EFBFBD>ı<EFBFBD><C4B1>żƻ<C5BC>,<2C><>:'91'
|
||||
$srcNumber=str_replace($keepLenCode,'',$srcNumber); //ȥ<><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'E'
|
||||
return($srcNumber);
|
||||
}
|
||||
|
||||
//****************************************************************
|
||||
//<2F><><EFBFBD><EFBFBD>:
|
||||
// encodeTelNumber($srcNumber,$len='16',$keepLenCode='E',$planCode='91')
|
||||
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
|
||||
// <09><>һ<EFBFBD><D2BB>һ<EFBFBD><D2BB><EFBFBD>ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>$srcNumber,<2C><>OSI<53><49><EFBFBD>뷽<EFBFBD><EBB7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9>ʵ绰<CAB5><E7BBB0><EFBFBD><EFBFBD>
|
||||
//
|
||||
//
|
||||
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
|
||||
// $keepLenCode='E', <09><>λ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>һ<EFBFBD><D2BB>Ϊ'E'<27><>'F',ģ<><C4A3>ΪE
|
||||
// $planCode='91', <09><><EFBFBD>뷽<EFBFBD><EBB7BD><EFBFBD><EFBFBD><EFBFBD>룬һ<EBA3AC><D2BB>91,ģ<><C4A3>ΪE
|
||||
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>
|
||||
// <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9>ʵ绰<CAB5><E7BBB0><EFBFBD><EFBFBD>
|
||||
//
|
||||
//<2F><><EFBFBD>ߣ<EFBFBD>
|
||||
//
|
||||
//<2F><EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
|
||||
//NO.1
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//ʱ<>䣺
|
||||
//<2F><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||||
//----------------------------------------------------------
|
||||
function encodeTelNumber($srcNumber,$len='18',$keepLenCode='E',$planCode='91')
|
||||
{
|
||||
$DEBUG=0;
|
||||
if($DEBUG) echo "<br>srcNumber 1=$srcNumber";
|
||||
$valueLen=strlen($srcNumber);
|
||||
if($valueLen == $len){
|
||||
return($srcNumber);
|
||||
}elseif($valueLen > 0){
|
||||
$srcNumber = $planCode.$srcNumber;
|
||||
$valueLen=strlen($srcNumber);
|
||||
for($i=$len; $i>$valueLen; $i--){
|
||||
$srcNumber .=$keepLenCode;
|
||||
if($DEBUG) echo "<br>srcNumber 2=$srcNumber";
|
||||
}
|
||||
}else{
|
||||
for($i=0; $i<$len; $i++){
|
||||
$srcNumber .=$keepLenCode;
|
||||
}
|
||||
}
|
||||
if($DEBUG) echo "<br>srcNumber 3=$srcNumber";
|
||||
return($srcNumber);
|
||||
}
|
||||
|
||||
function getLevelWhere($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"}'";
|
||||
}
|
||||
}
|
||||
return($levelWhere);
|
||||
}
|
||||
|
||||
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{
|
||||
$errorInfo = "Error in omcStrFill:the defLen < lengh of string!!\\ndefLen=$defLen and string=$string!!";
|
||||
echo "<script language='javascript'>";
|
||||
|
||||
echo "window.alert(\"$errorInfo\");";
|
||||
echo "history.go(-1)";
|
||||
echo "</script>";
|
||||
exit();
|
||||
|
||||
echo "<br>Error in omcStrFill : the defLen < lengh of string!!";
|
||||
echo "<br>defLen=$defLen and string=$string!!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
89
wxc2_omc/account/sub_inc/sub_english.inc
Executable file
89
wxc2_omc/account/sub_inc/sub_english.inc
Executable file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
$strCallISDN ="Caller number";
|
||||
$strBeginTime ="Start time";
|
||||
$strCalledISDN ="Called number";
|
||||
$strConverseTime ="Duration(s)";
|
||||
$strEndTime ="End time";
|
||||
$strCallerE1Slot ="Caller E1/CH#";
|
||||
$strCalledE1Slot ="Called E1/CH#";
|
||||
$strCallerTrunkGroup ="Caller TG";
|
||||
$strDate ="Date";
|
||||
$strDescription ="Description";
|
||||
$strDisplayRecords ="Records";
|
||||
$strIncomingTrunkGroup ="Incoming TG";
|
||||
$strOutgoingTrunkGroup ="Outgoing TG";
|
||||
$strCauseTerm ="Cause for term";
|
||||
$strServiceType ="Service type";
|
||||
$strSeizureTime ="Seizure";
|
||||
$strAnswerTime ="Answer";
|
||||
$strReleaseTime ="Release";
|
||||
$strHlrInterrogation ="HLR interrogation";
|
||||
$strLocationUpdate ="Location update";
|
||||
$strRecordingEntity ="Recording entity";
|
||||
$strRoutingNumber ="Routing number";
|
||||
$strNumberOfForwarding ="Number of forwarding";
|
||||
$strInterrogationResult ="Result";
|
||||
$strIntTimeStamp ="Int. time";
|
||||
$strOldLocation ="Old location";
|
||||
$strNewLocation ="New location";
|
||||
$strUpdateResult ="Result";
|
||||
$strUpdateTimeStamp ="Update time";
|
||||
$strClassmark ="Classmark";
|
||||
$strFee ="Fee";
|
||||
$strBalance ="Balance";
|
||||
$strLocalCallOut ="Local call-out";
|
||||
$strLocalCallIn ="Local call-in";
|
||||
$strTrunkCallOut ="Trunk call-out";
|
||||
$strNDDCallOut ="NDD call-out";
|
||||
$strHMTCallOut ="HMT call-out";
|
||||
$strIDDCallOut ="IDD call-out";
|
||||
$strTrunkCallIn ="Trunk call-in";
|
||||
$strPeriodicCharge ="Periodic charge";
|
||||
$strIncrementValue ="Increment";
|
||||
$strDecreaseValue ="Decrease";
|
||||
$strRechargeSuccess ="Recharge success";
|
||||
$strRechargeFailure ="Recharge failure";
|
||||
$strTariffNoRecords ="No record found for tariff ID ";
|
||||
$strTariffDiscountTimeSection ="Time section";
|
||||
$strTotal ="Total";
|
||||
$strNotFindRecord ="No record found!";
|
||||
$strSourceIP ="Source IP";
|
||||
|
||||
//add by lilong
|
||||
$strDescription ="Description";
|
||||
$strTariffRentChargeType ="Charge type";
|
||||
$strTariffRentAccordingToDate ="Every day";
|
||||
$strTariffRentAccordingToPeriod ="Every month";
|
||||
$strBasicTariff ="Basic tariff";
|
||||
$strResideZone ="Tariff ID";
|
||||
$strChargingPrefix ="Prefix";
|
||||
$strCountryDistrict ="Country/District";
|
||||
$strUnitChargingTimeSecond ="Charge unit (s)";
|
||||
$strMinimumChargingUnit ="Min. charge unit";
|
||||
$strBasicFee ="Basic fee";
|
||||
$strBasicLongDistance ="Long distance";
|
||||
$strBasicInitial ="Initial charge adjustment";
|
||||
$strDiscount ="Discount";
|
||||
$strTariffDiscountTimeSection ="Time section";
|
||||
$strSpecialDay ="Holiday";
|
||||
$strReload ="Reload";
|
||||
|
||||
//add by xiehua 2003-04-28
|
||||
$strSMS ="SMS";
|
||||
$strCallForwrd ="Call forward";
|
||||
$strConferenceCall ="Conference call";
|
||||
$strRoaming ="Roaming";
|
||||
$strID ="ID";
|
||||
$strCloseUserGroup ="Closed user group";
|
||||
$strField ="Field";
|
||||
$strValue ="Value";
|
||||
$strCdrMSC ="MSC CDR";
|
||||
$strCdrPPS ="PPS CDR";
|
||||
$strCdrSMSC ="SMSC CDR";
|
||||
$strSupplementary ="Supplementary";
|
||||
$strRechargeCard ="Recharge card";
|
||||
$strFreshCard ="Fresh card";
|
||||
$strUsedCard ="Used card";
|
||||
$strCapitalCharacter ="Capital character";
|
||||
$strParaMustBeAHexNumber ="parameter must be a hexadecimal number";
|
||||
?>
|
||||
Reference in New Issue
Block a user