$sysTypeNo_0 = "111";
if($thisOmcType==10){
$sysTypeNo_1 = "251";
}else{
$sysTypeNo_1 = "322";
}
$db_0 = "OBJ_".$sysTypeNo_0;
$db_1 = "OBJ_".$sysTypeNo_1;
$tb_0 = "param_0";
$tb_1 = "param_1";
$tb_2 = "param_99";
$temTb = ${tb_.$sNum};
$subSysNo = floor($pNum/8);
if($DEBUG)echo "
subSysNo=$subSysNo";
$portNo = $pNum%8;
if($DEBUG)echo "
portNo=$portNo";
$tgTypeArr=array(
array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'subscriber', 'color' => '#0000FF'),
array('num' => '4', 'remark' => '--', 'color' => '#0000FF')
);
$netTypeArr=array(
array('num' => '0', 'remark' => 'International', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'International spare', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'National ', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'National spare', 'color' => '#0000FF'),
array('num' => '4', 'remark' => '--', 'color' => '#0000FF')
);
$cirTypeArr=array(
array('num' => '0', 'remark' => 'clockwise', 'color' => '#FF0000'),
array('num' => '1', 'remark' => 'anti-clockwise', 'color' => '#0000FF'),
array('num' => '2', 'remark' => 'odd', 'color' => '#0000FF'),
array('num' => '3', 'remark' => 'even', 'color' => '#0000FF'),
array('num' => '4', 'remark' => '--', 'color' => '#0000FF')
);
$pageCellTypeArr=array(
array('num' => '0', 'remark' => '--'),
array('num' => '1', 'remark' => '--'),
array('num' => '2', 'remark' => '--'),
array('num' => '3', 'remark' => '--'),
array('num' => '4', 'remark' => '--'),
array('num' => '5', 'remark' => 'by LAC'),
array('num' => '6', 'remark' => 'in All Cell')
);
//Attributes of TG
$oidTg = "2.2.6";
$pTg = explode(".",$oidTg);
$i = 0;
$wTg = '';
while(isset($pTg[$i]))
{
$lNum = $i+1;
if($DEBUG) echo "
pTg[$i]=$pTg[$i]";
$wTg = $wTg." AND level_$lNum = $pTg[$i] ";
$i++;
}
/************get default value**************/
$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg;
$defRes = @mysqli_query($pubConn,$defSql);
$defRow = @mysqli_fetch_array($defRes);
$defaultValue = $defRow[initValue];
//echo "
defaultValue=$defaultValue";
if($set || $add)
{
$field_0 = omc_keep_length(DecHex(BinDec($cellFlag)),0,2);
if($DEBUG)echo "
field_0=$field_0";
$field_1 = omc_keep_length(DecHex($tgNum),0,2);
if($DEBUG)echo "
field_1=$field_1";
if($add){
$cellFlag = 1;
}
$field_2 = omc_keep_length(DecHex($lacNum),0,4);
if($DEBUG)echo "
field_2=$field_2";
$field_3 = omc_keep_length(DecHex($cellType),0,2);
if($DEBUG)echo "
field_3=$field_3";
$initValue = $field_0.$field_1.$field_2.$field_3;
$initValue = strtoupper($initValue);
if($DEBUG)echo "
initValue=$initValue";
$uTgSql = " UPDATE $tb_2 set initValue = '$initValue' WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg;
if($DEBUG)echo "
uTgSql=$uTgSql";
$uTgRes = @mysqli_query($pubConn,$uTgSql);
echo mysqli_error($pubConn);
echo "";
}
/************select value to see************/
//Attributes of TG
$tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg." ORDER BY instanceNo ";
if($DEBUG) echo "
tgSql=$tgSql";
$tgRes = @mysqli_query($pubConn,$tgSql);
$tgRow = @mysqli_fetch_array($tgRes);
echo mysqli_error($pubConn);
$wDef = " AND (";
do
{
$instanceNo = $tgRow[instanceNo];
$initValue = $tgRow[initValue];
if($DEBUG) echo "
initValue=$initValue";
if($initValue == $defaultValue){
$tgShow[$instanceNo] = 0;
}else{
$tgShow[$instanceNo] = 1;
$wDef = $wDef." instanceNo = $instanceNo OR ";
}
//echo "
tgShow[$instanceNo]=$tgShow[$instanceNo]";
$hex_0 = substr($initValue,0,2);
if($DEBUG)echo "
hex_0=$hex_0";
$bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8);
if($DEBUG)echo "
bin_0=$bin_0";
$cellFlag = $cellArr[$instanceNo][0] = substr($bin_0,7,1);
if($DEBUG)echo "
cellFlag=$cellFlag";
$tgNum = $cellArr[$instanceNo][1] = HexDec(substr($initValue,2,2));
if($DEBUG)echo "
tgNum=$tgNum";
$hLac = substr($initValue,4,2);
$lLac = substr($initValue,6,2);
$lacNum = $hLac.$lLac;
$lacNum = $cellArr[$instanceNo][2] = HexDec($lacNum);
if($DEBUG)echo "
lacNum=$lacNum";
$cellType = substr($initValue,8,2);
$cellType = $cellArr[$instanceNo][3] = HexDec($cellType);
if($DEBUG)echo "
cellType=$cellType";
}while($tgRow = @mysqli_fetch_array($tgRes));
echo "