home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / DeleteTemplate.asp < prev    next >
Text File  |  2006-10-25  |  2KB  |  45 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 template, and then redirects the
  7. '                     user back to the list of templates.
  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/CurrentUser_inc.asp"-->
  20. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  21. <!--#Include File="Include/Constants_inc.asp"-->
  22. <%
  23.     'In order to delete the template, the user must be the template owner or must be an admin
  24.     If IsUserTemplateOwner(Request.QueryString("TemplateID")) = False And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
  25.         Response.Redirect "AccessDenied.asp?SurveyID=" & Request.QueryString("SurveyID") & "&Reason=" & SUR_ACCESS_DENIED_NOT_TEMPLATE_OWNER
  26.     End If
  27.  
  28.     Dim strSQL
  29.     Dim conDelete
  30.  
  31.     'Initialization
  32.     Set conDelete = Server.CreateObject("ADODB.Connection")
  33.     conDelete.Open SURVEY_APP_CONNECTION
  34.  
  35.     'Delete the template from the template table (SUR_TEMPLATE)
  36.     strSQL = "DELETE FROM sur_template WHERE template_id = " & Request.QueryString("TemplateID")
  37.     conDelete.Execute ConvertSQL(strSQL), , adCmdText
  38.  
  39.     'Clean up
  40.     conDelete.Close
  41.     Set conDelete = Nothing
  42.  
  43.     'Redirect to the main list of templates
  44.     Response.Redirect "TemplateList.asp"
  45. %>