iwrk4dedpr
Programmer
Hi,
I'm quite new to the So a little background might be in order.
1. I've done alot of programming in VBA (mostly in automating xl workbooks )
2. I'm learning how to use databases ( ADO )
3. I'm trying to understand ( ASP and javascript )
Ok I realize that some will say go to ASP.net but the company won't pay for the development tools. Besides they want to go to PHP and I'm more lost there. So on to my question.
I'm creating an asp page <FORM> with a <Select> control on it. Now in the book that I'm reading it says that with IE I can create a <DIV> section make it hidden or visible. I'm very lost with Javascript despite my brush with C++ ( they do look similar )
I'll post the code below, however, I'm not seeing code tags that delimit posted code so please forgive me if I do this wrong. I'd add a text file but I don't see that option yet either
<%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer=true %>
<%
' Local Variables
Dim strTask, strServerLogon, strSql
Dim objRecordSet, objConnection
Dim blnAdmin
Set objRecordset = Server.CreateObject("ADODB.Recordset")
Set objConnection = Server.CreateObject("ADODB.Connection")
' Retrieve any Query String Present
strTask = trim(Request.QueryString("Task"))
' Step 1 : Test for ADMIN Status
If strTask <> "" Then
strServerLogon = mid(Request.ServerVariables("LOGON_USER"),instr(Request.ServerVariables("LOGON_USER"),"\") +1)
objConnection.Open Session("dbconn")
strSql = "SELECT * " & _
"From Users " & _
"WHERE Username = '" & LCASE(mid(Request.ServerVariables("LOGON_USER"),instr(Request.ServerVariables("LOGON_USER"),"\") +1)) & "'"
Set objRecordset = objConnection.Execute(strSQL)
blnAdmin = FALSE
If Ucase(objRecordSet.Fields("SystemSecurity")) = "ADMIN" Then blnAdmin = TRUE
objRecordSet.Close
Set objRecordset = Nothing
Set objConnection = Nothing
End If
Call DisplayAdminMain
%>
<% Sub DisplayAdminMain () %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>ATMEL CSO: 360 Feedback Adminstration!</TITLE>
</HEAD>
<BODY bgcolor="#ffff99">
<Script language="Javascript">
<!--
function ToggleDelMsg()
{
if document.UpdateAction.value=="Delete Record"
{ document.DelRec.display="block"; }
else
{ document.DelRec.display="none"; }
return (TRUE);
}
// -->
</Script>
<p align=center><font size="5" color="blue"><b>Maintenance Utility for the 360 Feedback Database</b></font></B>
<hr>
<P>
<% If Not blnAdmin Then Call ToughLuckChamp %>
<% If strTask = "UpdateUser" and blnAdmin Then Call CreateUserUpdate %>
<% If strTask = "UpdateAdmin" and blnAdmin Then Call CreateAdminUpdate %>
</BODY>
</HTML>
<% End Sub %>
<% Sub CreateUserUpdate() %>
<form method="POST" action="admin_Main.asp">
<p align="center"><font size="5"><u>Updating User Information</font></u>
<p align="left"><b>
1. Enter the Username of the Person whom you are updating:
<input name="Username" value="Enter UserName">
</b>
<p align="left"><b>
2. Please indicate the type of action that you wish to perform:
<select name="UpdateAction" value="Select Action">
<option selected value="1">Add Record </option>
<option value="2">Modify Record</option>
<option value="3">Delete Record</option>
onchange="ToggleDelMsg()"
</select>
</p></b>
<hr>
<Div ID="DelRec" Style="display=none">
<p align=Center><font size=3 color=red><b>
If you are wishing to Delete a User.
<br>
You may click on Submit at this time.
</font></b>
<p>
<hr>
</Div>
<p align="center"><font size="5"><u>Current Selected User Information</font></u>
<p> </p>
<p> </p>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<% End Sub %>
<% Sub CreateAdminUpdate() %>
Response.Write "Update Allowed Admins"
<% End Sub %>
<% Sub ToughLuckChamp()
Response.Write _
"<p align=center><b><font size=4>" & _
"In order to perform Administrative functions<br>" & _
"You must have the proper security level.<br>" & _
"<br>" & _
"<br>" & _
"If you are required to make Administrative updates<br>" & _
"All requests, to update Access level, must be routed through the<br>" & _
"Training Section Manager!<br>" & _
"</font></b></p>"
End Sub
%>
I'm quite new to the So a little background might be in order.
1. I've done alot of programming in VBA (mostly in automating xl workbooks )
2. I'm learning how to use databases ( ADO )
3. I'm trying to understand ( ASP and javascript )
Ok I realize that some will say go to ASP.net but the company won't pay for the development tools. Besides they want to go to PHP and I'm more lost there. So on to my question.
I'm creating an asp page <FORM> with a <Select> control on it. Now in the book that I'm reading it says that with IE I can create a <DIV> section make it hidden or visible. I'm very lost with Javascript despite my brush with C++ ( they do look similar )
I'll post the code below, however, I'm not seeing code tags that delimit posted code so please forgive me if I do this wrong. I'd add a text file but I don't see that option yet either
<%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer=true %>
<%
' Local Variables
Dim strTask, strServerLogon, strSql
Dim objRecordSet, objConnection
Dim blnAdmin
Set objRecordset = Server.CreateObject("ADODB.Recordset")
Set objConnection = Server.CreateObject("ADODB.Connection")
' Retrieve any Query String Present
strTask = trim(Request.QueryString("Task"))
' Step 1 : Test for ADMIN Status
If strTask <> "" Then
strServerLogon = mid(Request.ServerVariables("LOGON_USER"),instr(Request.ServerVariables("LOGON_USER"),"\") +1)
objConnection.Open Session("dbconn")
strSql = "SELECT * " & _
"From Users " & _
"WHERE Username = '" & LCASE(mid(Request.ServerVariables("LOGON_USER"),instr(Request.ServerVariables("LOGON_USER"),"\") +1)) & "'"
Set objRecordset = objConnection.Execute(strSQL)
blnAdmin = FALSE
If Ucase(objRecordSet.Fields("SystemSecurity")) = "ADMIN" Then blnAdmin = TRUE
objRecordSet.Close
Set objRecordset = Nothing
Set objConnection = Nothing
End If
Call DisplayAdminMain
%>
<% Sub DisplayAdminMain () %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>ATMEL CSO: 360 Feedback Adminstration!</TITLE>
</HEAD>
<BODY bgcolor="#ffff99">
<Script language="Javascript">
<!--
function ToggleDelMsg()
{
if document.UpdateAction.value=="Delete Record"
{ document.DelRec.display="block"; }
else
{ document.DelRec.display="none"; }
return (TRUE);
}
// -->
</Script>
<p align=center><font size="5" color="blue"><b>Maintenance Utility for the 360 Feedback Database</b></font></B>
<hr>
<P>
<% If Not blnAdmin Then Call ToughLuckChamp %>
<% If strTask = "UpdateUser" and blnAdmin Then Call CreateUserUpdate %>
<% If strTask = "UpdateAdmin" and blnAdmin Then Call CreateAdminUpdate %>
</BODY>
</HTML>
<% End Sub %>
<% Sub CreateUserUpdate() %>
<form method="POST" action="admin_Main.asp">
<p align="center"><font size="5"><u>Updating User Information</font></u>
<p align="left"><b>
1. Enter the Username of the Person whom you are updating:
<input name="Username" value="Enter UserName">
</b>
<p align="left"><b>
2. Please indicate the type of action that you wish to perform:
<select name="UpdateAction" value="Select Action">
<option selected value="1">Add Record </option>
<option value="2">Modify Record</option>
<option value="3">Delete Record</option>
onchange="ToggleDelMsg()"
</select>
</p></b>
<hr>
<Div ID="DelRec" Style="display=none">
<p align=Center><font size=3 color=red><b>
If you are wishing to Delete a User.
<br>
You may click on Submit at this time.
</font></b>
<p>
<hr>
</Div>
<p align="center"><font size="5"><u>Current Selected User Information</font></u>
<p> </p>
<p> </p>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<% End Sub %>
<% Sub CreateAdminUpdate() %>
Response.Write "Update Allowed Admins"
<% End Sub %>
<% Sub ToughLuckChamp()
Response.Write _
"<p align=center><b><font size=4>" & _
"In order to perform Administrative functions<br>" & _
"You must have the proper security level.<br>" & _
"<br>" & _
"<br>" & _
"If you are required to make Administrative updates<br>" & _
"All requests, to update Access level, must be routed through the<br>" & _
"Training Section Manager!<br>" & _
"</font></b></p>"
End Sub
%>