C:\$Recycle.Bin\S-1-5-21-3967099092-2644009230-141905953-500\$RAQKNYH\admin\saved.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/*
* 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: saved.php 6606 2009-04-09 18:26:36Z c_schmitz $
*/

include_once("login_check.php");

$surveyid=returnglobal('sid');
$srid=returnglobal('srid');
$scid=returnglobal('scid');
$subaction=returnglobal('subaction');

//Ensure script is not run directly, avoid path disclosure
if (!isset($dbprefix) || isset($_REQUEST['dbprefix'])) {die("Cannot run this script directly");}

$thissurvey=getSurveyInfo($surveyid);
$savedsurveyoutput='';
$surveytable db_table_name("survey_".$surveyid);

if (
$subaction == "delete" && $surveyid && $scid)
{
    
$query "DELETE FROM {$dbprefix}saved_control
              WHERE scid=
$scid
              AND sid=
$surveyid
              "
;
    if (
$result $connect->Execute($query))
    {
        
//If we were succesful deleting the saved_control entry,
        //then delete the rest
        
$query "DELETE FROM {$surveytable} WHERE id={$srid}";
        
$result $connect->Execute($query) or die("Couldn't delete");

    }
    else
    {
        
$savedsurveyoutput .=  "Couldn't delete<br />$query<br />".$connect->ErrorMsg();
    }
}

$savedsurveyoutput .= "<table><tr><td></td></tr></table>\n"
."<table width='99%' align='center' class='menubar'>\n";
$savedsurveyoutput .= "\t<tr><td colspan='2' height='4' class='settingcaption'><strong>"
$clang->gT("Browse Saved Responses").":</strong> ".$thissurvey['name']."</td></tr>\n";
$savedsurveyoutput .= savedmenubar();
$savedsurveyoutput .= "</table>\n";
$savedsurveyoutput .= "<table><tr><td></td></tr></table>\n"
."<table width='99%' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n";
$savedsurveyoutput .= "<tr><td>";

switch (
$subaction)
{
    case 
"all":
    case 
"delete":
    
$savedsurveyoutput .= "<center>".$setfont.$clang->gT("Saved Responses:") . " "getSavedCount($surveyid)."</font></center>";
    
showSavedList($surveyid);
    break;
    default:
    
$savedsurveyoutput .= "<center>".$setfont.$clang->gT("Saved Responses:") . " "getSavedCount($surveyid)."</font></center>";
}
$savedsurveyoutput .= "</td></tr></table><br />&nbsp;\n";

function 
showSavedList($surveyid)
{
    global 
$dbprefix$connect$clang$savedsurveyoutput$scriptname$surveytable;
    
$query "SELECT scid, srid, identifier, ip, saved_date, email, access_code\n"
    
."FROM {$dbprefix}saved_control\n"
    
."WHERE sid=$surveyid\n"
    
."ORDER BY saved_date desc";
    
$result db_execute_assoc($query) or safe_die ("Couldn't summarise saved entries<br />$query<br />".$connect->ErrorMsg());
    if (
$result->RecordCount() > 0)
    {
        
$savedsurveyoutput .= "<table class='outlinetable' cellspacing='0' align='center'>\n";
        
$savedsurveyoutput .= "<tr><th>SCID</th><th>"
        
.$clang->gT("Identifier")."</th><th>"
        
.$clang->gT("IP Address")."</th><th>"
        
.$clang->gT("Date Saved")."</th><th>"
        
.$clang->gT("Email Address")."</th><th>"
        
.$clang->gT("Action")."</th>"
        
."</tr>\n";
        while(
$row=$result->FetchRow())
        {
            
$savedsurveyoutput .= "<tr>
                <td>"
.$row['scid']."</td>
                <td>"
.$row['identifier']."</td>
                <td>"
.$row['ip']."</td>
                <td>"
.$row['saved_date']."</td>
                <td><a href='mailto:"
.$row['email']."'>".$row['email']."</td>
                <td align='center'>
                [<a href='
$scriptname?action=saved&amp;sid=$surveyid&amp;subaction=delete&amp;scid=".$row['scid']."&amp;srid=".$row['srid']."'"
            
." onclick='return confirm(\"".$clang->gT("Are you sure you want to delete this entry?","js")."\")'"
            
.">".$clang->gT("Delete")."</a>]
                [<a href='"
.$scriptname."?action=dataentry&amp;subaction=edit&amp;id=".$row['srid']."&amp;sid={$surveyid}&amp;surveytable={$surveytable}'>".$clang->gT("Edit")."</a>]
                </td>
               </tr>\n"
;
        } 
// while
        
$savedsurveyoutput .= "</table><br />&nbsp\n";
    }
}

//                [<a href='saved.php?sid=$surveyid&amp;action=remind&amp;scid=".$row['scid']."'>".$clang->gT("Remind")."</a>]
//               c_schmitz: Since its without function at the moment i removed it from the above lines

function savedmenubar()
{
    global 
$surveyid$scriptname$imagefiles$clang;
    
//BROWSE MENU BAR
    
if (!isset($surveyoptions)) {$surveyoptions="";}
    
$surveyoptions .= "\t<tr>\n"
    
"\t\t<td>\n"
    
"\t\t\t<a href='$scriptname?sid=$surveyid' onmouseout=\"hideTooltip()\" " .
            
"onmouseover=\"showTooltip(event,'".$clang->gT("Return to Survey Administration""js")."')\" >" .
            
"<img name='Administration' src='$imagefiles/home.png' title='' align='left'></a>\n"
    
"\t\t\t<img src='$imagefiles/blank.gif' alt='' width='11' border='0' hspace='0' align='left'>\n"
    
"\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>\n"
    
"\t\t\t<a href='$scriptname?action=saved&amp;sid=$surveyid' onmouseout=\"hideTooltip()\" " .
            
"onmouseover=\"showTooltip(event,'".$clang->gT("Show summary information""js")."')\">" .
            
"<img name='SurveySummary' src='$imagefiles/summary.png' title=''  align='left'></a>\n"
    
"\t\t\t<a href='$scriptname?action=saved&amp;sid=$surveyid&amp;subaction=all' onmouseout=\"hideTooltip()\" onmouseover=\"showTooltip(event,'".$clang->gT("Display Responses""js")."')\">" .
    
"<img name='ViewAll' src='$imagefiles/document.png' title=''  align='left'></a>\n"
    
//. "\t\t\t<input type='image' name='ViewLast' src='$imagefiles/viewlast.png' title='"
    //. $clang->gT("Display Last 50 Responses")."'  align='left'  onclick=\"window.open('saved.php?sid=$surveyid&action=all&limit=50&order=desc', '_top')\">\n"
    
"\t\t\t<img src='$imagefiles/seperator.gif' border='0' hspace='0' align='left' alt=''>\n"
    
"\t\t</td>\n"
    
"\t</tr>\n";
    return 
$surveyoptions;
}
?>