示例#1
0
    survey_results($sid, $precision, $totals, $qid, $cids);
    return;
}
// may this survey be accessed?
esp_require_once('/lib/espsurvey');
if (survey_status_is_edit($status) || survey_status_is_done($status) || survey_status_is_deleted($status)) {
    $isActive = false;
} else {
    if (survey_status_is_test($status)) {
        if (isset($_REQUEST['test']) && $_REQUEST['test']) {
            $isActive = true;
        } else {
            $isActive = false;
        }
    } else {
        if (STATUS_OPEN !== survey_open($open_date, $close_date)) {
            $isActive = false;
        } else {
            $isActive = true;
        }
    }
}
if (!$isActive) {
    echo mkerror(_('Error processing survey: Survey is not active.'));
    return;
}
if ($request_referer == $ESPCONFIG['autopub_url']) {
    $request_referer .= "?name={$name}";
}
// let's build the correct return/submit/resume link
$action = $ESPCONFIG['proto'] . $_SERVER['HTTP_HOST'] . htmlspecialchars($_SERVER['PHP_SELF']);
示例#2
0
function fetch_availability($survey, &$rc)
{
    $rc = survey_open($survey['open_date'], $survey['close_date']);
    switch ($rc) {
        case STATUS_OPEN:
            return _('Now taking submissions');
            break;
        case STATUS_CLOSED_TOO_EARLY:
            return _('Not yet taking submissions');
            break;
        case STATUS_CLOSED_TOO_LATE:
            return _('No longer taking submissions');
            break;
        default:
            assert('false; // unexpected case reached; code bug');
            return '';
    }
}