<%@ 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") & ""%> Welcome <% '************************************ ' Output Welcome Message... '************************************ %> <% If Session.Contents("ADMIN_ACCESS") = True Then %>
Click the link to go to the Admin Home Page

<% ELSE %>
<% End If %> <% dbNVS.Close %> <% '*********************************************************** 'Added by Bennett Giesler on 4-4-2006 'This is used to identify each form name with a different value 'JavaScript added to remove the buttons for the use of hyperlinks. 'ASP coded added to differentiate the different form names such as added myform1, myform2, myform3 where
'To call the form I simply did a javascript:document.myform10.submit(); Dim myformcount myformcount = 0 '*********************************************************** %> <% GetUserComms(objMember) If Not objMember.EOF Then Do While NOT objMember.EOF%> <% myformcount = myformcount + 1 objMember.MoveNext Loop Else%> <%End If%> <% dbNVS.Close %>
COMMITTEE MEMBERSHIPS TERM ENDING
<% '*********************************************************** ' Bennett Giesler 2-27-2006 ' This is where the formcount comes into use. ' The form submits the COMID value to the nom and vote page. %> "> <%=UCase(objMember.fields("COMNAME").value)%> <%=objMember.fields("TERM").value%>
NONE NONE

<% GetVotingComms(objVote) 'Display voting committies If objVote.EOF then %> <% Else Do While NOT objVote.EOF select case objVote.fields("ELECTION_TYPE").value case True kind = "REGULAR" case False kind = "RUN-OFF" end select %> <% myformcount = myformcount + 1 objVote.MoveNext Loop End If dbNVS.Close %> <% 'Form count done for nominations ''*********************************************************** %>
COMMITTEES CURRENTLY UP FOR VOTING TYPE DEADLINE
NONE NONE NONE
"> <%=UCase(objVote.fields("COMNAME").value)%>
<%=kind%> <%=objVote.fields("ENDVOTE").value%>

<% Set objVote = Nothing %> <% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function GetNominationsStatus(rsNOMS) ' Gets All Comittees up for Nominations. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GetNominationsStatus = False Dim strSQL, message Dim dtToday dtToday = Date strSQL = "SELECT [COMID], [COMNAME], [ENDNOM] FROM [COMM1]" strSQL = strSQL + " WHERE [STARTNOM] <= #" & Cstr(dtToday) & "#" strSQL = strSQL + " AND [ENDNOM] >= #" & Cstr(dtToday) & "#" strSQL = strSQL + " ORDER BY [ENDNOM]" 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 GetNominationsStatus." + _ "
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 GetNominationsStatus = False End if 'everything went ok... GetNominationsStatus = True End Function '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %> <% Dim messages set rsnomination = Server.CreateObject("ADODB.Recordset") dbNVS.Open 'get all committees the user has accepted nominations for.... If Not GetNominationsStatus(rsnomination) then 'clean up objects first.... set dbNVS = Nothing set rsnomination = 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 %>
<%If rsnomination.EOF then%> <%Else%> <% '************************************************* 'BENNETT GIESLER 2-27-2006 'INNER SQL START '************************************************* dim AD_STATUS, NOMSTATUS While Not rsnomination.EOF AD_STATUS = "" NOMSTATUS = "" ' INNER SQL QUERY!!!!!!! ' Bennett Giesler 2-27-2006 ' This query Had to do an inner SQL query to get the status of nomination status's, since there was a repeating group, 'because a nominated person can have many "U" designations in the database and also "A" or "D" (accept or decline). '"U" is supposedly means undecided, but in fact it does not mean that. The "U" means the user got nominated by someone 'else and has nothing to do with undecided. It would be more appropriate to rename the variable to "N" for nominated, 'however since the system needs integrate with the old system changing this value would cause a problem when integrating the two together. 'declare your variables Dim connection1, recordset1 Dim sSQL1, sConnString1 'declare SQL statement that will query the database sSQL1="SELECT DISTINCT NOMINATED.STATUS" sSQL1 = sSQL1 + " FROM COMM1 LEFT JOIN NOMINATED ON COMM1.COMID = NOMINATED.COMID" sSQL1 = sSQL1 + " WHERE (((NOMINATED.COMID)=" & rsnomination.fields("COMID").value & ") AND ((NOMINATED.USER_ID)=" + Cstr(Session.Contents("USER_ID")) + "));" 'create an ADO connection and recordset object Set connection1 = Server.CreateObject("ADODB.connection") Set recordset1 = Server.CreateObject("ADODB.Recordset") 'define the connection string, specify database 'driver and the location of database sConnString1="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("../database/dbNVS.mdb") 'Open the connection to the database Connection1.Open sConnString1 'Open the connection to the database 'Open the recordset object, executing the SQL Recordset1.Open sSQL1, Connection1 Do While NOT recordset1.EOF If recordset1("status").value = "U" Then NOMSTATUS = "YES" Else NOMSTATUS = "NO" End If If recordset1("status").value = "A" Then AD_STATUS = "A" End If If recordset1("status").value = "D" Then AD_STATUS = "D" End If recordset1.MoveNext Loop If NOMSTATUS = "" Then NOMSTATUS = "NO" ' This line below makes it so that when I nominate myself. The main menu will say that I have nominated my self. If AD_STATUS = "A" Then NOMSTATUS = "YES" recordset1.Close Set recordset1 = Nothing connection1.Close Set connection1 = Nothing '************************************************* ' INNER SQL QUERY END '************************************************* %> <% 'We need to increment myform count so we don't have multple equal to another one. myformcount = myformcount + 1 rsnomination.MoveNext Wend %>

CURRENTLY UP FOR NOMINATIONS

NOMINATED? ACCEPT DECLINE UNDECIDED DEADLINE
NONE - - - - -
<%=UCase(rsnomination.fields("COMNAME").value)%> ">
<%=NOMSTATUS%>
<% if AD_STATUS = "A" Then %>
">
<% Else %>
">
<% End If %>
<% if AD_STATUS = "D" Then %>
">
<% Else %>
">
<% End If %>
<% If AD_STATUS <> "A" AND AD_STATUS <> "D" Then %>
">
<% Else %>
">
<% End If %>
<%=rsnomination.fields("ENDNOM").value %>
<% dbNVS.Close Set dbNVS = Nothing Response.End End If %>