<?
session_start();
$selelag = $HTTP_SESSION_VARS["SelLanguage"];
if (empty($selelag)) header("location:../break.php");
require("../config/".$selelag);
require("../_ConnectString.php");
require("../_function.php");
require("../_image.php");

if ((isset($HTTP_SESSION_VARS["LoginID_Sess"])) && (isset($HTTP_SESSION_VARS["OperateRole_Sess"])) && (isset($HTTP_SESSION_VARS["GroupNo_Sess"]))){
	if(strlen($HTTP_SERVER_VARS["QUERY_STRING"])>0){
		$Status  = $HTTP_GET_VARS["Status"];
		$digital = $HTTP_GET_VARS["digital"];
	}else{
		$Status  = $HTTP_POST_VARS["Status"];
		$digital = $HTTP_POST_VARS["digital"];
	}
}else {
	include("../no_privilege.php");
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<title>P2P Search</title>
<link href="../Display/display.css" type="text/css" rel="stylesheet">
<SCRIPT language="JavaScript" src="../inc/calendar.js"></SCRIPT>
<Script language="JavaScript" src="../inc/fun.js"></Script>
<script language="JavaScript">
	function P2PQuery(){
		fn_DateTime_New();
		if (document.frm.digital.value == 'digital') document.frm.target = "Edit";
		else document.frm.target = "mainFrame";
		document.frm.action = "../p2p/p2p.php";
		document.frm.submit();
	}

	function open_ip_window(){
	var strFeatures = "dialogWidth:320px;dialogHeight:150px;status:off;help:no";
	window.showModalDialog("../_ip_list.php",window,strFeatures);
}
</script>
</head>
<body>
<form name="frm" method="post" action="" target="">
<input type="hidden" name="digital" value="<?echo $digital;?>">
<input type="hidden" name="Status" value="<?echo $Status;?>">
<input type="hidden" name="QUERY_IP_1" value="">
<input type="hidden" name="BACKUP_TYPE" value="P2P">
<input type="hidden" name="QUERY_START_DATETIME" value="<?echo $QUERY_START_DATETIME;?>">
<input type="hidden" name="QUERY_END_DATETIME" value="<?echo $QUERY_END_DATETIME;?>">
<table height="100%" width="100%" cellSpacing="0" cellPadding="0" border="0" align="center"  style="border-collapse: collapse">

<tr><td align="center" valign="middle">
<table class="OpTb" align="center" width="92%" cellSpacing="0" cellPadding="2" >
  <tr class="Op_Tr" >
    <td colspan="2" align="center">
	  <img src="../Display/image/search.gif"> <span title="<?echo $SEARCH_P2P_TITLE;?>"> <?echo $SEARCH_P2P_TITLE_SHOW;?></span>
	</td>
  </tr>

    <tr height="30">
	<td width="30%" align="right" ><span title="<?echo $SEARCH_P2P_DATE;?>"><?echo $SEARCH_P2P_DATE_SHOW;?></span> : </td>
	<td>
	  <input type=text size="8" name="QUERY_STARTDATE" value="<?$Y=date("Y");$M=date("m"); echo $Y."-".$M."-01"?>"><a href="javascript:show_calendar('frm.QUERY_STARTDATE');"><img src="../<?echo $DIR_IMAGE.$SEARCH_P2PP_CALENDAR;?>" style="border: 0px solid;"></a>
	  ~ 
	  <input type=text size="8" name="QUERY_ENDDATE" value="<? echo date("Y-m-d")?>"><a href="javascript:show_calendar('frm.QUERY_ENDDATE');"><img src="../<?echo $DIR_IMAGE.$SEARCH_P2PP_CALENDAR;?>" style="border: 0px solid;"></a>
	</td>
  </tr>

  <tr height="30">
    <td align="right" ><span title="<?echo $SEARCH_P2P_TIME;?>"><?echo $SEARCH_P2P_TIME_SHOW;?></span> : </td>
	<td>
	  <select name="QUERY_STARTHOUR" style="font-family:Arial, Helvetica, sans-serif;font-size:x-small ">
        <?echo fn_H($QUERY_STARTHOUR);?>
      </select> :
	  <select name="QUERY_STARTMINUTE" style="font-family:Arial, Helvetica, sans-serif;font-size:x-small ">
	    <?echo fn_M($QUERY_STARTMINUTE);?>
	  </select>~
	  <select name="QUERY_ENDHOUR" style="font-family:Arial, Helvetica, sans-serif;font-size:x-small ">
	   <?echo fn_H($QUERY_ENDHOUR);?>
	  </select> :
	  <select name="QUERY_ENDMINUTE" style="font-family:Arial, Helvetica, sans-serif;font-size:x-small ">
	    <?echo fn_M($QUERY_ENDMINUTE);?>
	  </select>
	</td>
  </tr>

  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_IP;?>"><?echo $SEARCH_P2P_IP_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_IP" value=""><a href="javascript:open_ip_window();"><span title="<?echo $SEARCH_MORE;?>">&nbsp;<?echo $SEARCH_MORE_SHOW;?>...</span></a></td>
  </tr>

 <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_PORT;?>"><?echo $SEARCH_P2P_PORT_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_PORT" value=""></td>
  </tr>

  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_PIP;?>"><?echo $SEARCH_P2P_PIP_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_PIP" value=""></td>
  </tr>

   <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_PPORT;?>"><?echo $SEARCH_P2P_PPORT_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_PPORT" value=""></td>
  </tr>

  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_Tool?>"><?echo $SEARCH_P2P_Tool_SHOW?></span> :</td>
	<td><input type="text" size="33" name="QUERY_TOOL" value=""></td>
  </tr>

  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_FILENAME?>"><?echo $SEARCH_P2P_FILENAME_SHOW?></span> :</td>
	<td><input type="text" size="33" name="QUERY_NAME" value=""></td>
  </tr>

 <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_DIR;?>"><?echo $SEARCH_FTP_DIR_SHOW;?></span> :</td>
	<td>
	  <select id="QUERY_DIR" name="QUERY_DIR" size="1">
		<option value=""></option>
		<option value="1"><?echo $P2P_UPLOAD;?></option>
	    <option value="0"><?echo $P2P_DOWNLOAD;?></option>
	  </select>
	</td>
 </tr>
  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_P2P_ID;?>"><?echo $SEARCH_P2P_ID_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_ID" value=""></td>
 </tr>
  <tr height="30">
	<td colspan="2" align="center"><input name="Query" type="button" onClick="P2PQuery();" value="Submit" title="<?echo $SEARCH_COMMON_SUBMIT;?>">
	</td>
  </tr>
</table>
</td></tr></table>
</form>
</body>
</html>