home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / full / atlantic / Software / Teweb / data1.cab / Pages / scripts / schedule.asp < prev    next >
Encoding:
Text File  |  2000-02-14  |  7.9 KB  |  264 lines

  1. <%@ LANGUAGE="VBSCRIPT" %>
  2. <%    Set clsTes = Session("TES")
  3.     If clsTes.LoggedIn = False Then
  4.         Set clsTes = Nothing
  5.         Response.Redirect("../loggedout.htm")
  6.     End If
  7.  
  8.     dToDoDate = Request("ToDoDate")
  9.     tResource = Request("Resource")
  10.  
  11.     If Len(dToDoDate)=0 Then
  12.       dToDoDate = clsTes.ADbl(clsTes.ScheduleDate)
  13.     Else
  14.       clsTes.ScheduleDate = clsTes.ADbl(dToDoDate)
  15.     End If
  16.  
  17.     If Len(tResource) = 0 Then
  18.       tResource = clsTes.Resource
  19.     Else
  20.         If clsTes.ViewResource(tResource,3) Then
  21.             clsTes.Resource = tResource
  22.         Else
  23.             tResource = clsTes.Resource
  24.         End If
  25.     End If
  26.  
  27.  
  28. %>
  29. <!-- #INCLUDE FILE = "settings/colours.txt" -->    
  30. <HTML>
  31. <HEAD>
  32. <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
  33. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  34. <TITLE>Schedule</TITLE>
  35. </HEAD>
  36. <BODY BGCOLOR="<%= BackColor %>" LINK="<%= ScheduleColor %>" VLINK="<%= ScheduleColor %>" ALINK="<%= ScheduleColor %>" TEXT="<%= TextColor %>">
  37. <BASEFONT SIZE=2 COLOR="<%= TextColor %>">
  38.  
  39. <table border=0 width=100%>
  40. <tr>
  41.     <td align=left valign=top nowrap=nowrap>
  42.         <table border=0 cellspacing=1 cellpadding=1>
  43.         <tr>
  44.             <td align=left width = 75>
  45.             <b><%= Server.HTMLEncode(clsTes.ResourceLabel) %>:</b>
  46.             </td>
  47.             <td align=left width = 175>
  48. <%            If clsTes.ScheduleViewResAccess <> 3 Then    'US_OWN %>
  49.                 <a href="pickitem.asp?Type=Resource&<% Response.Write("ReturnURL=" & Server.URLEncode("schedule.asp")) %>">
  50. <%            End If %>
  51.  
  52. <%            If len(tResource) > 0 Then
  53.                 Response.Write(Server.HTMLEncode(tResource))
  54.             Else %>
  55.                 Please Select
  56. <%            End If %>
  57.             </td>
  58.  
  59. <%            If clsTes.ScheduleViewResAccess <> 3 Then    'US_OWN %>
  60.                 </a>
  61. <%            End If %>
  62.  
  63.         </tr>
  64.         </table>
  65.     </td>
  66.  
  67.     <td align=right valign=top>
  68. <%        tURL = "schedule.asp?ToDoDate=" %>
  69.         <table border=0 cellspacing=1 cellpadding=1>
  70.         <tr>
  71.             <td align=center NOWRAP=NOWRAP>
  72.                 <A HREF="calendar.asp?ReturnURL=<%= Server.URLEncode("schedule.asp") %>&Name=ToDoDate&Date=<%= dToDoDate %>">
  73.                 <b><% Response.Write(clsTes.FormatDate(dToDoDate)) %></b> 
  74.                 </A>
  75.             </td>
  76.             <td width=10></td>
  77.             <td align=center width=25>
  78.                 <a href=<% Response.Write(tURL & CStr(dToDoDate - 28)) %>>
  79.                 <img border=0 align=center src="../images/bck4w.gif" ALT="Back 4 Weeks">
  80.                 </a>
  81.             </td>
  82.             <td align=center width=25>
  83.                 <a href=<% Response.Write(tURL & CStr(dToDoDate - 7)) %>>
  84.                 <img border=0 align=center src="../images/bck1w.gif" ALT="Back 1 Week">
  85.                 </a>
  86.             </td>
  87.             <td align=center width=25>
  88.                 <a href=<% Response.Write(tURL & CStr(dToDoDate + 7)) %>>
  89.                 <img border=0 align=center src="../images/fwd1w.gif" ALT="Forward 1 Week">
  90.                 </a>
  91.             </td>
  92.             <td align=center width=25>
  93.                 <a href=<% Response.Write(tURL & CStr(dToDoDate + 28)) %>>
  94.                 <img border=0 align=center src="../images/fwd4w.gif" ALT="Forward 4 Weeks">
  95.                 </a>
  96.             </td>
  97.         </tr>
  98.         </table>
  99.     </td>
  100. </tr>
  101. </table>
  102.  
  103. <table width=100% border=0 cellspacing=1 cellpadding=1>
  104. <tr>
  105.     <td align=left valign=top bgcolor="<%= CellTitleColor %>" colspan=8>
  106.         <font color = "<%= CellTitleTextColor %>">
  107.         <b><%= Server.HTMLEncode(clsTes.ProjectLabel) %></b>
  108.         </font>
  109.     </td>
  110.     <td align=left valign=top bgcolor="<%= CellTitleColor %>" colspan=8>
  111.         <font color = "<%= CellTitleTextColor %>">
  112.         <b><%= Server.HTMLEncode(clsTes.ActivityLabel) %></b>
  113.         </font>
  114.     </td>
  115.     <td align=left valign=bottom bgcolor="<%= CellTitleColor %>" colspan=7 rowspan=2 width=15%>
  116.         <font color = "<%= CellTitleTextColor %>">
  117.         <b><%= WeekDayName(WeekDay(clsTes.ADate(dToDoDate)), True) %><BR><%= clsTes.FormatDate(dToDoDate) %></b>
  118.         </font>
  119.     </td>
  120.     <td align=left valign=bottom bgcolor="<%= CellTitleColor %>" colspan=7 rowspan=2 width=15%>
  121.         <font color = "<%= CellTitleTextColor %>">
  122.         <b><%= WeekDayName(WeekDay(clsTes.ADate(dToDoDate)), True) %><BR><%= clsTes.FormatDate(dToDoDate+7) %></b>
  123.         </font>
  124.     </td>
  125.     <td align=left valign=bottom bgcolor="<%= CellTitleColor %>" colspan=7 rowspan=2 width=15%>
  126.         <font color = "<%= CellTitleTextColor %>">
  127.         <b><%= WeekDayName(WeekDay(clsTes.ADate(dToDoDate)), True) %><BR><%= clsTes.FormatDate(dToDoDate+14) %></b>
  128.         </font>
  129.     </td>
  130.     <td align=left valign=bottom bgcolor="<%= CellTitleColor %>" colspan=7 rowspan=2 width=15%>
  131.         <font color = "<%= CellTitleTextColor %>">
  132.         <b><%= WeekDayName(WeekDay(clsTes.ADate(dToDoDate)), True) %><BR><%= clsTes.FormatDate(dToDoDate+21) %></b>
  133.         </font>
  134.     </td>
  135. </tr>
  136.  
  137. <tr>
  138.     <td align=left valign=top bgcolor="<%= CellTitleColor %>" colspan = 14>
  139.         <font color = "<%= CellTitleTextColor %>">
  140.         <b>Description</b>
  141.         </font>
  142.     </td>
  143.     <td align=right valign=bottom bgcolor="<%= CellTitleColor %>">
  144.         <font color = "<%= CellTitleTextColor %>">
  145.         <b>Days</b>
  146.         </font>        
  147.     </td>
  148.     <td align=right valign=bottom bgcolor="<%= CellTitleColor %>">
  149.         <font color = "<%= CellTitleTextColor %>">
  150.         <b>Load</b>
  151.         </font>        
  152.     </td>
  153. </tr>
  154.  
  155. <%
  156.     Dim lRowCount
  157.     Dim lRow
  158.     Dim nColumn
  159.  
  160.     Dim tProj
  161.     Dim tAct
  162.  
  163.     lRowCount = clsTes.GenerateSchedule
  164.  
  165.     If clsTes.ErrorNumber <> 0 Then
  166.  
  167.         Response.Write (Server.HTMLEncode(clsTes.ErrorText))
  168.  
  169.     Else
  170.  
  171.         If lRowCount > 0 Then
  172.             For lRow = 1 To lRowCount %>
  173.  
  174.         <tr>
  175. <%            If tProj <> clsTes.GridValue(lRow,0) or tAct <> clsTes.GridValue(lRow,1) Then %>
  176.  
  177.             <td align=left valign=middle bgcolor="<%= CellColor %>" colspan=8>
  178.                 <FONT SIZE=-1>
  179.                 <B><%= Server.HTMLEncode(clsTes.GridValue(lRow, 0)) %></B>
  180.                 </FONT>
  181.             </td>            
  182.             <td align=left valign=middle bgcolor="<%= CellColor %>" colspan=8>
  183.                 <FONT SIZE=-1>
  184.                 <% If IsNull(clsTes.GridValue(lRow,1)) Then %>
  185.                      
  186.                 <% Else %>
  187.                     <B><%= Server.HTMLEncode(clsTes.GridValue(lRow, 1)) %></B>
  188.                 <% End If %>
  189.                 </FONT>
  190.             </td>
  191.  
  192. <%            For nColumn = 0 to 27
  193.                 If Abs(clsTes.GridValue(lRow,nColumn+5)) = 2 Then %>
  194.                     <td bgcolor="<%= NonWorkingDayColor %>" valign=middle align=center>
  195.                     <a href="todo.asp?ToDoDate=<%= CStr(dToDoDate + nColumn) %>"><img border=0 src="../images/trans.gif"></a>
  196.                     </td>
  197. <%                ElseIf Abs(clsTes.GridValue(lRow,nColumn+5)) = 3 Then %>
  198.                     <td bgcolor="<%= WeekendDayColor %>" valign=middle align=center>
  199.                     <a href="todo.asp?ToDoDate=<%= CStr(dToDoDate + nColumn) %>"><img border=0 src="../images/trans.gif"></a>
  200.                     </td>
  201. <%                Else %>
  202.                     <td bgcolor="<%= StandardDayColor %>" valign=middle align=center>
  203.                     <a href="todo.asp?ToDoDate=<%= CStr(dToDoDate + nColumn) %>"><img border=0 src="../images/trans.gif"></a>
  204.                     </td>
  205. <%                End If %>
  206. <%            Next %>
  207.             </tr>
  208.  
  209.             <tr>
  210.  
  211. <%            End If %>
  212.  
  213.             <td align=left valign=middle bgcolor="<%= CellColor %>" colspan=14 nowrap=nowrap>
  214.                 <FONT SIZE=-1>
  215.                  
  216. <%                If Not IsNull(clstes.GridValue(lRow,2)) Then
  217.                     Response.Write(Server.HTMLEncode(clsTes.GridValue(lRow, 2)))
  218.                 End If %>
  219.                 </FONT>
  220.             </td>
  221.                 
  222.  
  223.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  224.                 <FONT SIZE=-1>
  225.                 <%= clsTes.GridValue(lRow, 3) %>
  226.                 </FONT>
  227.             </td>            
  228.  
  229.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  230.                 <FONT SIZE=-1>
  231.                 <%= clsTes.GridValue(lRow, 4) %>
  232.                 </FONT>
  233.             </td>            
  234.  
  235. <%            For nColumn = 0 to 27
  236.                 If clsTes.GridValue(lRow,nColumn+5) > 0 Then %>
  237.                     <td bgcolor="<%= ScheduleColor %>" valign=middle align=center>
  238.                     <font color = "<%= ScheduleColor %>">
  239.                     <a href="tbviewres.asp?Key=<%= clstes.GridValue(lRow,34) %>&ReturnURL=<%= Server.URLEncode("schedule.asp") %>">#</a>
  240.                     </font>
  241.                     </td>
  242. <%                ElseIf clsTes.GridValue(lRow,nColumn+5) = -2 Then
  243.                     'Non Working Day %>
  244.                     <td bgcolor="<%= NonWorkingDayColor %>"> </td>
  245. <%                ElseIf clsTes.GridValue(lRow,nColumn+5) = -3 Then
  246.                     'Weekend %>
  247.                     <td bgcolor="<%= WeekendDayColor %>"> </td>
  248. <%                Else %>
  249.                     <td bgcolor="<%= StandardDayColor %>"> </td>
  250. <%                End If
  251.             Next %>
  252.  
  253. <%            tProj = clsTes.GridValue(lRow,0)
  254.             tAct = clsTes.GridValue(lRow,1) %>
  255.         </tr>
  256.  
  257. <%            Next
  258.  
  259.         End If
  260.     End If %>
  261.  
  262. </BODY>
  263. </HTML>
  264. <%    Set clsTes = Nothing %>