<?
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");
require("../_read_source/_ftp.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><?echo $SEARCH_FTP_TITLE;?></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 FTPQuery(){
	fn_DateTime_New();
	if (document.frm.digital.value == 'digital') document.frm.target = "Edit";
	else document.frm.target = "mainFrame";
    document.frm.action = "../ftp/ftp.php";
	document.frm.submit();
}

function Backup(){
	fn_DateTime_New();
	document.frm.target='';
	document.frm.action = "../query_backup/query_backup.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="FTP">
<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" class="style1" 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="../<?echo $DIR_IMAGE.$FTPP_SEARCH;?>"> <span title="<?echo $SEARCH_FTP_TITLE;?>"><?echo $SEARCH_FTP_TITLE_SHOW;?></span>
	</td>
  </tr>
  <tr height="30">
	<td width="30%" align="right" ><span title="<?echo $SEARCH_FTP_DATE;?>"><?echo $SEARCH_FTP_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_FTPP_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_FTPP_CALENDAR;?>" style="border: 0px solid;"></a>
	</td>
  </tr>
  <tr height="30">
    <td align="right" ><span title="<?echo $SEARCH_FTP_TIME;?>"><?echo $SEARCH_FTP_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_FTP_IP;?>"><?echo $SEARCH_FTP_IP_SHOW;?></span> :</td>
	<td>
	  <input type="text" size="20" id="QUERY_IP" 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_FTP_USER;?>"><?echo $SEARCH_FTP_USER_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_USER" value=""></td>
  </tr>
  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_FTP_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 $FTP_UPLOAD;?></option>
	    <option value="0"><?echo $FTP_DOWNLOAD;?></option>
	  </select>
	</td>
  </tr>
  <tr height="30" nowrap>
	<td align="right" ><span title="<?echo $SEARCH_FTP_SERVERIP;?>"><?echo $SEARCH_FTP_SERVERIP_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_SITE" value=""></td>
  </tr>
  <tr height="30">
	<td align="right" ><span title="<?echo $SEARCH_FTP_FILENAME;?>"><?echo $SEARCH_FTP_FILENAME_SHOW;?></span> :</td>
	<td><input type="text" size="33" name="QUERY_ORGNAME" value=""></td>
  </tr>
  <? if (fn_ad()){?>
  <tr>
	<td align="right" ><span title="<?echo $SEARCH_FTP_ACCOUNT;?>"><?echo $SEARCH_FTP_ACCOUNT_SHOW;?> :</span></td>
	<td><input type="text" size="40" name="QUERY_ACCOUNT" value=""></td>
  </tr>
  <?}?>

  <tr>
	<td align="right" ><span title="<?echo $SEARCH_FTP_ID;?>"><?echo $SEARCH_FTP_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="FTPQuery();" value="<?echo $SEARCH_FTP_SUBMIT_SHOW;?>" title="<?echo $SEARCH_FTP_SUBMIT;?>">

	</td>
  </tr>
</table>
</td></tr></table>
</form>
</body>
</html>