<%@ Language=VBScript %> <%option explicit%> WorkWORLD Download: User Information
WorkWORLD Logo: Empowerment through Decision Support Technology. Employment Support Institute, Virginia Commonwealth University.  Link to WorkWORLD homepage. WorkWORLD Logo: Empowerment through Decision Support Technology. Employment Support Institute, Virginia Commonwealth University.    
Get Latest
WorkWORLD
Get Latest WorkWORLD Version button and link to How To Get WorkWORLD page
WorkWORLD Logo: Empowerment through Decision Support Technology. Employment Support Institute, Virginia Commonwealth University.
  workworld@vcu.edu
  Web www.workworld.org   Powered by Google
home | site index | what is WW? | what's new? | how to get WW? | faq | profile cases | install issues | tech support | distance learning | help/information system | download | partnerships | about us | training | contact us | links | accessibility | terms of use | privacy | disability news


<% dim sCookieEmailValue, sCookieName dim sQueryString, sProductValue, sAction, sUser, sFormMessage dim objRS, sSQL dim aCountryNames(75) dim sUpdateMode, sFormValidationError dim sErrorCode, sPrevHTTP 'initializing variables sProductValue = "NoProduct" sFormValidationError = "FALSE" sAction = "NoAction" sUser = "NoUser" sFormMessage="" sErrorCode="NoError" 'determine if query string variable exists for each sQueryString in request.querystring if sQueryString = "product" then sProductValue = request.querystring("product") elseif sQueryString = "formValidationError" then sFormValidationError= request.querystring("formValidationError") elseif sQueryString = "Action" then sAction= request.querystring("Action") elseif sQueryString = "user" then sUser = request.querystring("user") elseif sQueryString = "msg" then sFormMessage = request.querystring("msg") if sFormMessage = "updatesuccessful" then sFormMessage = "Your user information has been updated successfully." end if elseif sQueryString = "error" then sErrorCode = request.querystring("error") end if next 'trap error message set when trying to update database record select case sErrorCode case "-2147217873" sFormMessage= "The WorkWORLD user database allows only a single occurence of an email address. The email address you tried to enter already exists in the database. Please confirm if this is your email or not by pressing 'yes' or 'no' below." end select 'if product or Action was not sent on querystring then the page was enterred in error if sErrorCode = "NoError" and sProductValue = "NoProduct" and sAction="NoAction" and sUser="NoUser" and not sFormValidationError="TRUE" then response.write "
" response.write "You have reached this page in error. Please return to the WorkWORLD Main Download Page to continue" response.write "
" else sCookieEmailValue = "NoCookie" 'determine if email cookie exists for each sCookieName in request.cookies if sCookieName = "email" then sCookieEmailValue = request.cookies("email") exit for end if next sUpdateMode="Add" 'email cookie exists if sCookieEmailValue <> "NoCookie" and request.querystring("Action") <> "GetUser" then sSQL = "SELECT * FROM contact WHERE email = '" & replace(sCookieEmailValue,"'","''") & "'" set objRS= server.createobject("ADODB.recordset") objRS.CursorLocation= adUseClient objRS.ActiveConnection = objConn objRS.open sSQL,objConn,1,1 parseHTTP sPrevHTTP,false 'if not coming in the first time if request.Cookies("AccessUserInfo") = "True" then 'if not downloading the exe 'modified by Dave 07/23/02 so only WW products go to user agreement 'if right(sProductValue,3) <> "exe" then if left(sProductValue,2) <> "WW" then 'go directly to download the file session("Product") = sProductValue session("ContactID") = objRS("contact_id") response.redirect "downloaddbFile.asp" 'if downloading exe, then goto user agreement else response.redirect "downloadUserAgreement.asp?contact=" & objRS("contact_id") & "&product=" & sProductValue end if else 'if user doesn't exist if sUser = "disconfirmed" or objRS.RecordCount = 0 or objRS.RecordCount = -1 then if sFormValidationError="TRUE" then displayErroredForm sProductValue else displayBlankForm sProductValue, "You can either enter new user information by filling out the fields below and clicking submit, or you can search for your user information by " & "typing in your email at the bottom of the page and clicking search." end if elseif objRS.recordCount > 0 then sUpdateMode="Update" if sUser = "confirmed" then displayFullFillForm sFormMessage, sProductValue elseif sFormValidationError="TRUE" then displayErroredForm sProductValue else displayPartialFillForm sFormMessage, sProductValue end if end if 'close recordset objRS.close end if else 'this whole else clause is a mess. Lots of changes to handle situation where cookies 'are disabled on client's computers. so have to rehandle all situations above but 'with no cookie information. 'if either updating user info or updating without downloading or an error occurred and no cookies if request.querystring("Action") <> "" or sErrorCode <> "NoError" then if request.querystring("Action") <> "" then sSQL = "SELECT * FROM contact WHERE email = '" & request.form("email") & "'" else sSQL = "SELECT * FROM contact WHERE email = '" & request.querystring("email") & "'" end if set objRS= server.createobject("ADODB.recordset") objRS.CursorLocation= adUseClient objRS.ActiveConnection = objConn objRS.open sSQL,objConn,1,1 'if records returned, confirm user, else re-prompt with blank or query form. if objRS.recordcount > 0 then displayPartialFillForm sFormMessage, sProductValue else sUpdateMode="Add" if request.querystring("Action") = "GetUser" then displayBlankForm sProductValue, "The email you entered does not exist in the database. You can either try searching again or enter in new user information." else displayBlankForm sProductValue, "You can either enter new user information by filling out the fields below and clicking submit, or you can search for your user information by " & "typing in your email at the bottom of the page and clicking search." end if end if objRS.close elseif sFormValidationError="TRUE" then displayErroredForm sProductValue 'case where cookies are disabled so have to query db to get full information elseif request.querystring("user")="confirmed" then sSQL = "SELECT * FROM contact WHERE email = '" & request.querystring("email") & "'" set objRS= server.createobject("ADODB.recordset") objRS.CursorLocation= adUseClient objRS.ActiveConnection = objConn objRS.open sSQL,objConn,1,1 if objRS.recordcount > 0 then sUpdateMode="Update" displayFullFillForm sFormMessage, sProductValue else 'this should never happen sUpdateMode= "Add" displayBlankForm sProductValue, "You can either enter new user information by filling out the fields below and clicking submit, or you can search for your user information by " & "typing in your email at the bottom of the page and clicking search." end if objRS.close 'elseif request.querystring("user")="disconfirmed" then ' displayBlankForm sProductValue, "You can either enter new user information by filling out the fields below and clicking submit, or you can search for your user information by " & "typing in your email at the bottom of the page and clicking search." else displayBlankForm sProductValue, "You can either enter new user information by filling out the fields below and clicking submit, or you can search for your user information by " & "typing in your email at the bottom of the page and clicking search." end if end if end if 'close database connection objConn.close %> <% function NeverCache() 'this ensures that this page will never cache response.expires = 0 response.expiresabsolute = Now() - 1 response.addHeader "pragma","no-cache" response.addHeader "cache-control","private" Response.CacheControl = "no-cache" end function function displayPartialFillForm(byval SMsg, byval sProduct) dim sAnchorURL 'response.write "partial fill form" 'set cookie once its been retrieved from the database Response.Cookies("email") = objRS("email") Response.Cookies("email").Expires = #December 31,2010# response.write "
" response.write "
USER INFORMATION

" response.write sMsg response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" if sProduct <> "NoProduct" then response.write "" response.write "" response.write "" response.write "" response.write "" end if response.write "
Last Name  required
First Name  required
Email  required

Is this you?
  Image of hand pointing at question
" response.write "
 " response.write "

Back to the Download pageBack to the download page
" response.write "
" response.write "
" end function function displayFullFillForm(byval sFormMsg, byval sProduct) dim i, sAnchorURL sAnchorURL = "DownloadMain.html#" & left(request.querystring("product"),len(request.querystring("product"))-4) response.write "
" response.write "
User Information

" response.write "
" & sFormMsg & "
" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" if sProduct <> "NoProduct" then response.write "" response.write "" response.write "" response.write "" response.write "" end if response.write "
Last Name  required
First Name  required
State  required
Email  required
 Do you want to be  
on the Mail List?  
  Image of hand pointing at question" response.write "required


Back to the Download pageBack to the download page
" response.write "
" response.write "
" end function function displayErroredForm(byval sProduct) dim i, sAnchorURL sAnchorURL = "DownloadMain.html#" & left(request.querystring("product"),len(request.querystring("product"))-4) response.write "
" response.write "
User Information

" 'display session message...will store any validation errors. response.write "
The following errors have occurred:
" & "
"& session("msg") session("msg")="" response.write "
" response.write "
" response.write "
" response.write "" response.write "" response.write "" if session("last_name")="" then response.write "" else response.write "" end if response.write "" response.write "" response.write "" response.write "" if session("first_name")="" then response.write "" else response.write "" end if response.write "" response.write "" response.write "" response.write "" if session("state_province")="" then response.write "" else response.write "" end if response.write "" response.write "" response.write "" response.write "" if session("email") = "" then response.write "" else response.write "" end if response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" if sProduct <> "NoProduct" then response.write "" response.write "" response.write "" response.write "" response.write "" end if response.write "
Last Name  required
First Name  required
State  required
Email  required
 Do you want to be  
on the Mail List?  
" response.write "required


Back to the Download pageBack to the download page
" response.write "
" response.write "
" end function function displayBlankForm(byVal sProduct, byVal sFormMessage) dim i, sAnchorURL 'response.write "blank fill form" response.write "
" response.write "
User Information

" response.write sFormMessage response.write "
" response.write "
Add User

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" 'response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" if sProduct <> "NoProduct" then response.write "" response.write "" response.write "" response.write "" response.write "" end if response.write "
Last Name  required
First Name  required
State  required
Email  " & aCountryNames(1) &"required
 Do you want to be  
on the Mail List?  
" response.write "required


Back to the Download pageBack to the download page
" response.write "
" response.write "
" response.write "
" response.write "" response.write "
" response.write "
" response.write "
Search For User

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" if sProduct <> "NoProduct" then response.write "" response.write "" response.write "" response.write "" response.write "" end if response.write "
Email  required


Back to the Download pageBack to the download page
" response.write "
" response.write "
" end function %>
Skip Bottom Navigation and Copyright
home | site index | what is WW? | what's new? | how to get WW? | faq | profile cases | install issues | tech support | distance learning | help/information system | download | partnerships | about us | training | contact us | links | accessibility | terms of use | privacy | disability news

Employment Support Institute esi@vcu.edu
© 2009, Virginia Commonwealth University. All rights reserved.