<?php
/**
*@Purpose:	
*		1. Search header.
*		2. "Previous" and "next" button.
*		3. total CDRs statistics.
*File name: cdrHeader.php
*Author: Li Long
*Create: No20040316-1
*Modifications:
*No.1
*Name:Cui Ticun
*Date:2004-5-27
*Description:Support SMLog
*/
//=============================================================================
require("../../inc/header.inc");
//echo "helpId=$helpId, serverName=$serverName,sysId=$sysId<br>";

?>
<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;
}
</script>
<?php 
$DEBUG=0;
$sysId = $_REQUEST['sysId'];
$cdrType= $_REQUEST['cdrType'];
$serverName = $_REQUEST['serverName'];

if($DEBUG)	echo "sysId=$sysId,cdrType=$cdrType, serverName=$serverName, <br>";

if(isset($sysId)){
	$sysIdArr=explode('_',$sysId);
	$sysTypeNo	=$sysIdArr[0];
	$sysNo		=$sysIdArr[1];
	$subSysNo	=$sysIdArr[2];
}else{
	echo "Cannot find sysId";
	exit(0);
}
//echo "helpId=$helpId, serverName=$serverName,sysId=$sysId<br>";
?>
<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 method="POST" action="cdrDown.php?serverName=<?php echo "$serverName"; ?>&&sysId=<?php echo "$sysId"; ?>&&cdrType=<?php echo "$cdrType"; ?>" name="selectform" onsubmit="">          

<?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\">";

/********************changed for SMLog by Cui Ticun start**************************/
		if(18==$cdrType) echo "$strLog > $serverName > $strSent ";
		elseif(19==$cdrType) echo "$strLog > $serverName > $strDiscarded ";
		elseif(20==$cdrType) echo "$strLog > $serverName > $strPending ";
		elseif($serverName=="OPR") echo "$strLog > IMDM";
		else echo "$strLog > $serverName ";		
/********************changed for SMLog by Cui Ticun end**************************/		

echo "</td>";
echo "<td align=\"right\" title=\"Help\">";
 
			if($sysId != 330 && $sysId != 325 && $sysId != 351)
				showHelp($helpId); 
			
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\">";
switch($sysTypeNo){
			case '386':
				echo "Node Name";
				echo "<input type=\"hidden\" name=\"queryField\" value=\"nodeName\"> ";
				break;
			case '375':
				echo "MSISDN";
				echo "<input type=\"hidden\" name=\"queryField\" value=\"msisdn\"> ";
				break;
			case '380':
				echo "<select size=\"1\" name=\"eirType\" >";
				echo "<option value=\"imsi\">IMSI</option>";
				echo "<option value=\"imei\">IMEI</option>";
				echo "</select>&nbsp;&nbsp;";
				//echo "IMSI";
				echo "<input type=\"hidden\" name=\"queryField\" value=\"servedIMSI\"> ";
				break;
			case '270':	//CNF
			case '351':	//SMLOG
			case '360':	//PPS
				echo "<select size=\"1\" name=\"queryField\" >";
				echo "<option value=\"callingNumber\">Caller number</option>";
				echo "<option value=\"calledNumber\">Called number</option>";
				echo "</select>";
				break;
			case '320':	//MSC
				echo "<select size=\"1\" name=\"mscType\" >";
				echo "<option value=\"call_sm\">Call&SM</option>";
				echo "<option value=\"call\">Call</option>";
				echo "<option value=\"sm\">SM</option>";
				echo "</select>&nbsp;&nbsp;";
				
				echo "<select size=\"1\" name=\"queryField\" >";
				echo "<option value=\"callingNumber\">Caller number</option>";
				echo "<option value=\"calledNumber\">Called number</option>";
				//echo "<option value=\"serviceCentre\">Service centre</option>";
				echo "</select>";
				break;
				case '400': // SGSN
					echo "IMSI";
					echo "<input type=\"hidden\" name=\"queryField\" value=\"imsiDigit\"> ";
					break;
			case '325':	//VLR
			case '330': // HLR
			case '350': // SMSC
				echo "MSISDN";
				echo "<input type=\"hidden\" name=\"queryField\" value=\"servedMSISDN\"> ";
				break;

			default:
				break;
}
?>
&nbsp;<input type="text" name="keyWord" size="20" style="font-family: Verdana; font-size: 8pt">&nbsp;&nbsp;
<span onClick="javascript:document.selectform.submit();" style="cursor:hand">
	<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
</span>
<?php	

echo "</td>";
echo "<td align=\"right\">";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail_frame("up");
adjust_content_head_frame("up");
adjust_content_tail_frame("up");
?>

</FORM> 
</BODY>
