IEEE Survey
<%
dim userID, reportID
dim submitted
dim conn
dim RSbuffer
dim facultyNumber
on error resume next
session.Timeout = 360
userID = cint(session("userID"))
if userID = empty then
userID = cint(Request.Form("userID"))
end if
'if still cannot retrieve user id then automatically logged out
if userID = "" or userID = 0 then
Response.redirect("surveyLogin.asp?loginFail=yes")
end if
'get the report id from the session object
reportID =cint(session("reportID"))
if reportID=empty then
reportID= cint(Request.Form("reportID"))
end if
session("userID")=cint(userID)
session("reportID")=cint(reportID)
'make connection
set conn = server.CreateObject("ADODB.connection")
conn.Open ConnectionString
msg=trim(Request.QueryString("msg"))
'check if the user has fill out more than page 2
sqlQuery = "select * from tbl_IEEE_report where REID="&reportID
set RSBuffer = conn.Execute(sqlQuery)
submitted = trim(Request.Form("submitted"))
if trim(RSbuffer("RENOPAGE2"))<>"" and msg<>"change" and submitted<>"yes" then
Response.Redirect("Survey02.asp")
end if
if submitted <> "yes" then
%>
ELECTRIC POWER
ENGINEERING EDUCATIONAL RESOURCES SURVEY Power
Engineering Education Committee of IEEE Power Engineering
Society
Reporting Period: Fiscal or Academic Year '05-'06
<%
else if submitted = "yes" then
'pass these vars to the processing part
session("userID")=cint(userID)
session("reportID")=cint(reportID)
if trim(Request.Form("facultyNumber")) <> "" then
facultyNumber = cint(Request.Form("facultyNumber"))
else
facultyNumber=1
end if
sqlQuery="update tbl_IEEE_report set RENOPAGE2="&facultyNumber&" where REID="&reportID
conn.Execute(sqlQuery)
Response.Redirect("survey02.asp")
end if
end if
%>