load->model('alsosee_model'); $this->load->model('scholarship_model'); $this->load->model('program_model'); $this->load->model('educationfair_model'); $this->load->library('pagination'); } public function search() { $this->logPage(); $postdata = $_POST; if (is_array($postdata)) { foreach ($postdata as $key => $value) { if (strpos($key, 'scholarship_') === 0) { $this->session->set_userdata($key, $value); } } } $this->doSearch(); } public function lists() { $this->logPage(); $data = $this->session->all_userdata(); foreach($data as $key => $value) { if (strpos($key, 'scholarship_') === 0) { $this->session->unset_userdata($key); } } if ($this->uri->rsegment(3) !== FALSE && strtolower($this->uri->rsegment(3)) != 'all') { $this->session->set_userdata('scholarship_level', $this->ef_model->getUidByUrl('programLevel', $this->uri->rsegment(3))); } if ($this->uri->rsegment(4) !== FALSE && strtolower($this->uri->rsegment(4)) != 'all') { $this->session->set_userdata('scholarship_fieldOfStudy', $this->ef_model->getUidByUrl('fieldOfStudy', $this->uri->rsegment(4))); } if ($this->uri->rsegment(5) !== FALSE && strtolower($this->uri->rsegment(5)) != 'all') { $this->session->set_userdata('scholarship_discipline', $this->ef_model->getUidByUrl('discipline', $this->uri->rsegment(5))); } $this->doSearch(); } public function show() { $this->logPage(); $uid = $this->uri->rsegment(4); $scholarship = $this->scholarship_model->get($uid); if ($scholarship != false) { $pageData['scholarship'] = $scholarship; $programs = $this->scholarship_model->getPrograms(array( 'level' => $scholarship->levels, 'fieldOfStudy' => $scholarship->fieldOfStudies, 'discipline' => $scholarship->disciplines, 'orgLocation' => $scholarship->orgLocations, )); if ($programs != false) { if (count($programs) > $this->pagination->per_page) { $this->pagination->total_rows = count($programs); $pageData['pagination'] = $this->pagination->create_links(); } $pageData['programs'] = array_slice($programs, $this->pagination->per_page * ($this->pagination->cur_page - 1), $this->pagination->per_page); } else { $pageData['programs'] = $programs; } $newPrograms = array(); foreach ($pageData['programs'] as $program) { $program->startingdates = $this->program_model->getStartingDate($program->uid); $newPrograms[] = $program; } $pageData['programs'] = $newPrograms; } else { show_404($this->uri->uri_string()); } $pageData = $this->getAlsosees($pageData); //ophalen $pageData['paginakop'] = $scholarship->name; $pageData['page_title'] = $scholarship->name . " - educationfair.nl"; $pageData['page_description'] = substr(str_replace("\n", "", strip_tags($scholarship->description_en)), 0, 152) . "..."; $pageData['page_keywords'] = $scholarship->name . ", educationfair.nl"; //template laden met sidebar $this->makeAdminMenu($uid); $this->template->set('show_sidebar', true); $this->template->load('standard', 'scholarship/show', $pageData); } public function index() { redirect('/scholarship/search/', 'location'); } public function edit() { $this->logOverlay(); if (isset($_POST['submit'])) { $record = $_POST; unset($record['submit']); $uid = $record['uid']; //check fields $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
', '
'); $validate_result = $this->validateScholarship(); if ($validate_result == TRUE) { //print_r($_POST); exit; if ( set_value('levels_star') == '*' ) $levels = '*'; else $levels = set_value('levels'); if ( set_value('disciplines_star') == '*' ) $disciplines = '*'; else $disciplines = set_value('disciplines'); if ( set_value('fieldOfStudies_star') == '*' ) $fieldOfStudies = '*'; else $fieldOfStudies = set_value('fieldOfStudies'); if ( set_value('organizations_star') == '*' ) $organizations = '*'; else $organizations = set_value('organizations'); if ( set_value('orgLocations_star') == '*' ) $orgLocations = '*'; else $orgLocations = set_value('orgLocations'); if ( set_value('programs_star') == '*' ) $programs = '*'; else $programs = set_value('programs'); $data = array( 'uid' => set_value('uid'), 'name' => set_value('name'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'audience' => set_value('audience'), 'period' => set_value('period'), 'application' => set_value('application'), 'maxAllowence' => set_value('maxAllowence'), 'additionalInfo' => set_value('additionalInfo'), 'levels' => $levels, 'disciplines' => $disciplines, 'fieldOfStudies' => $fieldOfStudies, 'organizations' => $organizations, 'orgLocations' => $orgLocations, 'programs' => $programs, 'description_en' => html_entity_decode(set_value('description_en')), ); //call model $this->scholarship_model->updateScholarship($data, $uid); //$this->cache->clean(); $this->load->view('overlay/reloadparent'); } } $uid = $this->uri->segment(3, 0); $query = $this->db->get_where('scholarships', array('uid' => $uid)); if ($query->num_rows() == 1) { $row = $query->row_array(); $row['all_levels'] = $this->educationfair_model->getAllLevels(); //print_r($row['all_levels']); $row['all_disciplines'] = $this->educationfair_model->getAllDisciplinesGrouped(); //print_r($row['all_disciplines']); $row['all_fieldOfStudies'] = $this->educationfair_model->getAllFieldOfStudies(); $row['all_organizations'] = $this->educationfair_model->getAllOrganizations(); $row['all_orgLocations'] = $this->educationfair_model->getAllLocations(); $row['all_programs'] = $this->educationfair_model->getAllProgramsGrouped(); if ($row['disciplines'] == '*' ) $row['disciplines_star'] = 1; else $row['disciplines_star'] = 0; if ($row['levels'] == '*' ) $row['levels_star'] = 1; else $row['levels_star'] = 0; if ($row['fieldOfStudies'] == '*' ) $row['fieldOfStudies_star'] = 1; else $row['fieldOfStudies_star'] = 0; if ($row['organizations'] == '*' ) $row['organizations_star'] = 1; else $row['organizations_star'] = 0; if ($row['orgLocations'] == '*' ) $row['orgLocations_star'] = 1; else $row['orgLocations_star'] = 0; if ($row['programs'] == '*' ) $row['programs_star'] = 1; else $row['programs_star'] = 0; $this->template->addExtraJs('/template/ckeditor/ckeditor.js'); $this->template->addExtraJs('/template/ckeditor/adapters/jquery.js'); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); $this->template->addExtraJs('/template/js/ckeditor_config.js'); $this->template->addExtraJs('/template/js/form_groupeddoubleselect.js'); $this->template->load('overlay', 'scholarship/edit', array('record' => $row)); } } public function add() { $this->logOverlay(); if (isset($_POST['submit'])) { $record = $_POST; unset($record['submit']); $uid = ''; //check fields $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
', '
'); $validate_result = $this->validateScholarship(); if ($validate_result == TRUE) { //print_r($_POST); exit; if ( set_value('levels_star') == '*' ) $levels = '*'; else $levels = set_value('levels'); if ( set_value('disciplines_star') == '*' ) $disciplines = '*'; else $disciplines = set_value('disciplines'); if ( set_value('fieldOfStudies_star') == '*' ) $fieldOfStudies = '*'; else $fieldOfStudies = set_value('fieldOfStudies'); if ( set_value('organizations_star') == '*' ) $organizations = '*'; else $organizations = set_value('organizations'); if ( set_value('orgLocations_star') == '*' ) $orgLocations = '*'; else $orgLocations = set_value('orgLocations'); if ( set_value('programs_star') == '*' ) $programs = '*'; else $programs = set_value('programs'); $data = array( 'uid' => '', 'name' => set_value('name'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'audience' => set_value('audience'), 'period' => set_value('period'), 'application' => set_value('application'), 'maxAllowence' => set_value('maxAllowence'), 'additionalInfo' => set_value('additionalInfo'), 'levels' => $levels, 'disciplines' => $disciplines, 'fieldOfStudies' => $fieldOfStudies, 'organizations' => $organizations, 'orgLocations' => $orgLocations, 'programs' => $programs, 'description_en' => html_entity_decode(set_value('description_en')), ); //call model $lastinsertid = $this->scholarship_model->insertScholarship($data); // $this->cache->clean(); $data['redirect_url'] = 'scholarship/show/' . $lastinsertid; $this->load->view('overlay/redirectparent', $data); } } if ( set_value('levels_star') == '*' ) $levels = '*'; else $levels = set_value('levels'); if ( set_value('disciplines_star') == '*' ) $disciplines = '*'; else $disciplines = set_value('disciplines'); if ( set_value('fieldOfStudies_star') == '*' ) $fieldOfStudies = '*'; else $fieldOfStudies = set_value('fieldOfStudies'); if ( set_value('organizations_star') == '*' ) $organizations = '*'; else $organizations = set_value('organizations'); if ( set_value('orgLocations_star') == '*' ) $orgLocations = '*'; else $orgLocations = set_value('orgLocations'); if ( set_value('programs_star') == '*' ) $programs = '*'; else $programs = set_value('programs'); if (set_value('disciplines') == '' ) $disciplines_star = 1; else $disciplines_star = 0; if (set_value('levels') == '' ) $levels_star = 1; else $levels_star = 0; if (set_value('fieldOfStudies') == '' ) $fieldOfStudies_star = 1; else $fieldOfStudies_star = 0; if (set_value('organizations') == '' ) $organizations_star = 1; else $organizations_star = 0; if (set_value('orgLocations') == '' ) $orgLocations_star = 1; else $orgLocations_star = 0; if (set_value('programs') == '' ) $programs_star = 1; else $programs_star = 0; $row = array( 'uid' => '', 'name' => set_value('name'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'audience' => set_value('audience'), 'period' => set_value('period'), 'application' => set_value('application'), 'maxAllowence' => set_value('maxAllowence'), 'additionalInfo' => set_value('additionalInfo'), 'levels' => $levels, 'disciplines' => $disciplines, 'fieldOfStudies' => $fieldOfStudies, 'organizations' => $organizations, 'orgLocations' => $orgLocations, 'programs' => $programs, 'description_en' => html_entity_decode(set_value('description_en')), 'all_levels' => $this->educationfair_model->getAllLevels(), 'all_disciplines' => $this->educationfair_model->getAllDisciplinesGrouped(), 'all_fieldOfStudies' => $this->educationfair_model->getAllFieldOfStudies(), 'all_organizations' => $this->educationfair_model->getAllOrganizations(), 'all_orgLocations' => $this->educationfair_model->getAllLocations(), 'all_programs' => $this->educationfair_model->getAllProgramsGrouped(), 'disciplines_star' => $disciplines_star, 'levels_star' => $levels_star, 'fieldOfStudies_star' => $fieldOfStudies_star, 'organizations_star' => $organizations_star, 'orgLocations_star' => $orgLocations_star, 'programs_star' => $programs_star, ); $this->template->addExtraJs('/template/ckeditor/ckeditor.js'); $this->template->addExtraJs('/template/ckeditor/adapters/jquery.js'); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); $this->template->addExtraJs('/template/js/ckeditor_config.js'); $this->template->addExtraJs('/template/js/form_groupeddoubleselect.js'); $this->template->load('overlay', 'scholarship/add', array('record' => $row)); } public function delete() { $this->logOverlay(); if (isset($_POST['submit'])) { $uid = set_value('uid'); //call model $this->scholarship_model->deleteScholarship($uid); //$this->cache->clean(); $data['redirect_url'] = '/scholarship/search'; $this->load->view('overlay/redirectparent', $data); } else { //dan checken of er vestigingen gekoppeld zijn aan deze hoofdinstelling $do_delete = true; if ($do_delete == true) { //overlay laden met submitknop naar delete $this->template->load('overlay', 'scholarship/delete', array('uid' => $this->uri->segment(3))); } else { //overlay laden met foutmelding //$this->template->load('overlay', 'scholarship/delete_error', array('page' => 'scholarship', 'error' => 'Er zijn nog ?? gekoppeld op deze scholarship, deleten is niet mogelijk!')); } } } private function validateScholarship() { $rules = array( array( 'field' => 'uid', 'label' => 'Uid', 'rules' => 'trim|required' ), array( 'field' => 'name', 'label' => 'Name', 'rules' => 'trim|required' ), array( 'field' => 'url_path_segment_en', 'label' => 'URL path segment (en)', 'rules' => 'trim|required' ), array( 'field' => 'audience', 'label' => 'audience', 'rules' => 'trim' ), array( 'field' => 'period', 'label' => 'period', 'rules' => 'trim' ), array( 'field' => 'application', 'label' => 'application', 'rules' => 'trim' ), array( 'field' => 'maxAllowence', 'label' => 'maxAllowence', 'rules' => 'trim' ), array( 'field' => 'additionalInfo', 'label' => 'additionalInfo', 'rules' => 'trim' ), array( 'field' => 'levels', 'label' => 'levels', 'rules' => 'trim' ), array( 'field' => 'disciplines', 'label' => 'disciplines', 'rules' => 'trim' ), array( 'field' => 'fieldOfStudies', 'label' => 'fieldOfStudies', 'rules' => 'trim' ), array( 'field' => 'organizations', 'label' => 'organizations', 'rules' => 'trim' ), array( 'field' => 'orgLocations', 'label' => 'orgLocations', 'rules' => 'trim' ), array( 'field' => 'programs', 'label' => 'programs', 'rules' => 'trim' ), array( 'field' => 'levels_star', 'label' => 'levels checkbox', 'rules' => 'trim' ), array( 'field' => 'disciplines_star', 'label' => 'disciplines checkbox', 'rules' => 'trim' ), array( 'field' => 'fieldOfStudies_star', 'label' => 'fieldOfStudies checkbox', 'rules' => 'trim' ), array( 'field' => 'organizations_star', 'label' => 'organizations checkbox', 'rules' => 'trim' ), array( 'field' => 'orgLocations_star', 'label' => 'orgLocations checkbox', 'rules' => 'trim' ), array( 'field' => 'programs_star', 'label' => 'programs checkbox', 'rules' => 'trim' ), array( 'field' => 'description_en', 'label' => 'Description (en)', 'rules' => 'trim' ), ); $this->form_validation->set_rules($rules); return $this->form_validation->run(); } private function doSearch() { $searchParams = array(); $searchParams['level'] = $this->session->userdata('scholarship_level') !== FALSE ? $this->session->userdata('scholarship_level') : '%'; $searchParams['field'] = $this->session->userdata('scholarship_fieldOfStudy') !== FALSE ? $this->session->userdata('scholarship_fieldOfStudy') : '%'; $searchParams['discipline'] = $this->session->userdata('scholarship_discipline') !== FALSE ? $this->session->userdata('scholarship_discipline') : '%'; $scholarships = $this->scholarship_model->search($searchParams); if (count($scholarships) > $this->pagination->per_page) { $this->pagination->total_rows = count($scholarships); $pageData['pagination'] = $this->pagination->create_links(); } $pageData['scholarships'] = array_slice($scholarships, $this->pagination->per_page * ($this->pagination->cur_page - 1), $this->pagination->per_page); //laden alsosee $alsosees = array(); if ($this->session->userdata('lastSeenProgram') != '') $alsosees[] = 7; else $alsosees[] = 1; $alsosees[] = 2; $alsosees[] = 3; $alsosees[] = 4; $pageData['alsosees'] = $alsosees; $pageData['paginakop'] = "Find scholarship"; $pageData['page_title'] = "Find a scholarship – educationfair.nl"; $pageData['page_description'] = "Find a scholarship to pay for your studies in the Netherlands"; $pageData['page_keywords'] = "Scholarship, educationfair.nl"; //template laden met sidebar $this->makeAdminMenu(); $this->template->set('show_sidebar', true); $this->template->load('standard', 'scholarship/index', $pageData); } private function getAlsosees($pageData) { //laden alsosee $alsosees = array(); if ($this->session->userdata('lastSeenProgram') != '') $alsosees[] = 7; else $alsosees[] = 1; $alsosees[] = 2; $alsosees[] = 3; $alsosees[] = 4; $pageData['alsosees'] = $alsosees; return $pageData; } private function makeAdminMenu($uid = NULL) { if ($this->user->hasPermission('scholarship', 'edit') && $uid != NULL) { $this->template->addAdminMenu('edit', site_url('scholarship/edit/'.$uid)); } if ($this->user->hasPermission('scholarship', 'delete') && $uid != NULL) { $this->template->addAdminMenu('delete', site_url('scholarship/delete/'.$uid)); } if ($this->user->hasPermission('scholarship', 'add') && $uid != NULL) { $this->template->addAdminMenu('add', site_url('scholarship/add/')); } } } ?>

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/public/sites/www.educationfair.nl/educationfair/controllers/scholarship.php:509)

Filename: core/Common.php

Line Number: 443

Page not found!

Page not found!

OOPS, the page you are looking for does not seem to exist.