home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / ChangeReportSharingStatus.asp < prev    next >
Text File  |  2006-10-25  |  2KB  |  50 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 changes the status of the report sharing for a survey.
  7. '                      The two possible values are Enabled and Disabled.
  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/SurveyUtility_inc.asp"-->
  18. <!--#Include File="Include/Utility_inc.asp"-->
  19. <!--#Include File="Include/adovbs_inc.asp"-->
  20. <!--#Include File="Include/CurrentUser_inc.asp"-->
  21. <!--#Include File="Include/Constants_inc.asp"-->
  22. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  23. <%
  24.     'In order to change the status of results sharing, the user must be the survey owner or an admin
  25.     If IsUserOwnerOrAdmin(Request.QueryString("SurveyID")) = False Then
  26.         Response.Redirect "AccessDenied.asp?SurveyID=" & Request.QueryString("SurveyID") & "&Reason=" & SUR_ACCESS_DENIED_NOT_OWNER_FOR_RESULTS_SHARING
  27.     End If
  28.  
  29.     Dim strSQL
  30.     Dim conChangeStatus
  31.     Dim lngSurveyID
  32.     
  33.     'Initialization
  34.     lngSurveyID = Request.QueryString("SurveyID")
  35.     Set conChangeStatus = Server.CreateObject("ADODB.Connection")
  36.     conChangeStatus.Open SURVEY_APP_CONNECTION
  37.  
  38.     'Update the status of the report sharing for this survey
  39.     strSQL = "UPDATE sur_survey " & _
  40.              "SET report_sharing_enabled_yn = " & SQLEncode(Request.QueryString("Enabled")) & _
  41.              " WHERE survey_id = " & lngSurveyID
  42.     conChangeStatus.Execute ConvertSQL(strSQL), , adCmdText
  43.  
  44.     'Clean up
  45.     conChangeStatus.Close
  46.     Set conChangeStatus = Nothing
  47.  
  48.     'Redirect back to the main list of report shares for this survey
  49.     Response.Redirect "ReportShareList.asp?SurveyID=" & lngSurveyID & "&SurveyName=" & Request.QueryString("SurveyName")
  50. %>