//============================================================================================ $model = new Unsubscribe($dbo); require FS_INCLUDES . '/l10n/header-external.php'; $cron = new \Ventus\Calendar\CronJobs($dbo); $cron->runAll(); //============================================================================================ // Load the content //============================================================================================ if (!isset($_GET['hash_link']) || !$model->checkIfStudentExists($_GET['hash_link'])) { $l10n->addResource(__DIR__ . '/l10n/error.json'); require_once FS_PHP . '/header-external.php'; require_once 'views/error.php'; require_once FS_PHP . '/footer-external.php'; } else { $hash_link = $_GET['hash_link']; $student = $model->fetchStudentByHashLink($hash_link); if (!isset($_GET['page'])) { if ($model->checkIfAlreadyUnsubscribed($student['student_id'])) { header("Location: unsubscribe.php?page=complete&hash_link={$hash_link}"); exit; } $l10n->addResource(__DIR__ . '/l10n/unsubscribe.json'); require_once FS_PHP . '/header-external.php'; require_once 'views/unsubscribe.php'; require_once FS_PHP . '/footer-external.php'; } elseif ($_GET['page'] === "complete") { if (!$model->checkIfAlreadyUnsubscribed($student['student_id'])) { header("Location: unsubscribe.php?hash_link={$hash_link}"); exit; } $l10n->addResource(__DIR__ . '/l10n/unsubscribe.json');