home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / full / atlantic / Software / Teweb / data1.cab / Pages / scripts / tstable.asp < prev    next >
Encoding:
Text File  |  2000-02-14  |  13.6 KB  |  492 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.     tResource = Request("Resource")
  8.     dFromDate = Request("FromDate")
  9.     dToDate = Request("ToDate")
  10.  
  11.     If Len(dFromDate)=0 Then
  12.       dFromDate = clsTes.ADbl(clsTes.FromDate)
  13.     Else
  14.       clsTes.FromDate = clsTes.ADbl(dFromDate)
  15.     End If
  16.  
  17.     If Len(dToDate)=0 Then
  18.         dToDate = clsTes.ADbl(clsTes.ToDate)
  19.     Else
  20.         clsTes.ToDate = clsTes.ADbl(dToDate)
  21.     End If
  22.  
  23.     If Len(tResource) = 0 Then
  24.       tResource = clsTes.Resource
  25.     Else
  26.         If clsTes.ViewResource(tResource,1) Then
  27.             clsTes.Resource = tResource
  28.         Else
  29.             tResource = clsTes.Resource
  30.         End If
  31.     End If
  32.  
  33. %>
  34. <!-- #INCLUDE FILE = "settings/colours.txt" -->
  35. <HTML>
  36. <HEAD>
  37. <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
  38. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  39. <TITLE>Timesheet Table</TITLE>
  40. </HEAD>
  41. <BODY BGCOLOR="<%= BackColor %>" LINK="<%= LinkColor %>" VLINK="<%= VLinkColor %>" ALINK="<%= ALinkColor %>" TEXT="<%= TextColor %>">
  42. <BASEFONT SIZE=2 COLOR="<%= TextColor %>">
  43.  
  44. <% If clsTes.TimesheetViewAccess <> 2 Then    'US_NONE %>
  45.  
  46. <FORM ACTION="tsaction.asp" METHOD=POST>
  47.  
  48. <table border=0 Cellpadding=0 CellSpacing=0 width=100%>
  49. <tr>
  50.     <td COLSPAN=2><IMG border=0 src="..\images\space.gif"> </td>
  51. </tr>
  52.  
  53. <tr>
  54.     <td align=left valign=top nowrap=nowrap>
  55.         <table width = 250 border=0 cellspacing=1 cellpadding=1>
  56.         <tr>
  57.             <td align=left width = 75>
  58.             <b><%= Server.HTMLEncode(clsTes.ResourceLabel) %>:</b>
  59.             </td>
  60.             <td align=left width = 175>
  61. <%            If clsTes.TimesheetViewAccess <> 3 and clsTes.TimesheetViewAccess <> 6 and clsTes.TimesheetViewAccess <> 7 Then        'US_OWN %>
  62.                 <a href="pickitem.asp?Type=Resource&<% Response.Write("ReturnURL=" & Server.URLEncode("tstable.asp")) %>">
  63. <%            End If
  64.  
  65.             If len(tResource) > 0 Then
  66.                 Response.Write(Server.HTMLEncode(tResource))
  67.             Else %>
  68.                 Please Select
  69. <%            End If 
  70.             If clsTes.TimesheetViewAccess <> 3 and clsTes.TimesheetViewAccess <> 6 and clsTes.TimesheetViewAccess <> 7 Then        'US_OWN %>
  71.                 </a>
  72. <%            End If %>
  73.             </td>
  74.  
  75.         </tr>
  76.         </table>
  77.     </td>
  78.  
  79.     <td align=right valign=top>
  80. <%        tURL = "tstable.asp?FromDate=" %>
  81.         <table border=0 cellspacing=1 cellpadding=1>
  82.         <tr>
  83.  
  84.             <td align=center NOWRAP=NOWRAP>
  85.                 <A HREF="calendar.asp?ReturnURL=<%= Server.URLEncode("tstable.asp") %>&Name=FromDate&Date=<%= dFromDate %>">
  86.                 <b><% Response.Write(clsTes.FormatDate(dFromDate)) %></b> 
  87.                 </A>
  88.             </td>
  89.             <td align=center>    
  90.                 To
  91.             </td>
  92.             <td align=center NOWRAP=NOWRAP bgcolor="<%= SelectBackColor %>">
  93.                 <A HREF="calendar.asp?ReturnURL=<%= Server.URLEncode("tstable.asp") %>&Name=ToDate&Date=<%= dToDate %>">
  94.                 <b><% Response.Write(clsTes.FormatDate(dToDate)) %></b>
  95.                 </A>
  96.             </td>
  97.             <td width=10></td>
  98.             <td align=center width=25>
  99.                 <a href=<% Response.Write(tURL & CStr(dFromDate - 28) & "&ToDate=" & CStr(dToDate - 28)) %>>
  100.                 <img border=0 align=center src="../images/bck4w.gif" ALT="Back 4 Weeks">
  101.                 </a>
  102.             </td>
  103.             <td align=center width=25>
  104.                 <a href=<% Response.Write(tURL & CStr(dFromDate - 7) & "&ToDate=" & CStr(dToDate - 7)) %>>
  105.                 <img border=0 align=center src="../images/bck1w.gif" ALT="Back 1 Week">
  106.                 </a>
  107.             </td>
  108.             <td align=center width=25>
  109.                 <a href=<% Response.Write(tURL & CStr(dFromDate + 7) & "&ToDate=" & CStr(dToDate + 7)) %>>
  110.                 <img border=0 align=center src="../images/fwd1w.gif" ALT="Forward 1 Week">
  111.                 </a>
  112.             </td>
  113.             <td align=center width=25>
  114.                 <a href=<% Response.Write(tURL & CStr(dFromDate + 28) & "&ToDate=" & CStr(dToDate + 28)) %>>
  115.                 <img border=0 align=center src="../images/fwd4w.gif" ALT="Forward 4 Weeks">
  116.                 </a>
  117.             </td>
  118.         </tr>
  119.         </table>
  120.     </td>
  121.     
  122. </tr>
  123. <tr>
  124.     <td COLSPAN=2><IMG border=0 src="..\images\space.gif"> </td>
  125. </tr>
  126. </table>
  127.  
  128. <table width=100% border=0 cellspacing=1 cellpadding=1>
  129. <tr>
  130.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  131.         <font color = "<%= CellTitleTextColor %>">
  132.         <b>Date</b>
  133.         </font>
  134.     </td>
  135.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  136.         <font color = "<%= CellTitleTextColor %>">
  137.         <b><%= Server.HTMLEncode(clsTes.ResourceLabel) %></b>
  138.         </font>
  139.     </td>
  140.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  141.         <font color = "<%= CellTitleTextColor %>">
  142.         <b><%= Server.HTMLEncode(clsTes.ClientLabel) %></b>
  143.         </font>
  144.     </td>
  145.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  146.         <font color = "<%= CellTitleTextColor %>">
  147.         <b><%= Server.HTMLEncode(clsTes.ProjectLabel) %></b>
  148.         </font>
  149.     </td>
  150.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  151.         <font color = "<%= CellTitleTextColor %>">
  152.         <b><%= Server.HTMLEncode(clsTes.ActivityLabel) %></b>
  153.         </font>
  154.     </td>
  155.  
  156.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  157.         <font color = "<%= CellTitleTextColor %>">
  158.         <b><%= Server.HTMLEncode(clsTes.UnitTimeLabelP) %></b>
  159.         </font>
  160.     </td>
  161.  
  162. <%        If clsTes.UserCost = 1 or clsTes.UserCost = 3 Then %>
  163.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  164.         <font color = "<%= CellTitleTextColor %>">
  165.         <b>Cost</b>
  166.         </font>
  167.     </td>
  168. <%        ElseIf clsTes.UserCost <> 0 Then %>
  169.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  170.         <font color = "<%= CellTitleTextColor %>">
  171.         <b>Total Cost</b>
  172.         </font>
  173.     </td>
  174. <%        End If %>
  175.  
  176. <%        If clsTes.UserCharge = 1 or clsTes.UserCharge = 3 Then %>
  177.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  178.         <font color = "<%= CellTitleTextColor %>">
  179.         <b>Charge</b>
  180.         </font>
  181.     </td>
  182. <%        ElseIf clsTes.UserCharge <> 0 Then %>    
  183.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  184.         <font color = "<%= CellTitleTextColor %>">
  185.         <b>Total Charge</b>
  186.         </font>
  187.     </td>
  188. <%        End If %>
  189.     
  190. <%        If clsTes.UserChargeableTimesheet <> 0 Then    %>
  191.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  192.         <font color = "<%= CellTitleTextColor %>">
  193.         <b>Chargeable</b>
  194.         </font>
  195.     </td>
  196. <%        End If %>
  197.  
  198. <%        If clsTes.UserOvertime Then %>
  199.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  200.         <font color = "<%= CellTitleTextColor %>">
  201.         <b>Overtime</b>
  202.         </font>
  203.     </td>
  204. <%        End If %>
  205.  
  206. <%        If clsTes.UserApprovedTimesheet Then %>
  207.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  208.         <font color = "<%= CellTitleTextColor %>">
  209.         <b>Approved</b>
  210.         </font>
  211.     </td>
  212. <%        End If %>
  213.  
  214. <%        If clsTes.UserInvoicedTimesheet Then %>
  215.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  216.         <font color = "<%= CellTitleTextColor %>">
  217.         <b>Invoiced</b>
  218.         </font>
  219.     </td>
  220. <%        End If %>
  221.  
  222. <%        If clsTes.UserTimesheetNotes Then %>
  223.     <td align=Left valign=top bgcolor="<%= CellTitleColor %>">
  224.         <font color = "<%= CellTitleTextColor %>">
  225.         <b>Notes</b>
  226.         </font>
  227.     </td>
  228. <%        End If %>
  229.  
  230. <%        If clsTes.TimesheetMaintainAccess <> 0 And clsTes.TimesheetApproveAccess <> 0 Then %>
  231.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  232.         <FONT color = "<%= CellTitleTextColor %>">
  233.         <b>Select</b>
  234.         </FONT>
  235.     </td>
  236. <%        End If %>
  237.  
  238.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  239.          
  240.     </td>
  241. </tr>
  242. <%    lMaintainCount = 0
  243.     lApproveCount = 0
  244.  
  245.     Dim lRowCount
  246.     Dim lRow
  247.     Dim nColumn
  248.  
  249.     lRowCount = clsTes.GenerateTimesheetTable
  250.  
  251.     If clsTes.ErrorNumber <> 0 Then
  252.  
  253.         Response.Write (Server.HTMLEncode(clsTes.ErrorDescription))
  254.  
  255.     Else
  256.  
  257.         If lRowCount > 0 Then
  258.             For lRow = 1 To lRowCount %>
  259.  
  260.         <tr>
  261.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  262.                 <FONT SIZE=-1>
  263.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 4)) %>
  264.                 </FONT>
  265.             </td>            
  266.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  267.                 <FONT SIZE=-1>
  268.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 5)) %>
  269.                 </FONT>
  270.             </td>
  271.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  272.                 <FONT SIZE=-1>
  273.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 6)) %>
  274.                 </FONT>
  275.             </td>
  276.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  277.                 <FONT SIZE=-1>
  278.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 7)) %>
  279.                 </FONT>
  280.             </td>
  281.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  282.                 <FONT SIZE=-1>
  283.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 8)) %>
  284.                 </FONT>
  285.             </td>
  286.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  287.                 <FONT SIZE=-1>
  288.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 9)) %>
  289.                 </FONT>
  290.             </td>
  291.  
  292.             <% nColumn = 10 %>
  293.  
  294. <%        If clsTes.UserCost = 1 or clsTes.UserCost = 3 Then %>
  295.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  296.                 <FONT SIZE=-1>
  297.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, 10)) %>
  298.                 <% nColumn = nColumn + 1 %>
  299.                 </FONT>
  300.             </td>
  301. <%        ElseIf clsTes.UserCost <> 0 Then    'UT_COST_NONE %>
  302.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  303.                 <FONT SIZE=-1>
  304.                 <%= CStr(clsTes.GridValue(lRow, 10)) %>
  305.                 <% nColumn = nColumn + 1 %>
  306.                 </FONT>
  307.             </td>
  308. <%        End If %>
  309.  
  310.  
  311.  
  312.  
  313. <%        If clsTes.UserCharge = 1 or clsTes.UserCharge = 3 Then %>
  314.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  315.                 <FONT SIZE=-1>
  316.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  317.                 <% nColumn = nColumn + 1 %>
  318.                 </FONT>
  319.             </td>
  320. <%        ElseIf clsTes.UserCharge <> 0 Then    'UT_CHARGE_NONE %>    
  321.             <td align=right valign=middle bgcolor="<%= CellColor %>">
  322.                 <FONT SIZE=-1>
  323.                 <%= CStr(clsTes.GridValue(lRow, nColumn)) %>
  324.                 <% nColumn = nColumn + 1 %>
  325.                 </FONT>
  326.             </td>
  327. <%        End If %>
  328.  
  329.  
  330.  
  331. <%        If clsTes.UserChargeableTimesheet <> 0 Then    'UT_CHARGEABLE_TS_NONE %>
  332.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  333.                 <FONT SIZE=-1>
  334.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  335.                 <% nColumn = nColumn + 1 %>
  336.                 </FONT>
  337.             </td>
  338. <%        End If %>
  339.  
  340.  
  341. <%        If clsTes.UserOvertime Then %>
  342.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  343.                 <FONT SIZE=-1>
  344.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  345.                 <% nColumn = nColumn + 1 %>
  346.                 </FONT>
  347.             </td>
  348. <%        End If %>
  349.  
  350.  
  351.  
  352. <%        If clsTes.UserApprovedTimesheet Then %>
  353.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  354.                 <FONT SIZE=-1>
  355. <%                If Not IsNull(clsTes.GridValue(lRow,nColumn)) Then %>
  356.                     <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  357. <%                Else %>
  358.                      
  359. <%                End If %> 
  360.                 <% nColumn = nColumn + 1 %>
  361.                 </FONT>
  362.             </td>
  363. <%        End If %>
  364.  
  365.  
  366.  
  367. <%        If clsTes.UserInvoicedTimesheet Then %>
  368.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  369.                 <FONT SIZE=-1>
  370.                 <%= Server.HTMLEncode(clsTes.GridValue(lRow, nColumn)) %>
  371.                 <% nColumn = nColumn + 1 %>
  372.             </td>
  373. <%        End If %>
  374.  
  375. <%        If clsTes.UserTimesheetNotes Then %>
  376.             <td align=left valign=middle bgcolor="<%= CellColor %>">
  377.                 <FONT SIZE=-1>
  378. <%                If Not IsNull(clsTes.GridValue(lRow, nColumn)) Then %>
  379.                     <%= Server.HTMLEncode(clsTes.GridValue(lRow,nColumn)) %>
  380. <%                Else %>
  381.                      
  382. <%                End If %>
  383.                 <% nColumn = nColumn + 1 %>
  384.                 </FONT>
  385.             </td>
  386. <%        End If %>
  387.  
  388. <%        If clsTes.TimesheetMaintainAccess <> 0 or clsTes.TimesheetApproveAccess <> 0 Then
  389.             If clsTes.Maintain(lRow) or clsTes.Approve(lRow) Then %>
  390.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  391.                 <INPUT TYPE=CHECKBOX NAME="chkSelect" VALUE="<%= clsTes.GridValue(lRow,0) %>">
  392. <%                 If clsTes.Approve(lRow) Then
  393.                     lApproveCount = lApproveCount + 1
  394.                 End If %>
  395.             </td>
  396. <%            Else %>
  397.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  398.                  
  399.             </td>
  400. <%            End If %>
  401. <%        End If %>
  402.  
  403.             <td align=center valign=middle bgcolor="<%= CellColor %>">
  404. <%        If clsTes.Maintain(lRow) Then %>
  405.                 <a href="tstamend.asp?Key=<%= clsTes.GridValue(lRow,0) %>&ReturnURL=<%= Server.URLEncode("tstable.asp") %>"><IMG BORDER=0 align=center SRC="../images/amend.gif" ALT="Amend Timesheet"></a>
  406. <%                lMaintainCount = lMaintainCount + 1 %>
  407. <%        Else %>
  408.                 <a href="tsview.asp?Key=<%= clsTes.GridValue(lRow,0) %>&ReturnURL=<%= Server.URLEncode("tstable.asp") %>"><IMG BORDER=0 align=center SRC="../images/view.gif" ALT="View Timesheet"></a>
  409. <%        End If %>
  410.             </td>
  411.         </tr>
  412.         
  413.         <% Next
  414.         End If
  415.  
  416.     End If %>
  417.  
  418.  
  419. </table>
  420.  
  421. <BR>
  422. <table border=0 align=right>
  423. <TR>
  424. <%    If lApproveCount > 0  and clsTes.TimesheetApproveAccess <> 0 Then %>
  425.     <TD align=center>
  426.         <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Approve">
  427.     </TD>
  428. <%    End If %>
  429. <%    If Len(clsTes.Resource) > 0 and clsTes.TimesheetMaintainAccess <> 0 and clsTes.MaintainResource(tResource, 1) Then %>
  430.     <TD align=center>
  431.         <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Add">
  432.     </TD>
  433. <%    End If %>
  434. <%    If lMaintainCount > 0 and clsTes.TimesheetMaintainAccess <> 0 and clsTes.MaintainResource(tResource, 1) Then %>
  435.     <TD align=center>
  436.         <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Delete">
  437.     </TD>
  438. <%    End If %>
  439. </TR>
  440. </TABLE>
  441.  
  442. <TABLE BORDER=0 ALIGN=LEFT CELLSPACING=2 CELLPADDING=5>
  443. <TR>
  444.     <TD ALIGN=LEFT>
  445.         <FONT SIZE=-1>
  446.         <B>Total <%= Server.HTMLEncode(clsTes.UnitTimeLabelP) %></B>
  447.         </FONT>
  448.     </TD>
  449.     <TD ALIGN=LEFT>
  450.         <FONT SIZE=-1>
  451.         <%= clsTes.GridTotalHours %>
  452.         </FONT>
  453.     </TD>
  454. <%    If clsTes.UserCost=2 or clsTes.UserCost=4 or clsTes.UserCost=5 Then    %>
  455.     <TD WIDTH=10></TD>
  456.     <TD ALIGN=LEFT>
  457.         <FONT SIZE=-1>
  458.         <B>Total Cost</B>
  459.         </FONT>
  460.     </TD>
  461.     <TD ALIGN=LEFT>
  462.         <FONT SIZE=-1>
  463.         <%= clsTes.GridTotalCost %>
  464.         </FONT>
  465.     </TD>
  466. <% End If %>
  467.  
  468. <%    If clsTes.UserCharge=2 or clsTes.UserCharge=4 or clsTes.UserCharge=5 Then %>
  469.     <TD WIDTH=10></TD>
  470.     <TD ALIGN=LEFT>
  471.         <FONT SIZE=-1>
  472.         <B>Total Charge</B>
  473.         </FONT>
  474.     </TD>
  475.     <TD ALIGN=LEFT>
  476.         <FONT SIZE=-1>
  477.         <%= clsTes.GridTotalCharge %>
  478.         </FONT>
  479.     </TD>
  480. <% End If %>
  481. </TR>
  482. </TABLE>
  483. </FORM>
  484.  
  485. <% Else %>
  486. Sorry, you do not have access to view timesheets.
  487. <% End If %>
  488.  
  489. <% Set clsTes = Nothing %>
  490. </BODY>
  491. </HTML>
  492.