%@ Language=VBScript%>
<%Response.Buffer = True%>
<%
Dim dtToday
dtToday = Date%>
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Gets committees up for voting...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetVotingComms(objVote)%>
<%
On Error Resume Next
Dim strSQL1, messages
strSQL1 = "SELECT [COMNAME], [ENDVOTE], [ELECTION_TYPE] FROM [COMM1]"
strSQL1 = strSQL1 + " WHERE [COMID] NOT IN"
strSQL1 = strSQL1 + " (SELECT [COMID] FROM [VOTED]"
strSQL1 = strSQL1 + " WHERE [USER_ID] = " & Cstr(Clng(Session.Contents("USER_ID"))) & ")"
strSQL1 = strSQL1 + " AND [STARTVOTE] <= #" & Cstr(dtToday) & "#"
strSQL1 = strSQL1 + " AND [ENDVOTE] >= #" & Cstr(dtToday) & "#"
strSQL1 = strSQL1 + " ORDER BY [ENDVOTE]"
dbNVS.Open
objVote.Open strSQL1, dbNVS ', adOpenKeyset, adLockOptimistic
'Error Handling in a small way...
If Err.Number > 0 then
messages = "A system error occured with the function GetVotingComms." + _
"
Please contact the Nominations and Election Committee to resolve this problem." + _
"
Please click the back button."
'something is wrong...
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
GetVotingComms = False
End if
'everything went ok...
GetVotingComms = True
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Gets committees user is a member of and the term they are finished...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetUserComms(objMem)%>
<%
On Error Resume Next
GetUserComms = False
Dim strSQL, messages
strSQL = "SELECT [COMM1].[COMNAME], [MEMBER].[TERM] FROM [COMM1], [MEMBER]"
strSQL = strSQL + " WHERE [MEMBER].[COMID] = [COMM1].[COMID]"
strSQL = strSQL + " AND [MEMBER].[USER_ID]= " + Cstr(Clng(Session.Contents("USER_ID")))
strSQL = strSQL + " ORDER BY [TERM]"
dbNVS.Open
objMem.Open strSQL, dbNVS, adOpenKeyset ', adLockOptimistic
'Error Handling in a small way...
If Err.Number > 0 then
messages = "A system error occured with the function GetUserComms." + _
"
Please contact the Nominations and Election Committee to resolve this problem." + _
"
Please click the back button."
'something is wrong...
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
GetUserComms = False
End if
'everything went ok...
GetUserComms = True
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Gets Username for welcome messages...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetUserName(objUser)%>
<%
On Error Resume Next
GetUserName = False
Dim strSQLWelc, messages
strSQLWelc = "SELECT [F_NAME], [L_NAME] FROM [FACULTY] WHERE [USER_ID] = " + Cstr(Session.Contents("USER_ID"))
dbNVS.Open
objUser.Open strSQLWelc, dbNVS, adOpenKeyset ', adLockOptimistic
'Error Handling in a small way...
If Err.Number > 0 then
messages = "A system error occured with the function GetUserName." + _
"
Please contact the Nominations and Election Committee to resolve this problem." + _
"
Please click the back button."
'something is wrong...
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
GetUserName = False
End if
'everything went ok...
GetUserName = True
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Gets committies user has been nominated for...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetUserNoms(objNom)%>
<%
On Error Resume Next
'SQL retrives all commities current user in nominated for
Dim strSQL, messages
strSQL = "Select [NOMINATED].[STATUS], [COMM1].[COMNAME], [COMM1].[ENDNOM] "
strSQL = strSQL +" FROM [NOMINATED], [COMM1]"
strSQL = strSQL + " WHERE [NOMINATED].[COMID] = [COMM1].[COMID]"
strSQL = strSQL + " AND NOMINATED.USER_ID = " + Cstr(Session.Contents("USER_ID"))
'strSQL = strSQL + " AND #" & Cstr(dtToday) & "# > [ENDNOM] "
strSQL = strSQL + " AND #" & Cstr(dtToday) & "# < [STARTVOTE] "
strSQL = strSQL + " ORDER BY [STARTVOTE]"
' response.write strSQL
dbNVS.Open
objNom.Open strSQL, dbNVS ', adOpenKeyset ', adLockOptimistic
'Error Handling in a small way...
If Err.Number > 0 then
messages = "A system error occured with the function GetUserNoms." + _
"
Please contact the Nominations and Election Committee to resolve this problem." + _
"
Please click the back button."
'something is wrong...
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
GetUserNoms = False
End if
'everything went ok...
GetUserNoms = True
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Gets committees up for nominaitons...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetNomComs(objComs)%>
<%
On Error Resume Next
GetNomComs = False
Dim strSQL2, messages
strSQL2 = "SELECT [COMID], [COMNAME], [ENDNOM] FROM [COMM1]"
strSQL2 = strSQL2 + " WHERE [STARTNOM] <= #" & Cstr(dtToday) & "#"
strSQL2 = strSQL2 + " AND [ENDNOM] >= #" & Cstr(dtToday) & "#"
strSQL2 = strSQL2 + " ORDER BY [ENDNOM]"
' response.write strSQL2
dbNVS.Open
objComs.Open strSQL2, dbNVS ', adOpenKeyset, adLockOptimistic
'Error Handling in a small way...
If Err.Number > 0 then
messages = "A system error occured with the function GetNomComs." + _
"
Please contact the Nominations and Election Committee to resolve this problem." + _
"
Please click the back button."
'something is wrong...
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
GetNomComs = False
End if
'everything went ok...
GetNomComs = True
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
Dim objWelc
Set objWelc = Server.CreateObject("ADODB.RecordSet")
Dim objMember
Set objMember = Server.CreateObject("ADODB.Recordset")
Dim objNom
Set objNom = Server.CreateObject("ADODB.RecordSet")
Dim objCNom
Set objCNom = Server.CreateObject("ADODB.RecordSet")
Dim objVote
Set objVote = Server.CreateObject("ADODB.RecordSet")
GetUserName(objWelc)
%>
<% Title = "Welcome" %>
Welcome
<%
'************************************
' Output Welcome Message...
'************************************
%>
Welcome <%=objWelc("F_NAME") + " " + objWelc("L_NAME")%> you have successfully logged into NVS!
<% If Session.Contents("ADMIN_ACCESS") = True Then %>
Click the link to go to the Admin Home Page
<% End If %>
<%
dbNVS.Close
%>
|
COMMITTEE MEMBERSHIPS |
TERM ENDING |
<%
GetUserComms(objMember)
If Not objMember.EOF Then
Do While NOT objMember.EOF%>
| <%=UCase(objMember.fields("COMNAME").value)%> |
<%=objMember.fields("TERM").value%> |
<% objMember.MoveNext
Loop
Else%>
| NONE |
NONE |
<%End If%>
<%
dbNVS.Close
%>
<%
'*************************************
' Display committees up for voting...
'*************************************
%>
|
COMMITTEES CURRENTLY UP FOR VOTING |
TYPE |
DEADLINE |
<%
GetVotingComms(objVote)
'Display voting committies
If objVote.EOF then
%>
| NONE |
NONE |
NONE |
<%
Else
Do While NOT objVote.EOF
select case objVote.fields("ELECTION_TYPE").value
case True kind = "REGULAR"
case False kind = "RUN-OFF"
end select
%>
| <%=UCase(objVote.fields("COMNAME").value)%> |
<%=kind%> |
<%=objVote.fields("ENDVOTE").value%> |
<%
objVote.MoveNext
Loop
End If
dbNVS.Close
%>
<%
'**********************************
' Display Committees up for Nominaitons...
'**********************************
%>
|
COMMITTEES CURRENTLY UP FOR NOMINATIONS |
DEADLINE |
<%
GetNomComs(objCNom)
'Display "nominatable" committies
If objCNom.EOF then
%>
| NONE |
NONE |
<%
Else
Do While NOT objCNom.EOF
%>
| <%=UCase(objCNom.fields("COMNAME").value)%> |
<%=objCNom.fields("ENDNOM").value%> |
<%
objCNom.MoveNext
Loop
End If
dbNVS.Close
%>
<%
'*****************************************
' Display committies user has been nominated for...
'*****************************************
%>
|
COMMITTEES YOU HAVE BEEN NOMINATED FOR |
STATUS |
DEADLINE |
<%
GetUserNoms(objNom)
IF objNom.EOF Then
'empty recordset
%>
| NONE |
NONE |
NONE |
<%
else
'Display nominations
Do While NOT objNom.EOF
select case UCase(objNom.fields("STATUS").value)
case "U" stat = "UNDECIDED"
case "A" stat = "ACCEPTED"
case "D" stat = "DECLINED"
end select
%>
| <%=UCase(objNom.fields("COMNAME").value)%> |
<%=stat%> |
<%=objNom.fields("ENDNOM").value%> |
<%
objNom.MoveNext
Loop
End If
dbNVS.Close
%>
Use the menu bar at the top of this page
to move through the NVS activities.
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'THIS DISPLAYS A MESSAGE BOX...WILL USE TO CONFIRM A SUCCESSFULL VOTE...
If Request.QueryString("confirm") = "yes" Then
Response.write ""
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>