public function index() { \helpers\Session::init(); if (\helpers\Session::get('username')) { if (\helpers\Session::get('admin')) { \helpers\url::redirect('exec'); } else { \helpers\url::redirect('welcome'); } } if ($_POST['submit']) { $is_valid = \helpers\gump::is_valid($_POST, array('fname' => 'required|alpha', 'lname' => 'required|alpha', 'dob' => 'required', 'gender' => 'required', 'year' => 'required', 'email' => 'required|valid_email', 'phone' => 'required', 'stunum' => 'required|numeric', 'issue1' => 'required', 'issue2' => 'required', 'issue3' => 'required')); if ($is_valid === true) { $this->submit(); } else { $data['errors'] = $is_valid; } } $data['title'] = "Apply"; $data['questions'] = $this->apply_model->getAllQuestions(); $data['issues'] = $this->apply_model->getAllIssues(); $data['options'] = $this->apply_model->getAllQuestionOptions(); $data['colleges'] = $this->apply_model->getAllColleges(); View::rendertemplate('header', $data); View::render('apply/apply', $data, $error); View::rendertemplate('footer', $data); }
public function GETessay($topic = null) { $view = new View(self::layout); // get all topics $view->content = sprintf("views/prologue/%s.html", $topic); return $view->render($this()); }
public function login() { $data['title'] = 'Login'; View::rendertemplate('header', $data); View::render('auth/login', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (Session::get('admin')) { Url::redirect('exec'); } } else { Url::redirect(''); } $data['title'] = 'Wishlist'; $tripId = \helpers\Session::get("tripId"); $data['applicants'] = $this->mab->get_wishlist($tripId); $data['roster'] = $this->mab->get_official_roster($tripId); foreach ($data['applicants'] as $applicants_info) { $applicants_info->age = $this->mab->get_age_at_time($applicants_info->dateOfBirth, date('Y-m-d', time())); } if (isset($_POST['draft'])) { $trip_id = $this->mab->verify_applicant($_POST['applicationId']); if ($trip_id == NULL) { $this->mab->add_to_trip($_POST['applicationId'], $tripId); $this->mab->applicant_becomes_person($_POST['applicationId']); $this->mab->person_becomes_trip_member($_POST['applicationId'], $tripId); } else { if ($trip_id == $tripId) { echo 'This is your participant'; } else { echo 'Application has already been drafted.'; } } } View::rendertemplate('header', $data); View::render('wishlist/wishlist', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Application Analytics'; $data['gender'] = $this->mab->get_gender(); $data['yearsInSchool'] = $this->mab->get_years_in_school(); $data['apps'] = $this->mab->get_apps_by_issue(); $data['apps1'] = $this->mab->get_apps_by_issue_rank(1); $data['apps2'] = $this->mab->get_apps_by_issue_rank(2); $data['apps3'] = $this->mab->get_apps_by_issue_rank(3); $data['apps_by_college'] = $this->mab->get_apps_by_college(); $data['marketing_data'] = $this->mab->get_marketing_data(); $data['issues'] = $this->apply_model->getAllIssues(); if (isset($_POST['submit'])) { $issueId = $_POST['issues']; $data['issues_by_gender'] = $this->mab->get_issues_by_gender($issueId); } View::rendertemplate('exec_header', $data); View::render('analytics/application_analytics', $data, $error); View::rendertemplate('footer', $data); }
/** * Define Subpage page title and load template files */ public function subpage() { $data['title'] = $this->language->get('subpage_text'); $data['welcome_message'] = $this->language->get('subpage_message'); View::rendertemplate('header', $data); View::render('welcome/subpage', $data); View::rendertemplate('footer', $data); }
public function category() { $this->check_cookie(); View::renderTemplate('header', $data); View::renderTemplate('nav', $data); View::render('settings/category', $data); View::renderTemplate('main_bottom', $data); View::renderTemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Register Trip'; $data['site_leaders'] = $this->mab->list_of_site_leaders(); $data['seasons'] = $this->mab->get_seasons(); $data['issues'] = $this->mab->get_issues(); $data['site_leaders'] = $this->mab->get_site_leaders(); $data['site_leader_names'] = array(); foreach ($data['site_leaders'] as $site_leader) { //$site_leader->fullName = site_leader->firstName; array_push($data['site_leader_names'], $site_leader->firstName . ' ' . $site_leader->lastName); } $data['issues_names'] = array(); foreach ($data['issues'] as $issue) { array_push($data['issues_names'], $issue->issueName); } $data['season_names'] = array(); foreach ($data['seasons'] as $season) { array_push($data['season_names'], $season->name); } $issue = $_POST['issue']; $site_leader1 = $_POST['site_leader1']; $site_leader2 = $_POST['site_leader2']; $userName = $_POST['user_name']; $seasonId = $_POST['season']; if (isset($_POST['create_trip_account'])) { $tripId = $this->mab->create_trip_account($issue, $userName, $seasonId); if ($tripId == 0) { echo 'YOU F****D UP'; } else { $this->mab->update_site_leaders($tripId, $site_leader1); $this->mab->update_site_leaders($tripId, $site_leader2); $valid_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNIPQRSTUVWXYZ0123456789'; $salt = $this->password->generate_salt(); $random_password = $this->password->get_random_password($valid_chars, 10); $passhash = $this->password->get_hash($random_password, $salt); $this->mab->insert_into_auth($tripId, $passhash, $salt); echo $random_password; //burnnnedd //M7gho1LC1j //winter1 - hycocsvxGD } } View::rendertemplate('exec_header', $data); View::render('register/registerTrip', $data, $error); View::rendertemplate('footer', $data); }
protected function GETnotes(Student $student, $topic, $index) { $view = new View(self::layout); $this->evaluation = Data::FACTORY($topic, $student->evaluation($topic, $index)); $this->url = $student->context['@url'] . "/{$topic}/{$index}"; $this->files = \models\Assessment::Links($this->url); $this->template = 'editor'; $view->context = "views/layouts/notes.html"; $view->content = "views/layouts/inspector.html"; return $view->render($this()); }
public function cat($slug) { $pages = new Paginator('10', 'page'); $pages->set_total(count($this->_model->getcatposttotal($slug))); $data['posts'] = $this->_model->getcatposts($slug, $pages->get_limit()); $data['page_links'] = $pages->page_links(); $data['cats'] = $this->_model->getcats(); $data['title'] = $data['posts'][0]->catTitle; View::rendertemplate('header', $data); View::render('blog/cats', $data); View::rendertemplate('footer', $data); }
public function index() { \helpers\Session::init(); if (\helpers\Session::get('username')) { if (\helpers\Session::get('admin')) { \helpers\url::redirect('exec'); } else { \helpers\url::redirect('welcome'); } } $data['title'] = "Login"; View::rendertemplate('header', $data); View::render('login/login', $data); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (Session::get('admin')) { Url::redirect('exec'); } } else { Url::redirect(''); } $data['title'] = 'Draft Board'; View::rendertemplate('header', $data); View::render('draft/draft', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Register Site Leader'; View::rendertemplate('exec_header', $data); View::render('createAccount/createAccount', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Board of Directors'; $data['board_of_directors'] = $this->mab->get_board_of_directors(); View::rendertemplate('exec_header', $data); View::render('board/board', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Site Leaders'; $data['site_leaders'] = $this->mab->get_site_leaders(); View::rendertemplate('exec_header', $data); View::render('siteLeader/siteLeader', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Trip Board'; $data['seasons'] = $this->registerTrip->get_seasons(); $data['trips'] = $this->mab->get_trip_information($_POST['seasonId']); View::rendertemplate('exec_header', $data); View::render('trips/tripBoard', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Register Site Leader'; $data['seasons'] = $this->mabTrip->get_seasons(); $data['season_names'] = array(); foreach ($data['seasons'] as $season) { array_push($data['season_names'], $season->name); } $first_name = htmlspecialchars($_POST['first_name']); $last_name = htmlspecialchars($_POST['last_name']); $gender = $_POST['gender']; $hometown = $_POST['hometown']; $schoolYear = $_POST['schoolYear']; $email = htmlspecialchars($_POST['email']); $phone_num = htmlspecialchars($_POST['phone_num']); $dob_arr = explode("/", $_POST['date_of_birth']); $birthday = $dob_arr[2] . "-" . $dob_arr[0] . "-" . $dob_arr[1]; $seasonId = $_POST['seasonId']; $is_valid = \helpers\gump::is_valid($_POST, array('first_name' => 'required|alpha', 'last_name' => 'required|alpha', 'gender' => 'required', 'email' => 'required|valid_email', 'phone_num' => 'required', 'date_of_birth' => 'required', 'seasonId' => 'required', 'hometown' => 'required', 'schoolYear' => 'required')); $site_leader_insert_error = ""; if ($is_valid === true) { if (isset($_POST['insert_site_leader'])) { $personId = $this->mab->insert_person($first_name, $last_name, $gender, $email, $phone_num, $birthday, $hometown, $schoolYear); if ($personId == 0) { $site_leader_insert_error = "Site leader's email address already exists."; } else { $this->mab->insert_is_a_site_leader($personId, $seasonId); } } } else { $data['errors'] = $is_valid; } View::rendertemplate('exec_header', $data); View::render('register/registerSiteLeader', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = 'Trip Analytics'; $data['trips'] = $this->mab->num_of_trips(); $data['gender'] = $this->mab->get_gender(); $data['yearsInSchool'] = $this->mab->get_years_in_school(); $data['states'] = $this->mab->get_states(); View::rendertemplate('exec_header', $data); View::render('analytics/trip_analytics', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (Session::get('admin')) { Url::redirect('exec'); } } else { Url::redirect(''); } $data['title'] = 'Applications'; $tripId = \helpers\Session::get("tripId"); $data['applicants'] = $this->mab->get_all_applications(Session::get('tripId')); $data['applicants1'] = array(); $data['applicants2'] = array(); $data['applicants3'] = array(); foreach ($data['applicants'] as $applicants_info) { $applicants_info->age = $this->mab->get_age_at_time($applicants_info->dateOfBirth, date('Y-m-d', time())); if ($applicants_info->iid1 == Session::get('issueId')) { $data['applicants1'][] = $applicants_info; } else { if ($applicants_info->iid2 == Session::get('issueId')) { $data['applicants2'][] = $applicants_info; } else { if ($applicants_info->iid3 == Session::get('issueId')) { $data['applicants3'][] = $applicants_info; } } } } $data['question'] = $this->mab->application_questions(); if (isset($_POST['add_application'])) { $applicationId = $_POST['aid']; $rating = $_POST['rating']; $notes = $_POST['notes']; $this->mab->add_to_wishlist($applicationId, $rating, $notes, $tripId); } $data['question'] = $this->mab->application_questions(); View::rendertemplate('header', $data); View::render('applications/applications', $data, $error); View::rendertemplate('footer', $data); }
public function index($password = NULL) { Session::init(); if (Session::get('username')) { if (!Session::get('admin')) { Url::redirect('welcome'); } } else { Url::redirect(''); } $data['title'] = "Register Board Member"; $data['seasons'] = $this->mabTrip->get_seasons(); $data['season_names'] = array(); $data['password'] = $password; foreach ($data['seasons'] as $season) { $data['season_names'][] = $season->name; } View::rendertemplate('exec_header', $data); View::render('register/registerAdmin', $data, $error); View::rendertemplate('footer', $data); }
public function create() { Session::init(); if (Session::get('username')) { if (Session::get('admin')) { Url::redirect('exec'); } } else { Url::redirect(''); } $data['title'] = 'Trip Location'; $data['states'] = $this->mab->get_all_states(); $data['countries'] = $this->mab->get_all_countries(); View::rendertemplate('header', $data); View::render('trip/locations', $data, $error); View::rendertemplate('footer', $data); $city = $_POST['city']; $state = $_POST['state']; $country = $_POST['country']; $tripId = \helpers\Session::get("tripId"); if (isset($_POST['submit_location'])) { $locationId = $this->mab->find_locationId($city, $state); if ($locationId == NULL) { $num_of_trips = $this->mab->count_locations($locationId); $num_of_trips = $num_of_trips + 1; $nickname = $city . ' ' . $num_of_trips; $this->mab->insert_location($city, $state, $country); $locationId = $this->mab->find_locationId($city, $state); $this->mab->update_locationId($tripId, $locationId, $nickname); Session::set("nickname", $nickname); } else { $num_of_trips = $this->mab->count_locations($locationId); $num_of_trips = $num_of_trips + 1; $nickname = $city . ' ' . $num_of_trips; $this->mab->update_locationId($tripId, $locationId, $nickname); } } }
public function GETtemplate($id = 'YNUZ') { $student = new \models\student(\models\data::ID($id)); $view = new View('views/student/site/index.html'); return $view->render(['student' => $student]); }
public function contact() { if (isset($_REQUEST['submit'])) { $params = $_REQUEST; $data = $this->_glvc->contact_submit($params); } View::rendertemplate('header', $data); View::render('contact/index', $data); View::rendertemplate('footer', $data); }
public function noncanadians() { $data['glt_noncanadian_form'] = $this->language->get('glt_noncanadian_form'); if (isset($_POST['submit'])) { $params = $_POST; $data = $this->_glt->noncanadians_submit($params); } View::rendertemplate('header', $data); View::render('noncanadians/index', $data); View::rendertemplate('footer', $data); }
public function addmedia($parameter) { $media_type = $parameter[0]; $this->data['media_type'] = $media_type; $this->data['album_categories'] = $this->category_model->get(array('category_slug' => 'album')); $category = $this->category_model->getColRow('category_title', $media_type); $this->data['title'] = 'Add ' . ucfirst($media_type); if (isset($_POST['title']) && !empty($_POST['title'])) { $title = $_POST['title']; $artist = $_POST['artist']; $description = $_POST['description']; $youtubelink = $_POST['youtubelink']; $category_id = $_POST['category']; // $status_id = $status->status_id; $slug = \helpers\url::generateSafeSlug($title); if (isset($youtubelink) && $youtubelink != '') { $exp = explode('=', $youtubelink); if (count($exp) > 1) { $youtubelink = $exp[1]; } } $insert_array = array('album_item_album_id' => \helpers\session::get('user')->user_album_id, 'album_item_category_id' => $category->category_id, 'album_item_user_id' => \helpers\session::get('user')->user_id, 'album_item_title' => $title, 'album_item_artist' => $artist, 'album_item_description' => $description, 'album_item_youtubelink' => $youtubelink, 'album_item_created' => time(), 'album_item_alias' => $slug); $insert_array = \helpers\gump::xss_clean($insert_array); $insert_array = \helpers\gump::sanitize($insert_array); $insert_id = $this->albumitem_model->create($insert_array); if ($insert_id > 0) { $message = 'ok'; } else { $message = 'no'; } //check if item is a video // $category_type = $this->category_model->find($_POST['category']); if ($media_type == 'video' && isset($youtubelink) && $youtubelink != '') { $youtube_url = "https://i.ytimg.com/vi/" . $youtubelink . "/maxresdefault.jpg"; if (!file_exists($youtube_url)) { $youtube_url = "https://i.ytimg.com/vi/" . $youtubelink . "/hqdefault.jpg"; } //resize youtube image into uploads folder \helpers\upload::setName(time()); \helpers\upload::resizeUrl($youtube_url, UPLOAD_PATH, '480px'); $image_name = \helpers\upload::getFileName('images'); $update_data = array('album_item_file' => $image_name); $where_array = array('album_item_id' => $insert_id); $this->albumitem_model->update($update_data, $where_array); } //UPLOAD ATTACHMENT if ($_FILES["image"]["tmp_name"] != '') { //upload image into uploads folder \helpers\upload::setName(uniqid()); \helpers\upload::resizeUpload($_FILES["image"], UPLOAD_PATH, '480px'); $image_name = \helpers\upload::getFileName('images'); $update_data = array('album_item_file' => $image_name); $where_array = array('album_item_id' => $insert_id); $this->albumitem_model->update($update_data, $where_array); } } if ($message == 'ok') { \helpers\session::set('success', 'record edited'); $url = 'user/' . $media_type; \helpers\url::redirect($url); } else { if ($message == 'no') { $this->data['error'] = 'Operation Fails!'; } } View::rendertemplate('header', $this->data); View::rendertemplate('mobile-menu', $this->data); View::render('user/user.media', $this->data); View::rendertemplate('footer', $this->data); }
public function search() { View::rendertemplate('iframe_header', $data); View::render('draftBoard/search', $data, $error); }
public function create() { Session::init(); if (Session::get('username')) { if (Session::get('admin')) { Url::redirect('exec'); } } else { Url::redirect(''); } $data['title'] = 'Trip Profile'; $tripId = \helpers\Session::get("tripId"); $data['location_info'] = $this->mab->location_info($tripId); $data['trip_profile'] = $this->mab->get_trip_information($tripId); $data['participant_roster'] = $this->mab->participant_information(); $data['site_leader_roster'] = $this->mab->site_leader_information(); $data['states'] = $this->locations->get_all_states(); $housing_site = htmlspecialchars($_POST['housing_site']); $contact_name = htmlspecialchars($_POST['contact_name']); $address = htmlspecialchars($_POST['address']); $city = htmlspecialchars($_POST['city']); $state = htmlspecialchars($_POST['state']); $zip = htmlspecialchars($_POST['zip']); $phone = htmlspecialchars($_POST['phone']); $email = htmlspecialchars($_POST['email']); $is_housing_valid = \helpers\gump::is_valid($_POST, array('housing_site' => 'required', 'contact_name' => 'required|alpha', 'address' => 'required', 'city' => 'required|alpha', 'state' => 'required|alpha', 'email' => 'required|valid_email', 'phone' => 'required')); if ($is_housing_valid == true) { if (isset($_POST['save_housing'])) { $this->mab->insert_housing($tripId, $housing_site, $address, $city, $state, $zip); $housingId = $this->mab->find_housingId($tripId, $housing_site); $this->mab->update_housingId($tripId, $housingId); $this->mab->insert_housing_contact($housingId, $contact_name, $email, $phone); } } $service_site = htmlspecialchars($_POST['service_site']); $website = htmlspecialchars($_POST['website']); $service_contact_name = htmlspecialchars($_POST['service_contact_name']); $service_address = htmlspecialchars($_POST['service_address']); $service_city = htmlspecialchars($_POST['service_city']); $service_state = htmlspecialchars($_POST['service_state']); $service_zip = htmlspecialchars($_POST['service_zip']); $service_phone = htmlspecialchars($_POST['service_phone']); $service_email = htmlspecialchars($_POST['service_email']); $is_service_valid = \helpers\gump::is_valid($_POST, array('service_site' => 'required', 'website' => 'required', 'service_contact_name' => 'required|alpha', 'service_address' => 'required', 'service_city' => 'required|alpha', 'service_state' => 'required|alpha', 'service_email' => 'required|valid_email', 'service_phone' => 'required')); if ($is_service_valid == true) { if (isset($_POST['save_service'])) { $this->mab->insert_service($tripId, $service_site, $service_address, $website, $service_city, $service_state, $service_zip); $serviceSiteId = $this->mab->find_serviceSiteId($tripId, $service_site); $this->mab->update_trip_sites($tripId, $serviceSiteId); $this->mab->insert_service_contact($serviceSiteId, $service_contact_name, $service_email, $service_phone); } } if (isset($_POST['delete_housing'])) { $this->mab->delete_housing($data['trip_profile']->housingId); } if (isset($_POST['deleteServiceSiteBtn'])) { $serviceSiteId = $_POST['deleteTrip']; $this->mab->delete_service_site($serviceSiteId); } $data['apps_by_gender'] = $this->analytics->get_gender_by_trip($tripId); $data['apps_by_grade'] = $this->analytics->get_school_year_by_trip($tripId); View::rendertemplate('header', $data); View::render('trip/trip', $data, $error); View::rendertemplate('footer', $data); }
public function privacy_policy() { $data['policies_and_information'] = $this->language->get('policies_and_information'); $data['government_fees'] = $this->language->get('government_fees'); $data['general_provisions'] = $this->language->get('general_provisions'); $data['limitations_of_liability'] = $this->language->get('limitations_of_liability'); $data['indemnification'] = $this->language->get('indemnification'); $data['trademarks_copyright'] = $this->language->get('trademarks_copyright'); $data['privacy_policy'] = $this->language->get('privacy_policy'); View::rendertemplate('header', $data); View::render('privacy_policy/index', $data); View::rendertemplate('footer', $data); }