"; global $OMC_server; $canwrite_flag=checkWritePrivilege(); $sysId = $_REQUEST['sysId']; $table_id = $_REQUEST['table_id']; $table_level = $_REQUEST['table_level']; $instanceNo = $_REQUEST['instanceNo']; $need_get_again = $_REQUEST['need_get_again']; $getTableOid = $_REQUEST['getTableOid']; $sysIdArr=explode('_',$sysId); $sysTypeNo=$sysIdArr[0]; $sysNo=$sysIdArr[1]; $subSysNo=$sysIdArr[2]; $objDb='OBJ_'.$sysTypeNo; $paraConfTable=$objDb.'.paramConf'; $pubDb='OMC_PUB'; $objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $objDb); if(checkIndependSystem($sysTypeNo))//Plat $paraTable=$objDb.".param_".$sysNo; else $paraTable=$objDb.".param_99"; $tabConf=GetTabConf($sysTypeNo); $tableOid=$tabConf[$table_id][OID]; $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(0) { echo "
";
	print_r($tabConf);
	echo "
"; } if($need_get_again) { echo "need_get_again=$need_get_again
"; $commIdStr=oidSysCommSend($sysId,0,$getTableOid,-1,$instanceNo); echo "\n"; } if($_SERVER['REQUEST_METHOD'] == "POST") { echo "
"; $set = $_REQUEST['set']; $get = $_REQUEST['get']; $lock = $_REQUEST['lock']; $unlock = $_REQUEST['unlock']; $adminStatOid = $_REQUEST['adminStatOid']; if($set) { $commIdStr=oidSysCommSend($sysId,3,$getTableOid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo&need_get_again=1&get=1&getTableOid=$getTableOid"); } else if($get) { //Get the timeslot parameter from the plat(trunk group id) $timeslot_table_oid=GetOIDByName(SYSTYPENO_MSC,"channelEntry"); if($sysTypeNo == SYSTYPENO_MSC && $getTableOid == $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,$getTableOid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); } else { $commIdStr=oidSysCommSend($sysId,0,$getTableOid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&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(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $updateSql.="and subSysNo='$subSysNo' "; mysqli_query($objConn,$updateSql); $commIdStr=oidSysCommSend($sysId,3,$adminStatOid,-1,$instanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); } } echo "
"; //Get the sub oid of the table $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($objConn,$sql); $num=@mysqli_num_rows($res); $scalarTableIndex=0; $columnTableIndex=0; $scalarItemIndex=0; for($i=0;$i<$num;$i++) { $row=@mysqli_fetch_array($res); if($row[$lastlevel] == 0) { //scalar table if($row[maxAccess] == ACCESS_TABLE_NAME && $row[operType] == 2) { $scalarTable[$scalarTableIndex][Name]=adjustTableName($row[name_2]); $scalarTable[$scalarTableIndex][OID]=getOIDByRow($row); $scalarTableIndex++; } //column table else if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) { $columnTable[$columnTableIndex][Name]=adjustTableName($row[name_2]); $columnTable[$columnTableIndex][OID]=getOIDByRow($row); if(strstr($row[desc_2],"Name:")) { $new_name=explode("Name:",$row[desc_2]); $columnTable[$columnTableIndex][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); } $columnTableIndex++; } //scalar item else { $scalarItem[$scalarItemIndex][Name]=adjustTableName($row[name_2]); $scalarItem[$scalarItemIndex][OID]=getOIDByRow($row); $scalarItem[$scalarItemIndex][MaxAccess]=$row[maxAccess]+0; $scalarItem[$scalarItemIndex][Style]=$row[operType]+0; $scalarItem[$scalarItemIndex][ValueType]=$row[valueType]+0; $scalarItem[$scalarItemIndex][MinValue]=$row[minValue]+0; $scalarItem[$scalarItemIndex][MaxValue]=$row[maxValue]+0; $scalarItem[$scalarItemIndex][Template]=$row[setTemplate_2]; $scalarItem[$scalarItemIndex][Tip]=$row[note_2]; $scalarItem[$scalarItemIndex][Desc]=$row['desc_2']; if(strstr($row['desc_2'],"Name:")) { $new_name=explode("Name:",$row['desc_2']); $scalarItem[$scalarItemIndex][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); } $scalarItemIndex++; } } } if(0) { echo "
";
	print_r($columnTable);
	echo "
"; } for($i=0;$i<$columnTableIndex;$i++) { //echo "{$columnTable[$i][Name]} {$columnTable[$i][OID]}
"; $oidwhere=getLevelWhere($columnTable[$i][OID]); $size=sizeof(explode(".",$columnTable[$i][OID])); $oidwhere.=" AND level_".($size+1)."=1 "; $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($objConn,$sql); $num=@mysqli_num_rows($res); $tableObject[$i][FieldCount]=$num; $tableObject[$i][EntriesCount]=0; $tableObject[$i][DeleteOID]=-1; for($j=0;$j<$num;$j++) { $row=@mysqli_fetch_array($res); $tableObject[$i][$j][RawName]=$row[name_2]; $tableObject[$i][$j][Name]=getShowNameOfField($row[name_2],-1); $tableObject[$i][$j][MaxAccess]=$row[maxAccess]; $tableObject[$i][$j][Style]=$row[operType]; $tableObject[$i][$j][ValueType]=$row[valueType]; $tableObject[$i][$j][MinValue]=$row[minValue]; $tableObject[$i][$j][MaxValue]=$row[maxValue]; $tableObject[$i][$j][Template]=$row[setTemplate_2]; $tableObject[$i][$j][Desc]=$row[desc_2]; $tableObject[$i][$j][Tip]=$row[note_2]; $tableObject[$i][$j][OID]=getOIDByRow($row); if(strstr($tableObject[$i][$j][Desc],"Key Parameter")) $tableObject[$i][$j][KeyFlag]=1; else $tableObject[$i][$j][KeyFlag]=0; if(strstr($tableObject[$i][$j][Name],"Entry") && $tableObject[$i][$j][MaxAccess] == ACCESS_ENTRY) { $tableObject[$i][$j][Name]=getShowNameOfTable($row[name_2],-1); $tableObject[$i][EntryIndex]=$j; } else if(strstr($tableObject[$i][$j][Name],"Entries")) { $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][RawName]=$tableObject[$i][$j][RawName]; $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][Name]=$tableObject[$i][$j][Name]; $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][OID]=$tableObject[$i][$j][OID]; $tableObject[$i][EntriesCount]++; } if(strstr($tableObject[$i][$j][RawName],"RowStatus")) { $tableObject[$i][$j][Name]="Delete"; if($tableObject[$i][$j][KeyFlag] == 0) $tableObject[$i][DeleteOID]=-1; else $tableObject[$i][DeleteOID]=$tableObject[$i][$j][OID]; } if(strstr($tableObject[$i][$j][RawName],"Index")) $tableObject[$i][IndexIndex]=$j; if(strstr($tableObject[$i][$j][Desc],"Name:")) { $new_name=explode("Name:",$tableObject[$i][$j][Desc]); $tableObject[$i][$j][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); } //echo "$i $j {$tableObject[$i][$j][Name]} {$tableObject[$i][$j][OID]}
"; } //Table level if(strstr($tableObject[$i][$tableObject[$i][EntryIndex]][Desc],"level")) { $tmp=explode("level:",$tableObject[$i][$tableObject[$i][EntryIndex]][Desc]); $tableObject[$i][TableLevel]=$tmp[1]+0; } else { $tableObject[$i][TableLevel]=1; } } $thisTableIndex=-1; for($i=0;$i<$columnTableIndex;$i++) { if($tableObject[$i][TableLevel] == $table_level) $thisTableIndex=$i; //Create index $tableObject[$i][CreateOID]=-1; if($tableObject[$i][TableLevel] == 1) { for($j=0;$j<$tableObject[$i][FieldCount];$j++) { if(strstr($tableObject[$i][$j][Name],"Index")) { if($tableObject[$i][$j][MaxAccess] == ACCESS_INDEX_CREATE_SPE) $tableObject[$i][CreateOID]=$tableObject[$i][$j][OID]; break; } } } else { $lastCreateLabel="CreateEntry".str_replace("Entry","",$tableObject[$i][$tableObject[$i][EntryIndex]][RawName]); $lastEntriesLabel=str_replace("Entry","",$tableObject[$i][$tableObject[$i][EntryIndex]][RawName])."Entries"; $lastLevel=$tableObject[$i][TableLevel]-1; for($j=0;$j<$columnTableIndex;$j++) { if($tableObject[$j][TableLevel] == $lastLevel) break; } if($j != $columnTableIndex) { for($z=0;$z<$tableObject[$j][FieldCount];$z++) { if(stristr($tableObject[$j][$z][RawName],$lastCreateLabel)) { $tableObject[$i][CreateOID]=$tableObject[$j][$z][OID]; break; } } for($z=0;$z<$tableObject[$j][EntriesCount];$z++) { if(stristr($tableObject[$j][Entries][$z][RawName],$lastEntriesLabel)) { $tableObject[$i][CreateDeleteRelateOID]=$tableObject[$j][Entries][$z][OID]; break; } } } else { echo "Some table hasn't configure the level
"; exit(); } } } if($columnTableIndex > 0) { if(0) { echo "
";
		print_r($tableObject);
		echo "
"; } if($thisTableIndex == -1) { exit("thisTableIndex error"); } $thisTableConf=$tableObject[$thisTableIndex]; if(0) { echo "
";
		print_r($thisTableConf);
		echo "
"; } $realcreate = $_REQUEST['realcreate']; $createIndex = $_REQUEST['createIndex']; $create = $_REQUEST['create']; $createOid = $_REQUEST['createOid']; $updateOid = $_REQUEST['updateOid']; $indexOid = $_REQUEST['indexOid']; $oldtableOid = $_REQUEST['oldtableOid']; if($realcreate) { //echo "sysId=$sysId,table_id=$table_id,table_level=$table_level,instanceNo=$instanceNo
"; //echo "createIndex=$createIndex,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
"; $oldInstanceNo=$instanceNo; if($table_level == 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',instanceNo='$createInstanceNo'"; if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) $sql.=",subSysNo='$subSysNo' "; $indexOidArr=explode(".",$createOid); for($i=0;$i"; mysqli_query($objConn,$sql); //send create command $commIdStr=oidSysCommSend($sysId,9,$createOid,-1,$createInstanceNo); checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$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($pubConn,$indexSql); $indexrow=@mysqli_fetch_array($indexres); $newIndex=$indexrow[readValue]+0; $newInstanceNo=omc_keep_length($newIndex,'0',4); if($table_level == 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&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); } //get the table if($oldInstanceNo=="0000" && $table_level == 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&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); } $oidwhere=getLevelWhere($thisTableConf[$thisTableConf[EntryIndex]][OID]); $sql="select * from $paraTable where $oidwhere and instanceNo='$instanceNo' "; //echo "$sql
"; $res=@mysqli_query($objConn,$sql); $num=@mysqli_num_rows($res); for($i=0;$i<$num;$i++) { $row=@mysqli_fetch_array($res); $oid=getOIDByRow($row); $fieldIndex=sizeof(explode(".",$oid)); $fieldPos=$row["level_".$fieldIndex]+0; $recordData[$fieldPos]=$row[initValue]; } if(0) { echo "
";
		print_r($recordData);
		echo "
"; } echo "
"; if($create) showNavigateTitle($table_id,$table_level,$sysId,$columnTable,$instanceNo,"create"); else showNavigateTitle($table_id,$table_level,$sysId,$columnTable,$instanceNo,"edit"); 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($objConn,$createsql); $createnum=@mysqli_num_rows($createres); 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) { echo ""; echo ""; echo ""; echo "
Index is assigned by $module_name
"; echo ""; } else { $tmpwhere=getLevelWhere($indexOid); 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($objConn,$sql); 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(); } echo "

"; echo ""; for($i=0;$i<$thisTableConf[FieldCount];$i++) { if($thisTableConf[$i][MaxAccess] == ACCESS_ENTRY) continue; if($thisTableConf[$i][Name] == "Delete") continue; if(strstr($thisTableConf[$i][RawName],"CreateEntry")) continue; $tmp=explode(".",$thisTableConf[$i][OID]); $ni=$tmp[sizeof($tmp)-1]+0; echo ""; echo ""; if(strstr($thisTableConf[$i][RawName],"Entries")) { $nextLevel=$table_level+1; echo ""; } else if(strstr($thisTableConf[$i][Desc],"RelationPoint")) { $tmp1=strstr($thisTableConf[$i][Desc],"RelationPoint:"); $tmp2=explode(";",$tmp1); $tmp3=explode("RelationPoint:",$tmp2[0]); $rTableOid=$tmp3[1]; $showvalue=$recordData[$ni]; echo ""; } else if($thisTableConf[$i][MaxAccess] == ACCESS_READ_ONLY) { $showValue=translateValueToOpt($thisTableConf[$i][Style],$thisTableConf[$i][ValueType],$thisTableConf[$i][Template],$recordData[$ni]); echo ""; } else if($thisTableConf[$i][ValueType] == VALUE_OPAQUE) { echo ""; } else { echo ""; } echo ""; } echo "
"; echo $thisTableConf[$i][Name]; echo "{$recordData[$ni]}"; 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($objConn,$rsql); $rnum=mysqli_num_rows($rres); //echo "$rsql"; 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"; } } echo "{$showValue}"; if(stristr($thisTableConf[$i][RawName],"NITZ")) { $mscTable="OBJ_320.param_99"; $levels=getLevelWhere($thisTableConf[$i][OID]); $sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; $res=mysqli_query($objConn,$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,$thisTableConf[$i][OID],$instanceNo); } echo ""; showParameterAdv($sysId,$thisTableConf[$i][OID],$instanceNo); echo "
"; //lock and unlock button for($i=0;$i<$thisTableConf[FieldCount];$i++) { if(strstr($thisTableConf[$i][RawName],"AdministrationState") ) { if($canwrite_flag) echo ""; else echo ""; echo "  "; if($canwrite_flag) echo ""; else echo ""; echo "  "; echo ""; break; } } echo ""; echo "  "; if($canwrite_flag) echo ""; else echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo "

"; adjust_content_tail("down"); ?>