<?php
/*********************************************************      
 程序说明：         
    功能说明：用户信息显示上部页面
              
    调用关系：调用: header.inc    
              被调用:        
 
    变量说明：

    作者：   
      
修改注释：      
NO.1      
姓名：          
时间：
修改说明：
*********************************************************/
require("../../inc/header.inc");
$sysTypeNo=$_REQUEST['sysTypeNo'];
$dataTypeNo=$_REQUEST['dataTypeNo'];
$userNum = 0;

//$helpId="6.4.1";
?>
<script LANGUAGE="JavaScript">

function ignoreSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	temp += splitstring[i];
	return temp;
}

function checkSubmit(actionType,transValue){     
	var baseURL,URL,selSysId;
	switch(actionType){
		case 3: //add
			<?php
			echo "baseURL = \"./subscriberConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
			?>
			break;
		case 4: //import
			<?php
			if($sysTypeNo==390)
				echo "baseURL = \"../pubSubsImport/subscriberImportIndex.php?sysId=$sysId&dataTypeNo=$dataTypeNo&\"; \n";
			else
				echo "baseURL = \"../pubSubsImport/subscriberImportIndex.php?sysId=$sysTypeNo"."_99_99&dataTypeNo=$dataTypeNo&\"; \n";
			?>
			break;

			case 5: //get all
			<?php
			if($sysTypeNo==330)
			echo "baseURL = \"./hlrGetAll.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
			else
			echo "baseURL = \"./subscriberConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
			?>
			break;

		default:
			alert("Unknown action!");
			return(false);
	}
	selSysId = document.actionForm.sysId.options[document.actionForm.sysId.selectedIndex].value;
	URL		= baseURL+transValue+'&sysId='+selSysId;
	window.parent.main.location = URL;  
}  

function selectSysId(sysTypeNo,dataTypeNo){
	var URL,selSysId;

	selSysId = document.actionForm.sysId.value;
	URL = "./subscriberListDown.php?sysId="+selSysId+"&sysTypeNo="+sysTypeNo+"&dataTypeNo="+dataTypeNo;
	//window.alert(URL);
	window.parent.main.location = URL;
}

</script>

<base target="main">
<body topmargin=16 leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">  

<form name="actionForm" method="POST" action="./subscriberListDown.php" >    
<?php 
adjust_head_frame("up");
adjust_title_head_frame("up");
	echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
	echo "<tr>";
	echo "<td width=\"50%\" align=\"left\">";
	$pagetitle="Advanced > Subscriber ";
	switch($sysTypeNo){
		case '375':
			$pagetitle.="> OPPS";
			$helpId = "2.2.1.8";
			break;

		case '330':
			$pagetitle.="> HLR";
			$helpId = "2.2.1.2";
			break;
		case '361':
			$pagetitle.="> MME";
		    	$helpId = "2.2.1.2"; // ??
		    	break;
	    	case '362':
	        	$pagetitle.="> SPGW";
	       	 	$helpId = "2.2.1.2";
	       		break;
		case '363':
	        	$pagetitle.="> IMS";
	       	 	$helpId = "2.2.1.2";
	       		break;
		case '364':
	        	$pagetitle.="> RCS";
	       	 	$helpId = "2.2.1.2";
	       		break;
		case '365':
	        	$pagetitle.="> UDM";
	       	 	$helpId = "2.2.1.2";
	       		break;
		case '366':
	        	$pagetitle.="> AUSF";
	       	 	$helpId = "2.2.1.2";
	       		break;
		case '325':
			$pagetitle.="> VLR";
			$helpId = "2.2.1.1";
			break;
		case '360':
			if($dataTypeNo == 0){
				$pagetitle.="> PPS";
				$helpId = "2.2.1.3";
			}else{
				$pagetitle="Advanced > Recharge Card > Fresh Card";
				$helpId = "2.2.2";
			}
			break;
		case '395':
			$pagetitle="Advanced > Recharge Card > Fresh Card";
			$helpId = "2.2.2";
			break;
		case '340':
			$pagetitle.="> AUC";
			$helpId = "2.2.1.4";
			break;
		case '380':
			$pagetitle.="> EIR";
			$helpId = "2.2.1.5";
			break;
		case '390':
			$pagetitle.="> VSS";
			$helpId = "2.2.1.6";
			break;
		case '253':
			$helpId = "2.2.1.7";
			break;
		case '370':
			$pagetitle.="> MNP";
			$helpId = "2.2.1.7";
			break;
		case '378':
			$pagetitle.="> iPALIM";
      $helpId = "2.2.1.9";
			break;
		default:
			echo "Unknown sysTypeNo:$sysTypeNo";
			exit(1);
	}
	
	echo "$pagetitle";
	echo "</td>";
	echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
	showHelp($helpId);
	echo "</td>";
	echo "</tr>";
	echo "</table>";
?>
<table border="0" width="100%"  cellpadding="1" cellspacing="0"  bordercolor="#666666" bordercolordark="#FFFFFF">      
  <tr>      
    <td>
	<nobr>
    <?php
	switch($sysTypeNo){
		case '375':
			$sysTypeName='OPPS';
			//echo "MSISDN";
			//echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">";
			
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"msisdn\" selected>MSISDN</option>";
			echo "<option value=\"imsi\">IMSI</option>";
			echo "<option value=\"imei\">IMEI</option>";
			echo "</select>";
			
			break;
		case '330':
			$sysTypeName='HLR';
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"inter_msisdn\" selected>MSISDN</option>";
			echo "<option value=\"imsi\">IMSI</option>";
			echo "</select>";
			break;
		case '361':
		    $sysTypeName='MME';
		    echo "<select size=\"1\" name=\"selKeyFieldName\" >";
		    echo "<option value=\"imsi\">IMSI</option>";
		    echo "</select>";
		    break;
		case '362':
		        $sysTypeName='SPGW';
		        echo "<select size=\"1\" name=\"selKeyFieldName\" >";
		        echo "<option value=\"imsi\">IMSI</option>";
		        echo "</select>";
		        break;
		case '363':
		        $sysTypeName='IMS';
		        echo "<select size=\"1\" name=\"selKeyFieldName\" >";
		        echo "<option value=\"MSISDN\">MSISDN</option>";
		        echo "</select>";
		        break;
		case '364':
			$sysTypeName='RCS';
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"imsi\">IMSI</option>";
			echo "</select>";
			break;
		case '365':
			$sysTypeName='UDM';
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"supi\">SUPI</option>";
			echo "</select>";
			break;
		case '366':
			$sysTypeName='AUSF';
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"imsi\">IMSI</option>";
			echo "</select>";
			break;
		case '378':
			$sysTypeName='iPALIM';
			echo "IMSI";
			echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"imsi\">";
			break;
		case '325':
			$sysTypeName='VLR';
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"MSISDN\" selected>MSISDN</option>";
			echo "<option value=\"IMSI\">IMSI</option>";
			echo "</select>";
			break;
		case '360':
			$sysTypeName='PPS';
			if($dataTypeNo == 0){				
				echo "MSISDN";
				echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
			}else{
				echo "Card no.";
				echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"card_no\">"; 
			}
			break;
		case '395':
			$sysTypeName='RCM';
			echo "Card no.";
			echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"card_no\">"; 
			break;
		case '340':
			$sysTypeName='AUC';
			echo "IMSI";
			echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"key_imsi\">"; 
			break;
		case '380':
			$sysTypeName='EIR';
			echo "IMEI";
			echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"imei\">"; 
			break;
		case '390':
			$sysTypeName=$strVMSOrVSS;
			echo "MSISDN";
			echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
			break;
		case '253':
			$sysTypeName='SN';
			echo "<select size=\"1\" name=\"selKeyFieldName\" >";
			echo "<option value=\"msisdn\" selected>MSISDN</option>";
			echo "<option value=\"imsi\">IMSI</option>";
			echo "</select> ";
			break;
		case '370':
			$sysTypeName='MNP';
			echo "MSISDN";
			echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
		break;
		default:
			echo "Uknown sysTypeNo:$sysTypeNo";
			exit(1);
	}
	?>
	<input type="text" name="selKeyValue" class="text" size="20" onBlur="this.value=ignoreSpaces(this.value);" >&nbsp;&nbsp;
	</nobr>
	</td>
	<td>	
	<nobr>
		<div onClick="javascript:document.actionForm.submit();" style="cursor:hand">
			<IMG align=absBottom border=0 src="../../images/search.gif" >&nbsp;<?php echo "$strSearch"; ?>
		</div>
	</nobr>
	</td>
	<td width="40%">
		&nbsp;
	</td>
	<td width="10%"><nobr>
<?php
	if($sysTypeNo==390){
		echo "Select System:";
		echo "<select name=\"sysId\" size=\"1\" onChange=\"javascript:selectSysId($sysTypeNo,$dataTypeNo)\">";
		echo "<option value=\"{$sysTypeNo}_0_0\">{$sysTypeName}_0_0</option>";
		echo "<option value=\"{$sysTypeNo}_1_0\">{$sysTypeName}_1_0</option>";
		echo "<option value=\"{$sysTypeNo}_2_0\">{$sysTypeName}_2_0</option>";
		echo "<option value=\"{$sysTypeNo}_3_0\">{$sysTypeName}_3_0</option>";
		echo "<option value=\"{$sysTypeNo}_4_0\">{$sysTypeName}_4_0</option>";
		echo "<option value=\"{$sysTypeNo}_5_0\">{$sysTypeName}_5_0</option>";
		echo "<option value=\"{$sysTypeNo}_6_0\">{$sysTypeName}_6_0</option>";
		echo "<option value=\"{$sysTypeNo}_7_0\">{$sysTypeName}_7_0</option>";
		echo "<option value=\"{$sysTypeNo}_8_0\">{$sysTypeName}_8_0</option>";
		echo "<option value=\"{$sysTypeNo}_9_0\">{$sysTypeName}_9_0</option>";		
		echo "</select>";
	}
	else if($sysTypeNo == 365 || $sysTypeNo == 366)
	{
                echo "Select System:";
                echo "<select name=\"sysId\" size=\"1\" onChange=\"javascript:selectSysId($sysTypeNo,$dataTypeNo)\">";
                echo "<option value=\"{$sysTypeNo}_0_0\">{$sysTypeName}_0_0</option>";
                echo "<option value=\"{$sysTypeNo}_1_0\">{$sysTypeName}_1_0</option>";
                echo "<option value=\"{$sysTypeNo}_2_0\">{$sysTypeName}_2_0</option>";
                echo "<option value=\"{$sysTypeNo}_3_0\">{$sysTypeName}_3_0</option>";
                echo "<option value=\"{$sysTypeNo}_4_0\">{$sysTypeName}_4_0</option>";
                echo "<option value=\"{$sysTypeNo}_5_0\">{$sysTypeName}_5_0</option>";
                echo "<option value=\"{$sysTypeNo}_6_0\">{$sysTypeName}_6_0</option>";
                echo "<option value=\"{$sysTypeNo}_7_0\">{$sysTypeName}_7_0</option>";
                echo "<option value=\"{$sysTypeNo}_8_0\">{$sysTypeName}_8_0</option>";
                echo "<option value=\"{$sysTypeNo}_9_0\">{$sysTypeName}_9_0</option>";
                echo "<option value=\"{$sysTypeNo}_10_0\">{$sysTypeName}_10_0</option>";
                echo "<option value=\"{$sysTypeNo}_11_0\">{$sysTypeName}_11_0</option>";
                echo "</select>";
	}
	else
	{
		echo "Select System:";
		echo "<select name=\"sysId\" size=\"1\" onChange=\"javascript:selectSysId($sysTypeNo,$dataTypeNo)\">";
		echo "<option value=\"{$sysTypeNo}_0_0\">{$sysTypeName}_0_0</option>";
		echo "<option value=\"{$sysTypeNo}_1_0\">{$sysTypeName}_1_0</option>";
		echo "</select>";
	}
?>	

<?php
if($sysTypeNo==390)
	$strGetAll='Get';
?>
	</nobr></td>
	<td width="10%">
		&nbsp;
	</td>
	<td align="right">
	  	<div style="cursor:hand" onClick=checkSubmit(5,"isLoadIndex=1")>
		<nobr>
			<IMG align=absBottom border=0 src="../../images/reload.gif"><?php echo "$strGetAll" ?>
		</nobr>
		</div>
	</td>
	<?php
	if ($sysTypeNo != 325){
		if($dataTypeNo != 1){
			echo "<td align=\"right\">";
			echo "<div style=\"cursor:hand\" onClick=checkSubmit(3,\"isTryCreate=1\")><nobr>";
			echo "<IMG align=absBottom border=0 src=\"../../images/add.gif\">$strAdd";
			echo "&nbsp;&nbsp;</nobr></div></td>";
		}
		echo "<td align=\"right\">";
		echo "<div style=\"cursor:hand\" onClick=checkSubmit(4,\"isTryImport=1\")><nobr>";
		echo "<IMG align=absBottom border=0 src=\"../../images/import_1.gif\">$strImport";
		echo "</nobr></div></td>";
	}
	?>
	  <!--
	<td align="right">
	 <input Name="isShowStat" type="button" DISABLED value="Statistics" title="Show subscriber data's statistics">&nbsp; 
	<input Name="isLoadIndex" type="button" value="Reload" onClick=checkSubmit(5,"isLoadIndex=1") title="Load all subscriber's data from server" class="button">&nbsp; 
	<input Name="isCreate" type="button" value="Create" onClick=checkSubmit(3,"isTryCreate=1") title="Create a new subscriber" class="button">&nbsp; 
	<input Name="isImport" type="button" value="Import" onClick=checkSubmit(4,"isTryImport=1") title="Import subscriber file to server" class="button">
	</td>
	  -->  
  </tr>  
</table>
<?php
echo "<input Name=\"sysTypeNo\" type=\"hidden\" value=\"$sysTypeNo\">";
echo "<input Name=\"dataTypeNo\" type=\"hidden\" value=\"$dataTypeNo\">";
?>
</form> 
<?php
adjust_title_tail_frame("up");
adjust_content_head_frame("up");
adjust_content_tail_frame("up");
?>
</body>    
</html>
