home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / windowsxp / ftgateoffice / ftgateoffice.exe / Main / ui.fts < prev    next >
Encoding:
Text File  |  2001-11-29  |  5.9 KB  |  248 lines

  1. <%
  2. #include </utility/security.fts>
  3. #include </utility/global.fts>
  4. #include </utility/theme.fts>
  5. #include </utility/ftgate.fts>
  6.  
  7. var s = new server.system
  8.  
  9. var entries
  10. var refresh
  11. var direction=0
  12.  
  13. if (form.config=="1")
  14. {
  15.     refresh = form.refresh
  16.     entries = form.entries
  17. }
  18. else
  19. {
  20.     if (request.entries>0)
  21.     {
  22.         entries = request.entries
  23.         refresh = request.refresh
  24.         direction = request.direction
  25.     }
  26. }
  27.  
  28. if (entries<=0)
  29.     entries=100
  30. %>
  31. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
  32. <HTML>
  33. <HEAD>
  34. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  35. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  36. <TITLE>FTGate Administration</TITLE>
  37. <LINK REL=STYLESHEET HREF="/utility/main<%=nn4%>.css" TYPE="text/css">
  38. <STYLE>
  39.     BODY { margin: 0; padding: 0; border: 0 }
  40.     FORM { margin: 0; padding: 0; border: 0 }
  41. </STYLE>
  42. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/time.js" TYPE="text/javascript"></SCRIPT>
  43. <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
  44. <!--
  45. var dir="<%=buttons%>";
  46. var direction=<%=direction%>;
  47.  
  48. <%
  49. if (netscape)
  50. {
  51.   %>
  52.   document.captureEvents(Event.KEYPRESS);
  53.   document.onkeypress = keypress;
  54.  
  55.   function keypress(event)
  56.   {
  57.     if (event.which==13)
  58.     {
  59.       onEntries();
  60.       return false;
  61.     }
  62.  
  63.     return true;
  64.   }
  65.   <%
  66. }
  67. else
  68. {
  69.   %>
  70.   function keypress()
  71.   {
  72.     if (event.keyCode==13)
  73.     {
  74.       event.returnValue=null;
  75.       onEntries();
  76.     }
  77.   }
  78.   <%
  79. }
  80. %>
  81.  
  82. if (!document.images) {}
  83. else {
  84.   up0 = new Image();
  85.   up0.src  = dir+"up.gif";
  86.   up1 = new Image();
  87.   up1.src = dir+"upon.gif";
  88.   down0 = new Image();
  89.   down0.src  = dir+"down.gif";
  90.   down1 = new Image();
  91.   down1.src = dir+"downon.gif";
  92.   refresh0 = new Image();
  93.   refresh0.src  = dir+"refresh.gif";
  94.   refresh1 = new Image();
  95.   refresh1.src = dir+"refreshon.gif";
  96.   clear0 = new Image();
  97.   clear0.src  = dir+"delete.gif";
  98.   clear1 = new Image();
  99.   clear1.src = dir+"deleteon.gif";
  100. }
  101.  
  102. function change(Name,Image,No)
  103. {
  104.   if (!document.images) {}
  105.   else document [Name].src = eval(Image + No + ".src");
  106. }
  107.  
  108. function resetRadios()
  109. {
  110.     if (direction==1)
  111.     {
  112.         change('upA', 'up', 1);
  113.         change('downA', 'down', 0);
  114.     }
  115.     else
  116.     {
  117.         change('upA', 'up', 0);
  118.         change('downA', 'down', 1);
  119.     }
  120. }
  121.  
  122. function onDirection(dir)
  123. {
  124.     var secs;
  125.  
  126.     if (!isOK())
  127.     {
  128.         resetRadios();
  129.  
  130.         return;
  131.     }
  132.  
  133.     direction=dir;
  134.  
  135.     resetRadios();
  136.  
  137.     secs = fromNicePeriod(document.ftgate.refresh.value);
  138.     parent.log.location.href="log.fts?direction="+direction+
  139.                                                         "&entries="+document.ftgate.entries.value+
  140.                                                         "&refresh="+secs;
  141. }
  142.  
  143. function onEntries()
  144. {
  145.     var secs;
  146.  
  147.     change('refreshA','refresh',0);
  148.  
  149.     if (!isOK())
  150.         return;
  151.  
  152.     secs = fromNicePeriod(document.ftgate.refresh.value);
  153.     parent.log.location.href="log.fts?direction="+direction+
  154.                                                         "&entries="+document.ftgate.entries.value+
  155.                                                         "&refresh="+secs;
  156. }
  157.  
  158. function onClear()
  159. {
  160.     change('clearA','clear',0);
  161.  
  162.     if (!isOK())
  163.         return;
  164.  
  165.     secs = fromNicePeriod(document.ftgate.refresh.value);
  166.     parent.log.location.href="log.fts?direction="+direction+
  167.                                                         "&entries="+document.ftgate.entries.value+
  168.                                                         "&refresh="+secs+
  169.                             "&clear=1";
  170. }
  171.  
  172. function isOK()
  173. {
  174.     var entries = document.ftgate.entries.value;
  175.  
  176.     if (entries<=0)
  177.     {
  178.         alert("Enter a value greater than zero.");
  179.         document.ftgate.entries.focus();
  180.  
  181.         return false;
  182.     }
  183.  
  184.     if (entries>100)
  185.     {
  186.         alert("Enter a value less than or equal to 100.");
  187.         document.ftgate.entries.focus();
  188.  
  189.         return false;
  190.     }
  191.  
  192.   if (!isPeriod(document.ftgate.refresh.value))
  193.     {
  194.         window.alert("Enter a valid time period.");
  195.         document.ftgate.refresh.focus();
  196.         return false;
  197.     }
  198.  
  199.     return true;
  200. }
  201.  
  202. function onLoad()
  203. {
  204.     parent.log.location.href="log.fts?entries=<%=entries%>&direction=<%=direction%>";
  205.     document.ftgate.refresh.value = toNicePeriod(<%=refresh%>);
  206.     document.ftgate.entries.focus();
  207. }
  208.  
  209. //-->
  210. </SCRIPT>
  211. </HEAD>
  212.  
  213. <BODY BGCOLOR="<%=body%>" onLoad="onLoad()" onkeypress="keypress()">
  214. <FORM NAME="ftgate" onSubmit="return isOK()" METHOD="POST" ACTION="">
  215. <INPUT TYPE="HIDDEN" NAME="config" VALUE="1">
  216. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTh="100%">
  217.     <TR>
  218.         <TD WIDTH="1%"><IMG SRC="/images/<%=s.serverid%>1.gif" VSPACE="0" ALT="<%=s.serverid%>" WIDTH="200" HEIGHT="54"></TD>
  219.         <TD VALIGN="CENTER" ALIGN="RIGHT">
  220.             <%
  221.             if (direction==1)
  222.             {
  223.                 %>
  224.                 <A onMouseDown="change('downA', 'down', 1)" onMouseOut="resetRadios()" HREF="javascript:onDirection(0)"><IMG SRC="<%=buttons%>down.gif" WIDTH="20" HEIGHT="20" NAME="downA" BORDER="0" ALT="Oldest first"></A>
  225.                 <A onMouseDown="change('upA', 'up', 1)" onMouseOut="resetRadios()" HREF="javascript:onDirection(1)"><IMG SRC="<%=buttons%>upon.gif" WIDTH="20" HEIGHT="20" NAME="upA" BORDER="0" ALT="Newest first"></A>
  226.                 <%
  227.             }
  228.             else
  229.             {
  230.                 %>
  231.                 <A onMouseDown="change('downA', 'down', 1)" onMouseOut="resetRadios()" HREF="javascript:onDirection(0)"><IMG SRC="<%=buttons%>downon.gif" WIDTH="20" HEIGHT="20" NAME="downA" BORDER="0" ALT="Oldest first"></A>
  232.                 <A onMouseDown="change('upA', 'up', 1)" onMouseOut="resetRadios()" HREF="javascript:onDirection(1)"><IMG SRC="<%=buttons%>up.gif" WIDTH="20" HEIGHT="20" NAME="upA" BORDER="0" ALT="Newest first"></A>
  233.                 <%
  234.             }
  235.             %>
  236.             <A onMouseDown="change('refreshA','refresh',1)" onMouseOut="change('refreshA','refresh',0)" HREF="javascript:onEntries()"><IMG SRC="<%=buttons%>refresh.gif" WIDTH="20" HEIGHT="20" NAME="refreshA" BORDER="0" ALT="Refresh Log"></A>
  237.         </TD>
  238.         <TD VALIGN="CENTER">
  239.              List last <INPUT TYPE="EDIT" NAME="entries" SIZE="<%=size5%>" VALUE="<%=entries%>"> entries.
  240.         </TD>
  241.         <TD VALIGN="CENTER">
  242.             Refresh every <INPUT TYPE="EDIT" NAME="refresh" SIZE="<%=size5%>" VALUE="<%=refresh%>">
  243.     </TD>
  244.     </TR>
  245. </TABLE>
  246. </FORM>
  247. </BODY>
  248. </HTML>