Exemple #1
0
//============================================================================================
// Session, configuration file, localization constructor
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
if (!isset($SESSION->lang)) {
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
$profile = new Profile($dbo);
$dass = new DASS($dbo);
if (isset($_GET['student_num']) && ctype_digit($_GET['student_num'])) {
    $studentProfile = $profile->getProfile($_GET['student_num']);
}
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    $thisPage = 'dass';
    if (!empty($studentProfile)) {
        $dassresult = $dass->listDASS($_GET['student_num']);
        $l10n->addResource(__DIR__ . '/l10n/dass.json');
        $viewFile = 'views/dass.php';
    }
} elseif ($_GET['page'] === "view-answers") {
Exemple #2
0
namespace Ventus\Counselling;

//============================================================================================
// Session, configuration file, localization constructor
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
if (isset($SESSION->lang)) {
    $l10n->setLanguage($SESSION->lang);
}
//============================================================================================
// Model and Header and L10N Includes
//============================================================================================
$questionnaire = new Questionnaire($dbo);
$dass = new DASS($dbo);
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['page'])) {
    $l10n->addResource(__DIR__ . '/l10n/intake-form.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/intake-form.php';
    require_once FS_PHP . '/footer-external.php';
} elseif ($_GET['page'] === "add") {
    $questionnaire_id = $questionnaire->addQuestionnaire($_POST);
    $loggers['audit']->info("Questionnaire added");
    $dass->addDASS($questionnaire_id, $_POST);
    $questionnaire->addOrUpdateStudentProfile($_POST);
    $questionnaire->updateSurveyNotificationsStatus($_POST['student_num'], $_POST['consent_to_emails']);