From 6883c0c2c6c6b66c92a34d5ecf30ddc5919b0cb0 Mon Sep 17 00:00:00 2001 From: Jason Cleeland Date: Sun, 12 Sep 2004 03:05:04 +0000 Subject: [PATCH] NEW: Simple script to allow browsing/deleting/modifying "saved" survey sessions. Currently allows admins to delete or "edit" saved sessions. Still to add a "remind" feature which will allow admins to send emails to those who have saved sessions reminding them to complete the survey. git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1171 b72ed6b6-b9f8-46b5-92b4-906544132732 --- admin/saved.php | 136 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 admin/saved.php diff --git a/admin/saved.php b/admin/saved.php new file mode 100644 index 00000000000..f748f5d2d5b --- /dev/null +++ b/admin/saved.php @@ -0,0 +1,136 @@ +>> PHP Surveyor # + ############################################################# + # > Author: Jason Cleeland # + # > E-mail: jason@cleeland.org # + # > Mail: Box 99, Trades Hall, 54 Victoria St, # + # > CARLTON SOUTH 3053, AUSTRALIA # + # > Date: 20 February 2003 # + # # + # This set of scripts allows you to develop, publish and # + # perform data-entry on surveys. # + ############################################################# + # # + # Copyright (C) 2003 Jason Cleeland # + # # + # This program is free software; you can redistribute # + # it and/or modify it under the terms of the GNU General # + # Public License as published by the Free Software # + # Foundation; either version 2 of the License, or (at your # + # option) any later version. # + # # + # This program is distributed in the hope that it will be # + # useful, but WITHOUT ANY WARRANTY; without even the # + # implied warranty of MERCHANTABILITY or FITNESS FOR A # + # PARTICULAR PURPOSE. See the GNU General Public License # + # for more details. # + # # + # You should have received a copy of the GNU General # + # Public License along with this program; if not, write to # + # the Free Software Foundation, Inc., 59 Temple Place - # + # Suite 330, Boston, MA 02111-1307, USA. # + ############################################################# +*/ +include_once("config.php"); +$sid=returnglobal('sid'); +$action=returnglobal('action'); +if (!$sid) {echo _ERROR;} + +sendcacheheaders(); + +$thissurvey=getSurveyInfo($sid); +echo $htmlheader; + +if ($action == "delete" && $sid) + { + $query = "DELETE FROM {$dbprefix}saved\n" + ."WHERE sid=$sid\n" + ."AND identifier='".returnglobal('identifier')."'"; + $result = mysql_query($query) or die("Couldn't delete
$query
".mysql_error()); + } + +echo "
\n" + ."\n"; +echo "\t\n"; +echo savedmenubar(); +echo "
" + . _BROWSESAVED.": ".$thissurvey['name']."
\n"; +echo "
\n" + ."\n"; +echo "
"; +switch ($action) + { + case "all": + case "delete": + showSavedList($sid); + break; + default: + echo "
".$setfont._SV_RESPONSES . " ". getSavedCount($sid)."
"; + } +echo "
\n"; + +function showSavedList($sid) + { + global $dbprefix; + $query = "SELECT COUNT(*) as counter, identifier, saved_ip, saved_date, email, access_code\n" + ."FROM {$dbprefix}saved\n" + ."WHERE sid=$sid\n" + ."GROUP BY identifier\n" + ."ORDER BY saved_date desc"; + $result = mysql_query($query) or die ("Couldn't summarise saved entries
$query
".mysql_error()); + if (mysql_num_rows($result) > 0) + { + echo "\n"; + echo "" + ."\n"; + while($row=mysql_fetch_array($result)) + { + echo "" + ."" + ."" + ."" + ."" + ."" + ."" + ."\n"; + } // while + echo "
"._SV_IDENTIFIER."" + ._SV_IP."" + ._SV_DATE."" + ._EMAIL."" + ._SV_RESPONSECOUNT."" + ._AL_ACTION."
".$row['identifier']."".$row['saved_ip']."".$row['saved_date']."".$row['email']."".$row['counter']."" + ."["._DELETE."]" + ."["._SV_REMIND."]" + ."["._SV_EDIT."]" + ."
\n"; + } + } + +function savedmenubar() + { + global $sid, $scriptname, $imagefiles; + //BROWSE MENU BAR + if (!isset($surveyoptions)) {$surveyoptions="";} + $surveyoptions .= "\t\n" + . "\t\t\n" + . "\t\t\t\n" + . "\t\t\t-\n" + . "\t\t\t|\n" + . "\t\t\t\n" + . "\t\t\t\n" + //. "\t\t\t\n" + . "\t\t\t\n" + . "\t\t\n" + . "\t\n"; + return $surveyoptions; + } +?> \ No newline at end of file