protected function set_template_variables()
 {
     Default_View::set_template_variables();
     $validation_form_errors = $this->controller->validate_form();
     //var_dump($validation_form_errors);
     if (empty($validation_form_errors)) {
         $save_form_return_value = $this->model->save_form();
         //var_dump($save_form_return_value);
         if ($save_form_return_value === 'record exists') {
             $this->template_variables['error_message'] = "We already have a record for the selected academic year. You can only submit one application for a particular year.";
         } else {
             if ($save_form_return_value === true) {
                 $academic_year = $this->model->get_academic_year_pv();
                 if (!empty($academic_year)) {
                     $year_range = $this->controller->get_academic_year_range($academic_year);
                     $this->template_variables['year_range'] = $year_range;
                 }
             } else {
                 if ($save_form_return_value === false) {
                     $this->template_variables['error_message'] = "An unexpected error occured due to which form did not get saved.";
                 }
             }
         }
     } else {
         if (!empty($validation_form_errors['submit'])) {
             //Form did not get submitted via standard
             $this->template_variables['error_message'] = "This is an unexpected situation. Form did not get saved.";
         } else {
             $this->model->set_template_uri('template/faform-template.php');
             $this->template_variables['template_uri'] = $this->model->get_template_uri();
             parent::set_template_variables();
             $this->template_variables['validation_form_errors'] = $validation_form_errors;
             //set the existing form values
             $this->template_variables['selected_academic_year'] = $this->model->get_academic_year_pv();
             $this->template_variables['selected_attend_summer'] = $this->model->get_attend_summer_pv();
             $this->template_variables['selected_attend_college'] = $this->model->get_attend_college_pv();
             $this->template_variables['selected_hold_college_degree'] = $this->model->get_hold_college_degree_pv();
             $this->template_variables['selected_type_of_degree'] = $this->model->get_type_of_degree_pv();
             $this->template_variables['selected_program_of_study'] = $this->model->get_program_of_study_pv();
             $this->template_variables['selected_third_party_funding'] = $this->model->get_third_party_funding_pv();
             $this->template_variables['selected_funding_amount'] = $this->model->get_funding_amount_pv();
             $this->template_variables['selected_funding_source'] = $this->model->get_funding_source_pv();
             $this->template_variables['selected_apply_for_fa'] = $this->model->get_apply_for_fa_pv();
             $this->template_variables['selected_types_of_loan'] = $this->model->get_types_of_loan_pv();
             $this->template_variables['selected_require_loan_quarters'] = $this->model->get_require_loan_quarters_pv();
             $this->template_variables['selected_anticipated_credits_for_quarter'] = $this->model->get_anticipated_credits_for_quarter_pv();
             $this->template_variables['selected_expected_graduation_date'] = $this->model->get_expected_graduation_date_pv();
             //				$this->template_variables['selected_release_student_info_box1'] = $this->model->get_release_student_info_box1_pv();
             //				$this->template_variables['selected_release_student_info_box2'] = $this->model->get_release_student_info_box2_pv();
             //				$this->template_variables['selected_auth_rep_name1'] = $this->model->get_auth_rep_name1_pv();
             //				$this->template_variables['selected_auth_rep_name2'] = $this->model->get_auth_rep_name2_pv();
             //				$this->template_variables['selected_fa_contract_agreement'] = $this->model->get_fa_contract_agreement_pv();
             //				$this->template_variables['selected_signature'] = $this->model->get_signature_pv();
         }
     }
 }
 protected function set_template_variables()
 {
     parent::set_template_variables();
     $this->template_variables['form_post_url'] = $this->model->get_form_post_url();
     //user information
     $user_sid = $this->model->get_sid();
     if (!empty($user_sid)) {
         /*
          *  If the user has submitted application for all the available academic years, update the template
          * 
          */
         $already_submitted_app_qtr_ids = $this->controller->already_submitted_application_year();
         $length_already_sub_apps = count($already_submitted_app_qtr_ids);
         $count = 0;
         foreach ($already_submitted_app_qtr_ids as $key => $val) {
             if ($already_submitted_app_qtr_ids[$key] != true) {
                 break;
             }
             $count++;
         }
         if ($length_already_sub_apps == $count) {
             $this->model->set_template_uri('template/available-years-submitted-template.php');
             $this->template_variables['template_uri'] = $this->model->get_template_uri();
         }
         $year_quarter_information = $this->controller->get_academic_year_option_and_values();
         //var_dump($already_submitted_app_qtr_ids);
         $this->template_variables["already_submitted_app_qtr_ids"] = $already_submitted_app_qtr_ids;
         $this->template_variables["year_quarter_information"] = $year_quarter_information;
         //Quarters
         $quarters = $this->controller->get_all_quarter_options_available();
         $this->template_variables["quarters"] = $quarters;
         $types_of_loan = $this->model->get_types_of_loan_options();
         $this->template_variables["types_of_loan"] = $types_of_loan;
         $credit_options = $this->model->get_credit_options();
         $this->template_variables["credit_options"] = $credit_options;
         $types_of_degree = $this->model->get_types_of_degree_options();
         $this->template_variables["types_of_degree"] = $types_of_degree;
         $program_of_study_options = $this->model->get_program_of_study_options();
         $this->template_variables["program_of_study_options"] = $program_of_study_options;
         $expected_graduation_year_array = $this->model->get_expected_graduation_year_array();
         $this->template_variables["expected_graduation_year_array"] = $expected_graduation_year_array;
     } else {
         /*
         	If the logged in user does not have a record in student table, update the template
         */
         $this->model->set_template_uri('template/not-a-student-template.php');
         $this->template_variables['template_uri'] = $this->model->get_template_uri();
     }
     // Year Quarter
 }
        $template_uri = 'template/after-submission-template.php';
        $model = new Form_Post_Model($template_uri, $form_post_url, $_POST);
        $controller = new Form_Post_Controller($model);
        $view = new Form_Post_View($controller, $model);
        echo $view->render();
        break;
        /*
         * Display error page in case default
         */
    /*
     * Display error page in case default
     */
    default:
        require_once 'view/default-view.php';
        $model = new Default_Model('template/error-404-template.php');
        $view = new Default_View(NULL, $model);
        // View and controller actions.
        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
        echo $view->render();
        break;
}
/*
	Check to make sure all configuration variables are not empty
*/
function check_configuration()
{
    if (empty($GLOBALS['AUTH_TYPE'])) {
        return false;
    }
    if (!empty($GLOBALS['AUTH_TYPE']) && $GLOBALS['AUTH_TYPE'] == 'CAS' && (empty($GLOBALS['CAS_SERVER_HOSTNAME']) || empty($GLOBALS['CAS_SERVER_PORT']) || empty($GLOBALS['CAS_SERVER_PATH']) || empty($GLOBALS['CAS_VERSION']) || empty($GLOBALS['CAS_LIBRARY_PATH']))) {
        return false;
 public function __construct()
 {
     $this->layoutElementMap = array("topbar" => Topbar_MainPage::create(), "leftbar" => Leftbar_MainPage::create(), "footer" => Footer_MainPage::create(), "contentview" => Default_View::create(), "header" => HeaderImpl::create());
     $this->layoutElementMap["header"]->addHeaderElem('<link rel="stylesheet" type="text/css" href="' . Registry::$settings['config']['CSS_PATH'] . 'main_page_layout.css">');
 }
Esempio n. 5
0
// Check to make sure we are hosted out of the correct directory
if ($base_uri !== substr($request_uri, 0, strlen($base_uri))) {
    $error_message = 'The BASE_URI constant does not match the requested ' . 'URI. Please review the configuration.php file and set BASE_URI to ' . 'the appropriate path';
    throw new Exception($error_message);
}
// Redirect to HTTPS
if (!isset($_SERVER['HTTPS'])) {
    $url = 'https://' . $request_host . $request_uri;
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: ' . $url);
    exit;
}
/** @var string Contains $request_uri minus $base_uri  */
$application_uri = substr($request_uri, strlen($base_uri));
switch ($application_uri) {
    case '/general-admissions':
        require_once 'model/student-info-payment-model.php';
        require_once 'view/student-info-payment-view.php';
        $model = new Student_Info_Payment_Model('template/general-admissions-fee-to-cybersource-template.php', GLOBALS_PATH, GLOBALS_URL, DEFAULT_BILL_TO_ADDRESS_COUNTRY, DEFAULT_BILL_TO_ADDRESS_STATE, CURRENCY, CYBERSOURCE_ACCESS_KEY, CYBERSOURCE_LOCALE, CYBERSOURCE_PROFILE_ID, CYBERSOURCE_SECRET_KEY, CYBERSOURCE_FORM_POST_URL, 'General Admissions Fee', '1', '34.00', DEFAULT_TRANSACTION_TYPE);
        $controler = NULL;
        $view = new Student_Info_Payment_View($controler, $model);
        echo $view->get_output();
        break;
    default:
        require_once 'model/default-model.php';
        require_once 'view/default-view.php';
        $model = new Default_Model('template/error-404-template.php', GLOBALS_PATH, GLOBALS_URL);
        $view = new Default_View(NULL, $model);
        header('HTTP/1.1 404 Not Found');
        echo $view->get_output();
}