"; //***** $url_temp=$_SERVER["REQUEST_URI"]; //echo "This page URL:$url_temp
"; if (!isset($batch_num)) $batch_num=$_REQUEST['batch_num']; if (!isset($needBatch)) $needBatch=$_REQUEST['needBatch']; if (!isset($create)) $create=$_REQUEST['create']; if (!isset($sysId)) $sysId=$_REQUEST['sysId']; if (!isset($table_id)) $table_id=$_REQUEST['table_id']; if (!isset($sub_table_id)) $sub_table_id=$_REQUEST['sub_table_id']; if (!isset($instanceNo)) $instanceNo=$_REQUEST['instanceNo']; if (!isset($createOid)) $createOid=$_REQUEST['createOid']; if (!isset($updateOid)) $updateOid=$_REQUEST['updateOid']; if (!isset($oldtableOid)) $oldtableOid=$_REQUEST['oldtableOid']; if (!isset($table_level)) $table_level=$_REQUEST['table_level']; if (!isset($createIndex)) $createIndex=$_REQUEST['createIndex']; //***** //$url_temp=$_SERVER["REQUEST_URI"]; //echo "This page URL:$url_temp
"; if(0) { echo "sysId=$sysId
"; echo "table_id=$table_id
"; echo "sub_table_id=$sub_table_id
"; echo "table_level=$table_level
"; echo "instanceNo=$instanceNo
"; } echo "
"; echo ""; echo ""; $realcreate = $_REQUEST['realcreate']; $createMethod = $_REQUEST['createMethod']; $createIndex = $_REQUEST['createIndex']; $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$objDb); $sysIdArr=explode('_',$sysId); $sysTypeNo=$sysIdArr[0]; $sysNo=$sysIdArr[1]; $subSysNo=$sysIdArr[2]; $objDb='OBJ_'.$sysTypeNo; $paraConfTable=$objDb.'.paramConf'; $pubDb='OMC_PUB'; if(checkIndependSystem($sysTypeNo))//Plat $paraTable=$objDb.".param_".$sysNo; else $paraTable=$objDb.".param_99"; $tabConf=GetTabConf($sysTypeNo); $tableOid=$tabConf[$table_id][OID]; $subTabConf=GetSubTabConf($sysTypeNo,$tableOid); $singleTabConf=$subTabConf[ColumnTable][$sub_table_id]; $singleTabInfo=GetSingleTableInfo($singleTabConf,$sysTypeNo); $sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' "; $res=@mysqli_query($pubConn,$sql); $row=@mysqli_fetch_array($res); //print_r($row); $module_name=$row[sysTypeName]; if(0) { echo "
";
	print_r($singleTabInfo);
	echo "
"; } //Get the columnTable conf $oidwhere=getLevelWhere($tableOid); $size=sizeof(explode(".",$tableOid)); $oidwhere.=" AND level_".($size+1).">0 "; $lastlevel="level_".($size+2); $sql="select * from $paraConfTable where $oidwhere 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($objDbConn,$sql); $num=@mysqli_num_rows($res); $scalarTableIndex=0; $columnTableIndex=0; $scalarItemIndex=0; $scalarItemReadCount=0; for($i=0;$i<$num;$i++) { $row=@mysqli_fetch_array($res); if($row[$lastlevel] == 0) { if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) { $columnTable[$columnTableIndex][Name]=adjustTableName($row[name_2]); $columnTable[$columnTableIndex][OID]=getOIDByRow($row); $columnTable[$columnTableIndex][ShowName]=$columnTable[$columnTableIndex][Name]; if(strstr($row[desc_2],"Name:")) { $new_name=explode("Name:",$row[desc_2]); $columnTable[$columnTableIndex][ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); } $columnTableIndex++; } } } if(0) { echo "
";
	print_r($columnTable);
	echo "
"; } if((($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) && $subTabConf[SubMenuCount] > 0) || ($subTabConf[ButtonCount] == 0 && $subTabConf[ScalarParamDisplayCount] == 0 && $subTabConf[SubMenuCount] > 1)) { if($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) { if($sub_table_id == 999) echo ""; else echo ""; echo " {$subTabConf[ShowName]} "; echo ""; } for($i=0;$i<$subTabConf[ColumnTableCount];$i++) { if($subTabConf[ColumnTable][$i][SubMenuFlag] == 1) { if($i == $sub_table_id) echo ""; else echo ""; echo " {$subTabConf[ColumnTable][$i][ShowName]} "; echo ""; } } echo "
"; } //************************* Operation ******************************* if($_SERVER['REQUEST_METHOD'] == "POST") { echo "
"; $DEBUG = 0; $get = $_REQUEST['get']; $set = $_REQUEST['set']; $lock = $_REQUEST['lock']; $unlock = $_REQUEST['unlock']; $podUpdateToPod = $_REQUEST['podUpdateToPod']; if($_REQUEST['get']) { //Get the timeslot parameter from the plat(trunk group id) $timeslot_table_oid=GetOIDByName(SYSTYPENO_MSC,"channelEntry"); if($sysTypeNo == SYSTYPENO_MSC && $singleTabInfo[TableEntryOID] == $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,$singleTabInfo[TableEntryOID],-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); } else { $commIdStr=oidSysCommSend($sysId,0,$singleTabInfo[TableEntryOID],-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); } } else if($_REQUEST['set']) { $commIdStr=oidSysCommSend($sysId,3,$singleTabInfo[TableEntryOID],-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo&need_get_again=1&get=1&getTableOid=$getTableOid"); } else if($_REQUEST['lock'] || $_REQUEST['unlock']) { $adminStatOid = $_REQUEST['adminStatOid']; //echo $adminStatOid; $tmpWhere=getLevelWhere($adminStatOid); if($_REQUEST['lock']) $initValue=0; else $initValue=1; $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo='{$instanceNo}' "; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $updateSql.="and subSysNo='$subSysNo' "; mysqli_query($objDbConn,$updateSql); //echo "oidSysCommSend($sysId,3,$adminStatOid,-1,$instanceNo)"; $commIdStr=oidSysCommSend($sysId,3,$adminStatOid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); } else if($_REQUEST['podUpdateToPod']) { $tmpWhere=getLevelWhere($podUpdateToPodOid); //if($lock) $initValue=1; //else // $initValue=1; $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo='{$instanceNo}' "; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $updateSql.="and subSysNo='$subSysNo' "; mysqli_query($objDbConn,$updateSql); $commIdStr=oidSysCommSend($sysId,3,$podUpdateToPodOid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); } else if($_REQUEST['buttonOptFlag']) { //echo "button_oid=$button_oid,button_value=$button_value
"; $tmpWhere=getLevelWhere($button_oid); $initValue=$button_value; $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo='{$instanceNo}' "; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $updateSql.="and subSysNo='$subSysNo' "; mysqli_query($objDbConn,$updateSql); $commIdStr=oidSysCommSend($sysId,3,$button_oid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); } } //Oper batch add if($needBatch){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $oldInstanceNo=$instanceNo; for($k=0;$k<$batch_num;$k++) { usleep(200000); // 0.2 sec if($singleTabInfo[TableLevel] == 1) { $createInstanceNo=omc_keep_length($createIndex,'0',4); $instanceNo=$createInstanceNo; } else { $createInstanceNo=$instanceNo.".".omc_keep_length($createIndex,'0',4); $instanceNo=$createInstanceNo; } if($createMethod == AUTO_CREATE) $createIndex=1; $sql="replace into $paraTable set initValue='$createIndex',readValue='',instanceNo='$createInstanceNo'"; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $sql.=",subSysNo='$subSysNo' "; $indexOidArr=explode(".",$createOid); for($i=0;$i"; mysqli_query($objDbConn,$sql); mysqli_error($objDbConn); //send create command $commIdStr=oidSysCommSend($sysId,9,$createOid,-1,$createInstanceNo); if($createMethod == AUTO_CREATE) { $indexLevelWhere=getLevelWhere($createOid); $indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' "; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $indexSql.="and subSysNo='$subSysNo' "; $indexres=@mysqli_query($objDbConn,$indexSql); $indexrow=@mysqli_fetch_array($indexres); $newIndex=$indexrow[readValue]+0; $newInstanceNo=omc_keep_length($newIndex,'0',4); if($singleTabInfo[TableLevel] == 1) $instanceNo=$newInstanceNo; else $instanceNo=$oldInstanceNo.".".$newInstanceNo; //echo "oldInstanceNo=$oldInstanceNo,newIndex=$newIndex,instanceNo=$instanceNo
"; } //update the entries if(trim($updateOid)!="") { $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$oldInstanceNo); } //get the table if($oldInstanceNo=="0000" && $singleTabInfo[TableLevel] == 1) { $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,""); } else{ $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,$oldInstanceNo); } } //send table Get Button echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; ?> "; //echo "createIndex=$createIndex,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
"; $oldInstanceNo=$instanceNo; if($singleTabInfo[TableLevel] == 1) { $createInstanceNo=omc_keep_length($createIndex,'0',4); $instanceNo=$createInstanceNo; } else { $createInstanceNo=$instanceNo.".".omc_keep_length($createIndex,'0',4); $instanceNo=$createInstanceNo; } if($createMethod == AUTO_CREATE) $createIndex=1; $sql="replace into $paraTable set initValue='$createIndex',readValue='',instanceNo='$createInstanceNo'"; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $sql.=",subSysNo='$subSysNo' "; $indexOidArr=explode(".",$createOid); for($i=0;$i"; mysqli_query($objDbConn,$sql); mysqli_error($objDbConn); //send create command $commIdStr=oidSysCommSend($sysId,9,$createOid,-1,$createInstanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); if($createMethod == AUTO_CREATE) { $indexLevelWhere=getLevelWhere($createOid); $indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' "; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $indexSql.="and subSysNo='$subSysNo' "; $indexres=@mysqli_query($objDbConn,$indexSql); $indexrow=@mysqli_fetch_array($indexres); $newIndex=$indexrow[readValue]+0; $newInstanceNo=omc_keep_length($newIndex,'0',4); if($singleTabInfo[TableLevel] == 1) $instanceNo=$newInstanceNo; else $instanceNo=$oldInstanceNo.".".$newInstanceNo; //echo "oldInstanceNo=$oldInstanceNo,newIndex=$newIndex,instanceNo=$instanceNo
"; } //update the entries if(trim($updateOid)!="") { $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$oldInstanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); } //get the table if($oldInstanceNo=="0000" && $singleTabInfo[TableLevel] == 1) $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,""); else $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,$oldInstanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); } //PPS COS table if($sysTypeNo == SYSTYPENO_PPS && $table_id == 1 && $realcreate == 1) { echo "\n\n"; } echo "
"; if($create) showNavigateTitle($table_id,$sub_table_id,$table_level,$sysId,$columnTable,$instanceNo,"create"); else showNavigateTitle($table_id,$sub_table_id,$table_level,$sysId,$columnTable,$instanceNo,"edit"); echo "
"; if(!$create || $_SERVER['REQUEST_METHOD'] == "POST") echo "
"; if($create) { echo "
"; //echo "table_level=$table_level,instanceNo=$instanceNo,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
"; $createwhere=getLevelWhere($createOid); $createsql="select * from $paraConfTable where $createwhere "; $createres=@mysqli_query($objDbConn,$createsql); $createnum=@mysqli_num_rows($createres); //echo "sql=$createsql"; if($createnum == 0) exit("Can not find the create index $createOid"); $createrow=@mysqli_fetch_array($createres); $auto=0; if(strstr($createrow[setTemplate_2],"create=1")) $auto=1; $minValue=$createrow[minValue]+0; $maxValue=$createrow[maxValue]+0; echo "
"; echo ""; echo ""; if($auto) { //MSC-tg-trunk if($createOid=='2.4.1.1.34'){ echo ""; echo ""; echo ""; echo "
Batch Num:
"; echo "  "; }else{ echo "Index is assigned by $module_name"; echo ""; echo ""; echo ""; echo "  "; } } else { //echo "tmpwhere=$indexOid"; $tmpwhere=getLevelWhere($_REQUEST['indexOid']); //echo "instanceNo=$instanceNo"; if($instanceNo != "0000") $sql="select initValue from $paraTable where $tmpwhere and instanceNo like '$instanceNo.%' "; else $sql="select initValue from $paraTable where $tmpwhere "; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $sql.="and subSysNo='$subSysNo' "; //echo "$sql
"; $res=@mysqli_query($objDbConn,$sql); // $test=@mysqli_fetch_array($res); // echo $test; // print_r($test); while($row=@mysqli_fetch_array($res)) $index_use_flags[$row[initValue]+0]=1; echo "Please input the index No."; echo ""; echo ""; echo ""; echo ""; echo ""; if($no_use_count == 0) { echo ""; echo "

"; echo "
"; echo "Note: The table is full"; echo "
"; } else { echo ""; } } exit(); } //************************** Show *********************************** //show the edit table echo ""; for($i=0;$i<$singleTabInfo[ColumnParamCount];$i++) { if($singleTabInfo[ColumnParam][$i][MaxAccess] == ACCESS_ENTRY) continue; if(strstr($singleTabInfo[ColumnParam][$i][RawName],"RowStatus")) continue; if(strstr($singleTabInfo[ColumnParam][$i][RawName],"CreateEntry")) continue; if(strstr($singleTabInfo[ColumnParam][$i][RawName],"Command")) continue; echo ""; echo ""; echo ""; } echo "
"; echo "{$singleTabInfo[ColumnParam][$i][ShowName]}"; echo ""; if($singleTabInfo[ColumnParam][$i][ValueType] == VALUE_OPAQUE) { if(stristr($singleTabInfo[ColumnParam][$i][RawName],"NITZ")) { $mscTable="OBJ_320.param_99"; $levels=getLevelWhere($singleTabInfo[ColumnParam][$i][OID]); $sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; $res=mysqli_query($objDbConn,$sql); $rows=@mysqli_fetch_array($res); $initValue=$rows[initValue]; $readValue=$rows[readValue]; if($initValue == '') $initValue="--"; echo ""; if(strlen($initValue)>8) $showValue=substr($initValue,0,8); if($initValue == $readValue) echo "$showValue"; else echo "$showValue"; echo ""; } else { showParameter($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); } } else if(strstr($singleTabInfo[ColumnParam][$i][Description],"RelationPoint")) { $tmp1=strstr($singleTabInfo[ColumnParam][$i][Description],"RelationPoint:"); $tmp2=explode(";",$tmp1); $tmp3=explode("RelationPoint:",$tmp2[0]); $rTableOid=$tmp3[1]; $showvalue=getParamValue($sysId,$singleTabInfo[ColumnParam][$i][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($objDbConn,$rsql); $rnum=mysqli_num_rows($rres); if($rnum == 0) echo "--"; else { $new_table_level=getTableLevel($rTableOid,$sysTypeNo); $tmp1=explode(".",$rTableOid); $new_table_id=$tmp1[1]-1; //echo "rInstanceNo=$rInstanceNo,rTableOid=$rTableOid,new_table_level=$new_table_level,new_table_id=$new_table_id"; echo "$showvalue"; } } } else if($singleTabInfo[ColumnParam][$i][EntriesFlag] == 1) { $nextLevel=$singleTabInfo[TableLevel]+1; $thisTableName=$singleTabInfo[ColumnParam][$i][RawName]; $tmpnum=strlen($thisTableName); for($tmpi=0;$tmpi<$tmpnum;$tmpi++) { if($thisTableName[$tmpi] < 'a' || $thisTableName[$tmpi] > 'z') break; } $thisTableName=substr($thisTableName,$tmpi); $thisTableName=trim(str_replace("Entries","",$thisTableName)); $thisTableName=getShowNameOfField($thisTableName,-1); $tmpnum=count($columnTable); for($tmpi=0;$tmpi<$tmpnum;$tmpi++) { //echo "+$thisTableName+ +{$columnTable[$tmpi][Name]}+
"; if(strcasecmp($thisTableName,trim($columnTable[$tmpi][Name])) == 0) break; } $new_sub_table_id=$tmpi; //$new_sub_table_id=$sub_table_id+1; $value=getParamValue($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); echo "{$value}"; } else { showParameterAdv($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); } echo "
"; //lock and unlock button for($i=0;$i<$singleTabInfo[ColumnParamCount];$i++) { if(strstr($singleTabInfo[ColumnParam][$i][RawName],"AdministrationState")) { // echo "i'm administrationstate"; if($canwrite_flag) echo ""; else echo ""; echo "  "; if($canwrite_flag) echo ""; else echo ""; echo "  "; echo ""; break; } if(strstr($singleTabInfo[ColumnParam][$i][RawName],"podUpdateToPod")) { echo ""; echo "  "; echo ""; break; } } //other command button button for($i=0;$i<$singleTabInfo[ButtonCount];$i++) { $showName=$singleTabInfo[Button][$i][ShowName]; $value=$singleTabInfo[Button][$i][Value]; $oid=$singleTabInfo[Button][$i][OID]; //echo "
ShowName=$showName,$value,$oid
"; echo "  "; } //get button echo ""; echo "  "; //set button if($singleTabInfo[ColumnParamSetCount] > 0) { if($canwrite_flag) echo ""; else echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; adjust_content_tail("down"); ?>