home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / full / atlantic / Software / Teweb / data1.cab / Pages / scripts / detail.asp < prev    next >
Encoding:
Text File  |  2000-02-14  |  8.8 KB  |  319 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.     tCode = Request("Code")
  8.     tDesc = Request("Desc")
  9.     dDate = Request("Date")
  10.     If Len(dDate) = 0 Then
  11.         dDate = clsTes.ADbl(clsTes.FromDate)
  12.     Else
  13.         dDate = clsTes.ADbl(dDate)
  14.     End If
  15. %>
  16. <!-- #INCLUDE FILE = "settings/colours.txt" -->
  17. <HTML>
  18. <HEAD>
  19. <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
  20. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  21. <TITLE>Timesheet Grid Detail</TITLE>
  22. </HEAD>
  23. <BODY BGCOLOR="<%= BackColor %>" LINK="<%= LinkColor %>" VLINK="<%= VLinkColor %>" ALINK="<%= ALinkColor %>" TEXT="<%= TextColor %>">
  24. <BASEFONT SIZE=2 COLOR="<%= TextColor %>">
  25.  
  26. <% If clsTes.TimesheetViewAccess <> 2 Then    'US_NONE %>
  27.  
  28.  
  29. <table width=800 border=0>
  30. <tr>
  31.     <td align=left valign=top width=50>
  32.         <b>Date:</b>
  33.     </td>
  34.     <td align=left valign=top width=200>
  35. <%        Response.Write(WeekDayName(WeekDay(clsTes.ADate(dDate)), False))
  36.         Response.Write(", ")
  37.         Response.Write(clsTes.FormatDate(dDate)) %>
  38.     </td>
  39.     <td align=left valign=top width=75>
  40.         <b>
  41. <%        If clsTes.GridBy ="Project" Then %>
  42.             <%= Server.HTMLEncode(clsTes.ProjectLabel)     %>:
  43. <%        Else %>
  44.             <%= Server.HTMLEncode(clsTes.ActivityLabel) %>:
  45. <%        End If %>        
  46.         </b>
  47.     </td>
  48.     <td align=left valign=top width=475>
  49. <%        Response.Write(Server.HTMLEncode(tCode))
  50.         Response.Write(", ")
  51.         Response.Write(Server.HTMLEncode(tDesc)) %>
  52.  
  53.     </td>
  54. </tr>
  55. </table>
  56. <table width=100% border=0 cellspacing=1 cellpadding=1>
  57. <tr>
  58.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  59.         <font color = "<%= CellTitleTextColor %>">
  60.         <b><%= Server.HTMLEncode(clsTes.ResourceLabel) %></b>
  61.         </font>
  62.     </td>
  63.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  64.         <font color = "<%= CellTitleTextColor %>">
  65. <%        If clsTes.GridBy ="Project" Then %>
  66.             <b><%= Server.HTMLEncode(clsTes.ActivityLabel) %></b>
  67. <%        Else %>
  68.             <b><%= Server.HTMLEncode(clsTes.ProjectLabel) %></b>
  69. <%        End If %>
  70.     </td>
  71.  
  72.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  73.         <font color = "<%= CellTitleTextColor %>">
  74.         <b><%= Server.HTMLEncode(clsTes.UnitTimeLabelP) %></b>
  75.         </font>
  76.     </td>
  77.  
  78. <%        If clsTes.UserCost = 1 or clsTes.UserCost = 3 Then    %>
  79.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  80.         <font color = "<%= CellTitleTextColor %>">
  81.         <b>Cost</b>
  82.         </font>
  83.     </td>
  84. <%        ElseIf clsTes.UserCost <> 0 Then %>
  85.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  86.         <font color = "<%= CellTitleTextColor %>">
  87.         <b>Total Cost</b>
  88.         </font>
  89.     </td>
  90. <%        End If %>
  91.  
  92. <%        If clsTes.UserCharge = 1 or clsTes.UserCharge = 3 Then %>
  93.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  94.         <font color = "<%= CellTitleTextColor %>">
  95.         <b>Charge</b>
  96.         </font>
  97.     </td>
  98. <%        ElseIf clsTes.UserCharge <> 0 Then %>    
  99.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  100.         <font color = "<%= CellTitleTextColor %>">
  101.         <b>Total Charge</b>
  102.         </font>
  103.     </td>
  104. <%        End If %>
  105.     
  106. <%        If clsTes.UserChargeableTimesheet <> 0 Then    'UT_CHARGEABLE_TS_NONE %>
  107.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  108.         <font color = "<%= CellTitleTextColor %>">
  109.         <b>Chargeable</b>
  110.         </font>
  111.     </td>
  112. <%        End If %>
  113.  
  114. <%        If clsTes.UserOvertime Then %>
  115.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  116.         <font color = "<%= CellTitleTextColor %>">
  117.         <b>Overtime</b>
  118.         </font>
  119.     </td>
  120. <%        End If %>
  121.  
  122. <%        If clsTes.UserApprovedTimesheet Then %>
  123.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  124.         <font color = "<%= CellTitleTextColor %>">
  125.         <b>Approved</b>
  126.         </font>
  127.     </td>
  128. <%        End If %>
  129.  
  130. <%        If clsTes.UserInvoicedTimesheet Then %>
  131.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  132.         <font color = "<%= CellTitleTextColor %>">
  133.         <b>Invoiced</b>
  134.         </font>
  135.     </td>
  136. <%        End If %>
  137.  
  138. <%        If clsTes.UserTimesheetNotes Then %>
  139.     <td align=Left valign=top bgcolor="<%= CellTitleColor %>">
  140.         <font color = "<%= CellTitleTextColor %>">
  141.         <b>Notes</b>
  142.         </font>
  143.     </td>
  144. <%        End If %>
  145.  
  146.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  147.          
  148.     </td>
  149. <%        If clsTes.TimesheetMaintainAccess <> 0 Then %>
  150.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  151.          
  152.     </td>
  153. <%        End If %>
  154. </tr>
  155.  
  156. <%    Dim lRowCount
  157.     Dim lRow
  158.     Dim nColumn
  159.  
  160.     lRowCount = clsTes.GenerateTimesheetDetail(CStr(tCode),clsTes.ADbl(dDate))
  161.  
  162.     If clsTes.ErrorNumber <> 0 Then
  163.         Response.Write (clsTes.ErrorText)
  164.         clsTes.ErrorClear
  165.     End If
  166.  
  167.     If lRowCount > 0 Then
  168.         For lRow = 1 to lRowCount %>
  169.  
  170.         <tr>
  171.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  172.                 <FONT SIZE=-1>
  173.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 4)) %>
  174.                 </FONT>
  175.             </td>
  176.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  177.                 <FONT SIZE=-1>
  178.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 5)) %>
  179.                 </FONT>
  180.             </td>
  181.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  182.                 <FONT SIZE=-1>
  183.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 6)) %>
  184.                 </FONT>
  185.             </td>
  186.  
  187.             <% nColumn = 7 %>
  188.  
  189. <%        If clsTes.UserCost=1 or clsTes.UserCost=3 Then %>
  190.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  191.                 <FONT SIZE=-1>
  192.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 7)) %>
  193.                 <% nColumn = nColumn + 1 %>
  194.                 </FONT>
  195.             </td>
  196. <%        ElseIf clsTes.UserCost <> 0 Then %>
  197.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  198.                 <FONT SIZE=-1>
  199.                 <%= CStr(clsTes.GridValue(lRow, 7)) %>
  200.                 <% nColumn = nColumn + 1 %>
  201.                 </FONT>
  202.             </td>
  203. <%        End If %>
  204.  
  205.  
  206.  
  207.  
  208. <%        If clsTes.UserCharge=1 or clsTes.UserCharge=3 Then %>
  209.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  210.                 <FONT SIZE=-1>
  211.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow,nColumn)) %>
  212.                 <% nColumn = nColumn + 1 %>
  213.                 </FONT>
  214.             </td>
  215. <%        ElseIf clsTes.UserCharge <> 0 Then %>    
  216.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  217.                 <FONT SIZE=-1>
  218.                 <%= CStr(clsTes.GridValue(lRow, nColumn)) %>
  219.                 <% nColumn = nColumn + 1 %>
  220.                 </FONT>
  221.             </td>
  222. <%        End If %>
  223.  
  224.  
  225.  
  226. <%        If clsTes.UserChargeableTimesheet <> 0 Then %>
  227.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  228.                 <FONT SIZE=-1>
  229.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  230.                 <% nColumn = nColumn + 1 %>
  231.                 </FONT>
  232.             </td>
  233. <%        End If %>
  234.  
  235.  
  236. <%        If clsTes.UserOvertime Then %>
  237.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  238.                 <FONT SIZE=-1>
  239.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  240.                 <% nColumn = nColumn + 1 %>
  241.                 </FONT>
  242.             </td>
  243. <%        End If %>
  244.  
  245.  
  246.  
  247. <%        If clsTes.UserApprovedTimesheet Then %>
  248.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  249.                 <FONT SIZE=-1>
  250. <%                If Not IsNull(clsTes.GridValue(lRow, nColumn)) Then %>
  251.                     <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  252.                 <% Else %>
  253.                      
  254. <%                End If %>
  255. <%                nColumn = nColumn + 1 %>
  256.  
  257.                 </FONT>
  258.             </td>
  259. <%        End If %>
  260.  
  261.  
  262.  
  263. <%        If clsTes.UserInvoicedTimesheet Then %>
  264.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  265.                 <FONT SIZE=-1>
  266.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  267.                 <% nColumn = nColumn + 1 %>
  268.                 </FONT>
  269.             </td>
  270. <%        End If %>
  271.  
  272. <%        If clsTes.UserTimesheetNotes Then %>
  273.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  274.                 <FONT SIZE=-1>
  275. <%                If Not IsNull(clsTes.GridValue(lRow, nColumn)) Then %>
  276.                     <%= Server.HTMLEncode(clsTes.GridValue(lRow,nColumn)) %>
  277. <%                Else %>
  278.                      
  279. <%                End If %>
  280.                 <% nColumn = nColumn + 1 %>
  281.                 </FONT>
  282.             </td>
  283. <%        End If %>
  284.  
  285. <%        If clsTes.Maintain(lRow) Then %>
  286.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  287.                 <a href="tsedit.asp?Mode=Amend&Key=<%= clsTes.GridValue(lRow, 0) %>" target=_parent><img border=0 align=center src="../images/amend.gif" alt="Amend Timesheet"></a>
  288.             </td>
  289. <%        Else %>
  290.             <td align=center valign=middle>
  291.                 <a href="tsview.asp?Key=<%= clsTes.GridValue(lRow, 0) %>&ReturnURL=<%= Server.URLEncode("tsgrid.asp") %>" target=_parent><img border=0 align=center src="../images/view.gif" alt="View Timesheet"></a>
  292.             </td>
  293. <%        End If %>
  294.  
  295. <%        If clsTes.TimesheetMaintainAccess <> 0 Then 
  296.             If clsTes.Maintain(lRow) Then %>
  297.                 <td align=center valign=middle bgcolor="<%= CellColor %>">
  298.                     <a href="tsdelete.asp?key=<%= clsTes.GridValue(lRow, 0) %>&ReturnURL=<%= Server.URLEncode("tsgrid.asp") %>" TARGET="_parent"><img border=0 align=center src="../images/delete.gif" alt="Delete Timesheet"></a>
  299.                 </td>
  300.     <%        Else %>
  301.                 <td align=center valign=middle>
  302.                      
  303.                 </td>
  304.     <%        End If %>
  305. <%        End If %>
  306.         </tr>
  307.  
  308. <%        Next
  309.     End If %>
  310.  
  311. </table>
  312. <% Else %>
  313. Sorry, you do not have access to view timesheets.
  314. <% End If %>
  315.  
  316. <% Set clsTes = Nothing %>
  317. </BODY>
  318. </HTML>
  319.