home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / full / atlantic / Software / Teweb / data1.cab / Pages / scripts / restrictions.asp < prev    next >
Encoding:
Text File  |  2000-02-14  |  4.5 KB  |  164 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.     tType = Request("Type")
  8.     If tType= "Activity" Then
  9.         tTypeLabel = clsTes.ActivityLabel
  10.         tType = "Activity"
  11.     Else
  12.         tTypeLabel = clsTes.ProjectLabel
  13.         tType = "Project"
  14.     End If
  15.     bSave = False
  16.     tErrorList = "<B>Errors:</B>"
  17.     nErrors = 0
  18.     If Request.Form("btnSubmit") = "Save Restrictions" Then
  19.         'Save Mode
  20.         bSave = clsTes.SaveOwnRestrictions(CStr(tType), CStr(Request.Form("chkSelect")), CStr(Request.Form("chkAll")))
  21.         If clsTes.ErrorNumber <> 0 Then
  22.             nErrors = 1
  23.             tErrorList = tErrorList & "<BR>" & Server.HTMLEncode(clsTes.ErrorText)
  24.         End If
  25.     End If
  26.  
  27.     If Request.Form("btnSubmit") = " All " then
  28.         bAll = True
  29.         bClear = False
  30.     ElseIf Request.Form("btnSubmit") = "Clear" then
  31.         bAll = False
  32.         bClear = True
  33.     Else
  34.         bAll = False
  35.         bClear = False
  36.     End If
  37. %>
  38. <!-- #INCLUDE FILE = "settings/colours.txt" -->
  39. <HTML>
  40. <HEAD>
  41. <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
  42. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  43. <TITLE>Timesheet Expert Web - Own <%= Server.HTMLEncode(clsTes.ResourceLabel) %> Restrictions</TITLE>
  44. </HEAD>
  45.  
  46. <BODY BGCOLOR="<%= BackColor %>" LINK="<%= LinkColor %>" VLINK="<%= VLinkColor %>" ALINK="<%= ALinkColor %>" TEXT="<%= TextColor %>">
  47. <BASEFONT SIZE=2 COLOR="<%= TextColor %>">
  48.  
  49. <center>
  50. <font size=+2><b> Own <%= Server.HTMLEncode(tTypeLabel) %> Restrictions<% If bSave then Response.Write (" - Saved") %></b></font>
  51. <P>
  52. <%        If nErrors Then %>
  53.             <%= tErrorList %>
  54.             <BR><BR>
  55. <%        End If %>
  56. <FORM NAME="frmRestrictions" ACTION="restrictions.asp" METHOD="POST">
  57. <INPUT TYPE=HIDDEN NAME="Type" VALUE="<%= tType %>">
  58. <table border=0 cellspacing=1 cellpadding=1>
  59.  
  60.     <TR>
  61.         <TD ALIGN=LEFT>
  62.             <INPUT TYPE=CHECKBOX NAME="chkAll" VALUE="NoRestrictions" <% If clsTes.GlobalResource(CStr(tType)) and not bClear and not bAll Then Response.Write("CHECKED") %>>
  63.             <B>No <%= Server.HTMLEncode(tTypeLabel) %> Restrictions</B>
  64.         </TD>
  65.         <TD ALIGN=CENTER>
  66.             <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Save Restrictions">
  67.         </TD>
  68.         <TD ALIGN=CENTER>
  69.             <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE=" All ">
  70.         </TD>
  71.         <TD ALIGN=CENTER>
  72.             <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Clear">
  73.         </TD>
  74.     </TR>
  75.     
  76. <tr>
  77.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  78.          
  79.         <font color="<%= CellTitleTextColor %>">
  80.         <b><%= Server.HTMLEncode(tTypeLabel) %> Code</b>
  81.         </font>
  82.     </td>
  83.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  84.          
  85.         <font color="<%= CellTitleTextColor %>">
  86.         <b>Description</b>
  87.         </font>
  88.     </td>
  89.     <td align=left valign=top bgcolor="<%= CellTitleColor %>">
  90.          
  91.         <font color="<%= CellTitleTextColor %>">
  92.         <b>Global</b>
  93.         </font>
  94.     </td>
  95.     <td align=center valign=top bgcolor="<%= CellTitleColor %>">
  96.          
  97.         <font color="<%= CellTitleTextColor %>">
  98.         <b>Select</b>
  99.         </font>
  100.     </td>
  101. </tr>
  102.  
  103. <%    Dim lRowCount
  104.     Dim lRow
  105.  
  106.  
  107.     lRowCount = clsTes.GenerateRestrictions(CStr(tType))
  108.  
  109.  
  110.     If clsTes.ErrorNumber <> 0 Then
  111.         Response.Write (clsTes.ErrorText)
  112.     Else
  113.  
  114.         If lRowCount > 0 Then
  115.  
  116.         For lRow = 1 to lRowCount %>
  117.  
  118.             <tr>
  119.                 <td align=left valign=top bgcolor="<%= CellColor %>">
  120.                      
  121.                     <%= Server.HTMLEncode(clsTes.GridValue(lRow, 0)) %>
  122.                 </td>
  123.                 <td align=left valign=top bgcolor="<%= CellColor %>">
  124.                      
  125.                     <%If Not IsNull(clsTes.GridValue(lRow, 1)) = True Then %> 
  126.                         <%= Server.HTMLEncode(clsTes.GridValue(lRow, 1)) %>
  127.                     <%End If%>
  128.                 </td>
  129.                 <td align=left valign=top bgcolor="<%= CellColor %>">
  130.                      
  131. <%                    If Not IsNull(clsTes.GridValue(lRow, 2)) Then %>
  132.                         <%= Server.HTMLEncode(clsTes.GridValue (lRow, 2)) %>
  133. <%                    End If %>
  134.                 </td>
  135.                 <td align=center valign=middle bgcolor="<%= CellColor %>">
  136.                     <INPUT TYPE=CHECKBOX NAME="chkSelect" VALUE="'<%= clsTes.GridValue (lRow,0) %>'" <% If (clsTes.GridValue(lRow,3) and Not bClear) or bAll Then Response.Write ("CHECKED") %>>
  137.                 </td>
  138.             </tr>
  139. <%        Next 
  140.         
  141.         End If
  142.     End If %>
  143.     <TR>
  144.         <TD ALIGN=LEFT>
  145.         </TD>
  146.         <TD ALIGN=CENTER>
  147.             <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Save Restrictions">
  148.         </TD>
  149.         <TD ALIGN=CENTER>
  150.             <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE=" All ">
  151.         </TD>
  152.         <TD ALIGN=CENTER>
  153.             <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Clear">
  154.         </TD>
  155.     </TR>
  156.  
  157. </table>
  158.  
  159. </form>
  160. </center>
  161. <% Set clsTes = Nothing %>
  162. </BODY>
  163. </HTML>
  164.