home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / PageAction.asp < prev    next >
Text File  |  2006-10-25  |  2KB  |  53 lines

  1. <!--#Include File="Include/Top_inc.asp"-->
  2. <%
  3. '***********************************************************************
  4. '   Application: SelectSurveyASP Advanced v8.1.11
  5. '   Author: Aaron Baril for ClassApps.com
  6. '   Page Description: This page works with Page.asp, and processes
  7. '                     the form for modifying the page title and introduction.
  8. '
  9. '   COPYRIGHT NOTICE                                
  10. '
  11. '   See attached Software License Agreement
  12. '
  13. '   (c) Copyright 2002 - 2006 by ClassApps.com.  All rights reserved.
  14. '***********************************************************************
  15. %>
  16. <!--#Include File="Include/Config_inc.asp"-->
  17. <!--#Include File="Include/Utility_inc.asp"-->
  18. <!--#Include File="Include/adovbs_inc.asp"-->
  19. <!--#Include File="Include/Constants_inc.asp"-->
  20. <!--#Include File="Include/ID_inc.asp"-->
  21. <!--#Include File="Include/CurrentUser_inc.asp"-->
  22. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  23. <%
  24.     Dim strSQL
  25.     Dim conPage
  26.             
  27.     'Initialization
  28.     Set conPage = Server.CreateObject("ADODB.Connection")
  29.     conPage.Open SURVEY_APP_CONNECTION
  30.  
  31.     'Create the SQL for either updating or inserting the record for the page title and introduction
  32.     If Request.Form("hdnState") = SUR_STATE_INSERT Then
  33.         strSQL = "INSERT INTO sur_page (survey_id, page_number, page_title, page_introduction) VALUES(" & _
  34.                     Request.Form("SurveyID") & ", " & _
  35.                     Request.Form("PageNumber") & ", " & _
  36.                     SQLEncode(Request.Form("txtPageTitle")) & ", " & _
  37.                     SQLEncode(Request.Form("txtPageIntroduction")) & ")"
  38.     Else 'SUR_STATE_EDIT
  39.         strSQL = "UPDATE sur_page " & _
  40.                  "SET page_title = " & SQLEncode(Request.Form("txtPageTitle")) & ", " & _
  41.                  "page_introduction = " & SQLEncode(Request.Form("txtPageIntroduction")) & _
  42.                  " WHERE survey_id = " & Request.Form("SurveyID") & _
  43.                  " AND page_number = " & Request.Form("PageNumber")
  44.     End If    
  45.  
  46.     'Execute the SQL and clean up
  47.     conPage.Execute ConvertSQL(strSQL), , adCmdText
  48.     conPage.Close
  49.     Set conPage = Nothing
  50.     
  51.     'Redirect back to the page for modifying the survey
  52.     Response.Redirect "ModifySurvey.asp?SurveyID=" & Request.Form("SurveyID")
  53. %>