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 >
Wrap
Text File
|
2006-10-25
|
2KB
|
50 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page changes the status of the report sharing for a survey.
' The two possible values are Enabled and Disabled.
'
' COPYRIGHT NOTICE
'
' See attached Software License Agreement
'
' (c) Copyright 2002 - 2006 by ClassApps.com. All rights reserved.
'***********************************************************************
%>
<!--#Include File="Include/Config_inc.asp"-->
<!--#Include File="Include/SurveyUtility_inc.asp"-->
<!--#Include File="Include/Utility_inc.asp"-->
<!--#Include File="Include/adovbs_inc.asp"-->
<!--#Include File="Include/CurrentUser_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<%
'In order to change the status of results sharing, the user must be the survey owner or an admin
If IsUserOwnerOrAdmin(Request.QueryString("SurveyID")) = False Then
Response.Redirect "AccessDenied.asp?SurveyID=" & Request.QueryString("SurveyID") & "&Reason=" & SUR_ACCESS_DENIED_NOT_OWNER_FOR_RESULTS_SHARING
End If
Dim strSQL
Dim conChangeStatus
Dim lngSurveyID
'Initialization
lngSurveyID = Request.QueryString("SurveyID")
Set conChangeStatus = Server.CreateObject("ADODB.Connection")
conChangeStatus.Open SURVEY_APP_CONNECTION
'Update the status of the report sharing for this survey
strSQL = "UPDATE sur_survey " & _
"SET report_sharing_enabled_yn = " & SQLEncode(Request.QueryString("Enabled")) & _
" WHERE survey_id = " & lngSurveyID
conChangeStatus.Execute ConvertSQL(strSQL), , adCmdText
'Clean up
conChangeStatus.Close
Set conChangeStatus = Nothing
'Redirect back to the main list of report shares for this survey
Response.Redirect "ReportShareList.asp?SurveyID=" & lngSurveyID & "&SurveyName=" & Request.QueryString("SurveyName")
%>