<?
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/_telnet.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_TELNET_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 TELNETQuery(){
	var msg = "";
	fn_DateTime_New()
	if (document.frm.digital.value == 'digital') document.frm.target = "Edit";
	else document.frm.target = "mainFrame";	
	document.frm.submit();
}
function open_ip_window(){
	var strFeatures = "dialogWidth:320px;dialogHeight:150px;status:off;help:no";
	window.showModalDialog("../_ip_list.php",window,strFeatures);
}

function Backup(){
	fn_DateTime_New();
	document.frm.target='';
	document.frm.action = "../query_backup/query_backup.php";
	document.frm.submit();
}

</script>
</head>
<body>
<form name="frm" method="post" action="../telnet/telnet.php" target="">
<input type="hidden" name="QUERY_IP_1" value="">
<input type="hidden" name="digital" value="<?echo $digital;?>">
<input type="hidden" name="Status" value="<?echo $Status;?>">
<input type="hidden" name="QUERY_START_DATETIME" value="<?echo $QUERY_START_DATETIME;?>">
<input type="hidden" name="QUERY_END_DATETIME" value="<?echo $QUERY_END_DATETIME;?>">
<input type="hidden" name="BACKUP_TYPE" value="TELNET">
<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="../<?echo $DIR_IMAGE.$TELNETP_SEARCH;?>"> <span title="<?echo $SEARCH_TELNET_TITLE;?>"><?echo $SEARCH_TELNET_TITLE_SHOW;?></span>
	</td>
  </tr>
  <tr height="30">
	<td width="30%" align="right" ><span title="<?echo $SEARCH_TELNET_DATE;?>"><?echo $SEARCH_TELNET_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_TELNETP_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_TELNETP_CALENDAR;?>" style="border: 0px solid;"></a>
	</td>
  </tr>
  <tr height="30">
    <td align="right" ><span title="<?echo $SEARCH_TELNET_TIME;?>"><?echo $SEARCH_TELNET_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_TELNET_IP;?>"><?echo $SEARCH_TELNET_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>
  <? if (fn_ad()){?>
  <tr>
	<td align="right" ><span title="<?echo $SEARCH_TELNET_ACCOUNT;?>"><?echo $SEARCH_TELNET_ACCOUNT_SHOW;?> :</span></td>
	<td><input type="text" size="40" name="QUERY_ACCOUNT" value=""></td>
  </tr>
  <?}?>

  <tr>
	<td align="right" ><span title="<?echo $SEARCH_TELNET_ID;?>"><?echo $SEARCH_TELNET_ID_SHOW;?>:</span></td>
	<td><input type="text" size="40" name="QUERY_ID" value=""></td>
  </tr>
  <tr height="30">
	<td colspan="2" align="center">
	<input name="Query" type="button" onClick="TELNETQuery();" value="<?echo $SEARCH_TELNET_SUBMIT_SHOW;?>" title="<?echo $SEARCH_TELNET_SUBMIT;?>">
	<? if (fn_three()){?>
			&nbsp;&nbsp;&nbsp;<input type="button" onClick="Backup();" value="BackUp" title="<?echo $SEARCH_CHAT_BACKUP;?>">
	 <?}?>			
</td>
  </tr>
</table>
</td></tr></table>
</form>
</body>
</html>