%@ Language=VBScript %>
<% Response.Buffer = True %>
<%
'**************************************
' ACCEPT/DECLINE SCREEN
' MARCH 25, 2001
'**************************************
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetNominationsByStatus(rsNOMS, strSTATUS)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' FUNCTION GETS A RECORDSET OF COMMITTEE THE USER HAS
' BEEN NOMINATED FOR BY THE STATUS OF THIER DECISION
' U = UNDECIDED
' A = ACCEPT
' D = DECLINE
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Error Resume Next
GetNominationsByStatus = False
Dim strSQL, message
If strSTATUS = "U" Then
Dim dtToday
dtToday = Date
strSQL = "SELECT [COMID],[COMNAME], [STARTVOTE] FROM [COMM1]"
strSQL = strSQL + " WHERE [STARTNOM] <= #" & Cstr(Date()) & "#"
strSQL = strSQL + " AND [ENDNOM] >= #" & Cstr(Date()) & "#" & " AND NOT [COMID] IN "
strSQL = strSQL + "(SELECT [COMID] From [NOMINATED] WHERE [USER_ID] = "
strSQL = strSQL + Cstr(Session.Contents("USER_ID")) + " AND ([STATUS] = 'A' OR "
strSQL = strSQL + "[STATUS] = 'D'))"
strSQL = strSQL + " ORDER BY [COMNAME]"
Else
strSQL = "Select [COMID], [COMNAME], [STARTVOTE]"
strSQL = strSQL + " FROM [COMM1]"
strSQL = strSQL + " WHERE [COMID] IN"
strSQL = strSQL + " (Select [COMID]"
strSQL = strSQL + " FROM [NOMINATED]"
strSQL = strSQL + " WHERE [USER_ID] = " + Cstr(Session.Contents("USER_ID"))
strSQL = strSQL + " AND [STATUS]='" + Cstr(strSTATUS) + "'"
'strSQL = strSQL + " AND [ENDNOM] < #" + Cstr(Date()) + "#" 'remove to avoid the post-nomination acceptance period
strSQL = strSQL + " AND [STARTVOTE] > #" + Cstr(Date()) + "#)"
strSQL = strSQL + " ORDER BY [COMID]"
End If
rsNOMS.ActiveConnection = dbNVS
rsNOMS.Open strSQL, dbNVS, adOpenKeyset
If Not rsNOMS.EOF then
rsNOMS.MoveFirst
End If
'Error Handling in a small way...
If Err.Number > 0 then
message = "A system error occured with the function GetNominationsByStatus." + _
"
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(message)
Response.End
GetNominationsByStatus = False
End if
'everything went ok...
GetNominationsByStatus = True
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%>
<%
Dim messages
set rsAccept = Server.CreateObject("ADODB.Recordset")
set rsDecline = Server.CreateObject("ADODB.Recordset")
set rsUnDecide = Server.CreateObject("ADODB.Recordset")
dbNVS.Open
'get all committees the user has accepted nominations for....
If Not GetNominationsByStatus(rsAccept, "A") then
'clean up objects first....
set dbNVS = Nothing
set rsUnDecide = Nothing
set rsDecline = Nothing
set rsAccept = Nothing
'display error message...
messages = "There is a problem loading the committees you have accepted nominations for.
Please contact the Faculty Voting and Nominating Committee to resolve this problem.
Please click the BACK button."
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
End If
'get all committees the user has declined nominations for....
If Not GetNominationsByStatus(rsDecline, "D") then
'clean up objects first....
set dbNVS = Nothing
set rsUnDecide = Nothing
set rsDecline = Nothing
set rsAccept = Nothing
'display error message...
messages = "There is a problem loading the committees you have declined nominations for.
Please contact the Faculty Voting and Nominating Committee to resolve this problem.
Please click the BACK button."
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
End If
'get all committees the user is undecided about....
If Not GetNominationsByStatus(rsUnDecide, "U") then
'clean up objects first....
set dbNVS = Nothing
set rsUnDecide = Nothing
set rsDecline = Nothing
set rsAccept = Nothing
'display error message...
messages = "There is a problem loading the committees you have nominations for.
Please contact the Faculty Voting and Nominating Committee to resolve this problem.
Please click the BACK button."
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(messages)
Response.End
End If
%>
<%If rsAccept.EOF and rsDecline.EOF and rsUnDecide.EOF then%>
Currently there are no committees that you may accept/decline for.