home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey / DeleteReportShare.asp < prev    next >
Text File  |  2006-11-29  |  2KB  |  47 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 report share, and then redirects the
  7. '                     user back to the list of report shares.
  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.     'If the user does not either own this survey or have admin permission, deny them access to this functionality.
  24.     If IsUserOwnerOrAdmin(Request.QueryString("SurveyID")) = False Then
  25.         Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_OWNER_FOR_RESULTS_SHARING
  26.     End If
  27.  
  28.     Dim strSQL
  29.     Dim conDelete
  30.     Dim lngReportShareID
  31.  
  32.     'Initialization
  33.     Set conDelete = Server.CreateObject("ADODB.Connection")
  34.     conDelete.Open SURVEY_APP_CONNECTION
  35.     lngReportShareID = Request.QueryString("ReportShareID")
  36.  
  37.     'Delete the report share from the report share table (SUR_REPORT_SHARE)
  38.     strSQL = "DELETE FROM sur_report_share WHERE report_share_id = " & lngReportShareID
  39.     conDelete.Execute ConvertSQL(strSQL), , adCmdText
  40.  
  41.     'Clean up
  42.     conDelete.Close
  43.     Set conDelete = Nothing
  44.  
  45.     'Redirect to the main list of report shares for the current user
  46.     Response.Redirect "ReportShareList.asp?SurveyID=" & Request.QueryString("SurveyID") & "&SurveyName=" & Request.QueryString("SurveyName")
  47. %>