Example #1
0
        //Check for assessments
        $assessments = doAssessment($surveyid);
        if ($assessments)
        {
            $content .= templatereplace(file_get_contents("$thistpl/assessment.pstpl"));
        }

        // Unsetting $postedfieldnames tells the createinsertquery() function only to set the sbumit date, nothing else
        unset($postedfieldnames);

        // only update submitdate if the user did not already visit the submit page
        if (!isset($_SESSION['finished']))
        {
            //            $subquery = createinsertquery();
            //            $connect->Execute($subquery);   // Checked
            submitanswer();
        }


        //Survey end text
        if (trim(strip_tags($thissurvey['surveyls_endtext']))=='')
        {
            $completed = "<br /><span class='success'>".$clang->gT("Thank you!")."</span><br /><br />\n\n"
            . $clang->gT("Your survey responses have been recorded.")."<br /><br />\n";
        }
        else
        {
            $completed = $thissurvey['surveyls_endtext'];
        }

        // Link to Print Answer Preview  **********
Example #2
0
 /**
  * savesilent() saves survey responses when the "Resume later" button
  * is press but has no interaction. i.e. it does not ask for email,
  * username or password or capture.
  *
  * @return string confirming successful save.
  */
 function savedsilent()
 {
     global $surveyid, $thissurvey, $errormsg, $publicurl, $sitename, $timeadjust, $clang, $clienttoken, $thisstep;
     submitanswer();
     // Prepare email
     $tokenentryquery = 'SELECT * from {{tokens_' . $surveyid . '}} WHERE token=\'' . sanitize_paranoid_string($clienttoken) . '\';';
     $tokenentryresult = dbExecuteAssoc($tokenentryquery);
     $tokenentryarray = $tokenentryresult->read();
     $from = $thissurvey['adminname'] . ' <' . $thissurvey['adminemail'] . '>';
     $to = $tokenentryarray['firstname'] . ' ' . $tokenentryarray['lastname'] . ' <' . $tokenentryarray['email'] . '>';
     $subject = $clang->gT("Saved Survey Details") . " - " . $thissurvey['name'];
     $message = $clang->gT("Thank you for saving your survey in progress. You can return to the survey at the same point you saved it at any time using the link from this or any previous email sent to regarding this survey.") . "\n\n";
     $message .= $clang->gT("Reload your survey by clicking on the following link (or pasting it into your browser):") . ":\n";
     $language = $tokenentryarray['language'];
     //$message .= "\n\n$publicurl/$surveyid/lang-$language/tk-$clienttoken";
     $message .= "\n\n" . Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$surveyid}/lang/{$language}/token/{$clienttoken}");
     if (SendEmailMessage($message, $subject, $to, $from, $sitename, false, getBounceEmail($surveyid))) {
         $emailsent = "Y";
     } else {
         $clang->eT('Error: Email failed, this may indicate a PHP Mail Setup problem on your server. Your survey details have still been saved, however you will not get an email with the details. You should note the "name" and "password" you just used for future reference.');
         if (trim($thissurvey['adminemail']) == '') {
             $clang->eT('(Reason: Admin email address empty)');
         }
     }
     return $clang->gT('Your survey was successfully saved.');
 }
Example #3
0
/**
 * savesilent() saves survey responses when the "Resume later" button
 * is press but has no interaction. i.e. it does not ask for email,
 * username or password or capture.
 *
 * @return string confirming successful save.
 */
function savedsilent()
{
    global $connect, $surveyid, $dbprefix, $thissurvey, $errormsg, $publicurl, $sitename, $timeadjust, $clang, $clienttoken, $thisstep, $modrewrite;
    submitanswer();
    // Prepare email
    $tokenentryquery = 'SELECT * from '.$dbprefix.'tokens_'.$surveyid.' WHERE token=\''.sanitize_paranoid_string($clienttoken).'\';';
    $tokenentryresult = db_execute_assoc($tokenentryquery);
    $tokenentryarray = $tokenentryresult->FetchRow();

    $from = $thissurvey['adminname'].' <'.$thissurvey['adminemail'].'>';
    $to = $tokenentryarray['firstname'].' '.$tokenentryarray['lastname'].' <'.$tokenentryarray['email'].'>';
    $subject = $clang->gT("Saved Survey Details") . " - " . $thissurvey['name'];
    $message = $clang->gT("Thank you for saving your survey in progress. You can return to the survey at the same point you saved it at any time using the link from this or any previous email sent to regarding this survey.","unescaped")."\n\n";
    $message .= $clang->gT("Reload your survey by clicking on the following link (or pasting it into your browser):","unescaped")."\n";
    $language = $tokenentryarray['language'];

    if($modrewrite)
    {
        $message .= "\n\n$publicurl/$surveyid/lang-$language/tk-$clienttoken";
    }
    else
    {
        $message .= "\n\n$publicurl/index.php?lang=$language&sid=$surveyid&token=$clienttoken";
    };
    if (SendEmailMessage($message, $subject, $to, $from, $sitename, false, getBounceEmail($surveyid)))
    {
        $emailsent="Y";
    }
    else
    {
        echo "Error: Email failed, this may indicate a PHP Mail Setup problem on your server. Your survey details have still been saved, however you will not get an email with the details. You should note the \"name\" and \"password\" you just used for future reference.";
    };
    return  $clang->gT('Your survey was successfully saved.');
};
Example #4
0
                $_SESSION['step']=$_SESSION['step']+1;
            }
            if ($_SESSION['step']>$_SESSION['totalsteps'])
            {
                // We are skipping groups, but we moved 'off' the last group.
                // Now choose to implement an implicit submit (old behaviour),
                // or create an empty page giving the user the explicit option to submit.
                if (isset($show_empty_group_if_the_last_group_is_hidden) && $show_empty_group_if_the_last_group_is_hidden == true)
                {

                    $show_empty_group = true;
                    break;
                } else
                {
                    $move = "movesubmit";
                    submitanswer(); // complete this answer (submitdate)
                    break;
                }
            }
        }
    }

    //SUBMIT ###############################################################################
    if ((isset($move) && $move == "movesubmit")  && (!isset($notanswered) || !$notanswered) && (!isset($notvalidated) || !$notvalidated ) && (!isset($filenotvalidated) || !$filenotvalidated))
    {
        setcookie ("limesurvey_timers", "", time() - 3600);// remove the timers cookies
        if ($thissurvey['refurl'] == "Y")
        {
            if (!in_array("refurl", $_SESSION['insertarray'])) //Only add this if it doesn't already exist
            {
                $_SESSION['insertarray'][] = "refurl";