Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: bf1b0c7938
Fetching contributors…

Cannot retrieve contributors at this time

75 lines (64 sloc) 3.93 KB
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
* $Id: resetsurveylogic.php 11664 2011-12-16 05:19:42Z tmswhite $
//Ensure script is not run directly, avoid path disclosure
$ok = returnglobal('ok');
$resetsurveylogicoutput = "<br />\n";
$resetsurveylogicoutput .= "<table class='alertbox' >\n";
$resetsurveylogicoutput .= "\t<tr ><td colspan='2' height='4'><font size='1'><strong>".$clang->gT("Reset Survey Logic")."</strong></font></td></tr>\n";
if (!isset($surveyid) || !$surveyid)
$resetsurveylogicoutput .= "\t<tr ><td align='center'>\n";
$resetsurveylogicoutput .= "<br /><font color='red'><strong>".$clang->gT("Error")."</strong></font><br />\n";
$resetsurveylogicoutput .= $clang->gT("You have not selected a survey to delete")."<br /><br />\n";
$resetsurveylogicoutput .= "<input type='submit' value='".$clang->gT("Main Admin Screen")."' onclick=\"'$scriptname', '_top')\">\n";
$resetsurveylogicoutput .= "</td></tr></table>\n";
$resetsurveylogicoutput .= "</body>\n</html>";
if (!isset($ok) || !$ok)
$resetsurveylogicoutput .= "\t<tr>\n";
$resetsurveylogicoutput .= "\t\t<td align='center'><br />\n";
$resetsurveylogicoutput .= "\t\t\t<font color='red'><strong>".$clang->gT("Warning")."</strong></font><br />\n";
$resetsurveylogicoutput .= "\t\t\t<strong>".$clang->gT("You are about to delete all conditions on this survey's questions")." ($surveyid)</strong><br /><br />\n";
$resetsurveylogicoutput .= "\t\t\t".$clang->gT("We recommend that before you proceed, you export the entire survey from the main administration screen.")."\n";
$resetsurveylogicoutput .= "\t\t</td>\n";
$resetsurveylogicoutput .= "\t</tr>\n";
$resetsurveylogicoutput .= "\t<tr>\n";
$resetsurveylogicoutput .= "\t\t<td align='center'><br />\n";
$resetsurveylogicoutput .= "\t\t\t<input type='submit' value='".$clang->gT("Cancel")."' onclick=\"'admin.php?sid=$surveyid', '_top')\" /><br />\n";
// $resetsurveylogicoutput .= "\t\t\t<input type='submit' value='".$clang->gT("Delete")."' onclick=\"'$scriptname?action=resetsurveylogic&amp;sid=$surveyid&amp;ok=Y','_top')\" />\n";
$resetsurveylogicoutput .= "\t\t\t<input type='submit' value='".$clang->gT("Delete")."' onclick=\"".get2post("$scriptname?action=resetsurveylogic&amp;sid=$surveyid&amp;ok=Y")."\" />\n";
$resetsurveylogicoutput .= "\t\t</td>\n";
$resetsurveylogicoutput .= "\t</tr>\n";
$resetsurveylogicoutput .= "\n";
else //delete conditions in the survey
$dict = NewDataDictionary($connect);
$resetlogicquery = "DELETE FROM {$dbprefix}conditions WHERE qid in (select qid from {$dbprefix}questions where sid=$surveyid)";
$resetlogicresult = $connect->Execute($resetlogicquery) or safe_die ("Couldn't delete conditions<br />$resetlogicquery<br />".$connect->ErrorMsg());
$resetsurveylogicoutput .= "\t<tr>\n";
$resetsurveylogicoutput .= "\t\t<td align='center'><br />\n";
$resetsurveylogicoutput .= "\t\t\t<strong>".$clang->gT("All conditions in this survey have been deleted.")."<br /><br />\n";
$resetsurveylogicoutput .= "\t\t\t<input type='submit' value='".$clang->gT("Continue")."' onclick=\"'$scriptname?sid=$surveyid', '_top')\" />\n";
$resetsurveylogicoutput .= "\t\t</strong></td>\n";
$resetsurveylogicoutput .= "\t</tr>\n";
$resetsurveylogicoutput .= "</table><br />&nbsp;\n";
Jump to Line
Something went wrong with that request. Please try again.