%@ 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 [COMID], [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
' ADDED [COMM1].[COMNAME] by BENNETT 2-27-2006 to the select beginning
strSQL = "SELECT [COMM1].[COMNAME], [MEMBER].[TERM], [COMM1].[COMID] 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
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
Dim objWelc
Set objWelc = Server.CreateObject("ADODB.RecordSet")
Dim objMember
Set objMember = Server.CreateObject("ADODB.Recordset")
Dim objVote
Set objVote = Server.CreateObject("ADODB.RecordSet")
GetUserName(objWelc)
%>
<% Title = "Main Menu
Welcome " & objWelc("F_NAME") + " " + objWelc("L_NAME") & ""%>