gT("Browse Responses"));
$browseoutput = "";
if (!$database_exists) //DATABASE DOESN'T EXIST OR CAN'T CONNECT
{
$browseoutput .= "\t
"
. $clang->gT("Browse Responses")."
"
.$clang->gT("Error")."\t
\n"
. $clang->gT("The defined LimeSurvey database does not exist")." \n"
. $clang->gT("Either your selected database has not yet been created or there is a problem accessing it.")."
\n"
." \n"
."
";
return;
}
if (!$surveyid && !$subaction) //NO SID OR ACTION PROVIDED
{
$browseoutput .= "\t
"
. $clang->gT("Browse Responses")."
\n"
."\t
\n"
."".$clang->gT("Error")." \n"
. $clang->gT("You have not selected a survey to browse.")."
\n"
." \n"
."
\n";
return;
}
$js_admin_includes[]='scripts/browse.js';
//CHECK IF SURVEY IS ACTIVATED AND EXISTS
$actquery = "SELECT * FROM ".db_table_name('surveys')." as a inner join ".db_table_name('surveys_languagesettings')." as b on (b.surveyls_survey_id=a.sid and b.surveyls_language=a.language) WHERE a.sid=$surveyid";
$actresult = db_execute_assoc($actquery);
$actcount = $actresult->RecordCount();
if ($actcount > 0)
{
while ($actrow = $actresult->FetchRow())
{
$surveytable = db_table_name("survey_".$actrow['sid']);
$tokentable = $dbprefix."tokens_".$actrow['sid'];
/*
* DO NEVER EVER PUT VARIABLES AND FUNCTIONS WHICH GIVE BACK DIFFERENT QUOTES
* IN DOUBLE QUOTED(' and " and \" is used) JAVASCRIPT/HTML CODE!!! (except for: you know what you are doing)
*
* Used for deleting a record, fix quote bugs..
*/
$surveytableNq = db_table_name_nq("survey_".$surveyid);
$surveyname = "{$actrow['surveyls_title']}";
if ($actrow['active'] == "N") //SURVEY IS NOT ACTIVE YET
{
$browseoutput .= "\t
"
. $clang->gT("Browse Responses").": $surveyname
\n"
."\t
\n"
."".$clang->gT("Error")." \n"
. $clang->gT("This survey has not been activated. There are no results to browse.")."