home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey / DeletePageCondition.asp < prev    next >
Text File  |  2006-11-29  |  2KB  |  44 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 deletes a page condition.
  7. '
  8. '   COPYRIGHT NOTICE                                
  9. '
  10. '   See attached Software License Agreement
  11. '
  12. '   (c) Copyright 2002 - 2006 by ClassApps.com.  All rights reserved.
  13. '***********************************************************************
  14. %>
  15. <!--#Include File="Include/Config_inc.asp"-->
  16. <!--#Include File="Include/Utility_inc.asp"-->
  17. <!--#Include File="Include/adovbs_inc.asp"-->
  18. <!--#Include File="Include/CurrentUser_inc.asp"-->
  19. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  20. <!--#Include File="Include/Constants_inc.asp"-->
  21. <%
  22.     'In order to delete a page, the user must be the survey owner or an admin.
  23.     If IsUserOwnerOrAdmin(Request.QueryString("SurveyID")) = False Then
  24.         Response.Redirect "AccessDenied.asp?SurveyID=" & Request.QueryString("SurveyID") & "&Reason=" & SUR_ACCESS_DENIED_NOT_OWNER
  25.     End If
  26.  
  27.     Dim strSQL
  28.     Dim conDelete
  29.     
  30.     'Initialization
  31.     Set conDelete = Server.CreateObject("ADODB.Connection")
  32.     conDelete.Open SURVEY_APP_CONNECTION
  33.  
  34.     'Delete the specified page condition from the SUR_PAGE_CONDITION table
  35.     strSQL = "DELETE FROM sur_page_condition WHERE page_condition_id = " & Request.QueryString("PageConditionID")
  36.     conDelete.Execute ConvertSQL(strSQL), , adCmdText
  37.  
  38.     'Clean up
  39.     conDelete.Close
  40.     Set conDelete = Nothing
  41.  
  42.     'Redirect to the page condition page for the same survey and page number.
  43.     Response.Redirect "PageCondition.asp?SurveyID=" & Request.QueryString("SurveyID") & "&PageNumber=" & Request.QueryString("PageNumber") & "&SurveyName=" & Request.QueryString("SurveyName")
  44. %>