load->model('university_model'); $this->load->model('program_model'); $this->load->model('alsosee_model'); $this->session->set_userdata('last_url', $this->uri->uri_string()); } private $view = 'main'; function index() { $this->logPage(); $pageData = array(); //template laden met sidebar $this->template->set('show_sidebar', true); $this->template->load('standard', 'university/index', $pageData); } function view() { $this->logPage(); if (isset($_POST['uniselect'])) { $uid = $_POST['uniselect']; //ophalen url_path_segment $row = $this->university_model->getUniversityInfo($uid); $url_path_segment = $row->url_path_segment; //bedankt pagina redirect('university/view/'.$url_path_segment.'/' . $uid); } $uid = $this->uri->rsegment(4); //ophalen language $lang = $this->config->item('language_current'); //gegevens universiteit $row = $this->university_model->getUniversityInfo($uid); // var_dump($row); var_dump($this->db->last_query()); if (!$row) { show_404(); } $pageData = array(); $pageData['accreditations'] = $this->university_model->getAccreditations($row->uid); //initieren van de opgehaalde gegevens if (isset($row->name))$pageData['paginakop'] = $row->name; else $pageData['paginakop'] = "????"; if (isset($row->type))$pageData['type'] = $row->type; else $pageData['type'] = "????"; if (isset($row->departments))$pageData['departments'] = $row->departments; else $pageData['departments'] = "????"; if (isset($row->description))$pageData['description'] = $row->description; else $pageData['description'] = "????"; if (isset($row->logo))$pageData['logo'] = $row->logo; else $pageData['logo'] = "????"; if (isset($row->timesranking))$pageData['timesranking'] = $row->timesranking; else $pageData['timesranking'] = "????"; if (isset($row->qsranking))$pageData['qsranking'] = $row->qsranking; else $pageData['qsranking'] = "????"; if (isset($row->city))$pageData['city'] = $row->city; else $pageData['city'] = "????"; if (isset($row->weburl))$pageData['weburl'] = $row->weburl; else $pageData['weburl'] = "????"; if (isset($row->weburl_vestiging))$pageData['weburl'] = $row->weburl_vestiging; else $pageData['weburl'] = $pageData['weburl']; if (isset($row->url_path_segment))$pageData['url_path_segment'] = $row->url_path_segment; else $pageData['url_path_segment'] = "????"; if (isset($row->url_path_segment_organization))$pageData['url_path_segment_organization'] = $row->url_path_segment_organization; else $pageData['url_path_segment_organization'] = "????"; if (isset($row->membership_status)) $pageData['membership_status'] = $row->membership_status; else $pageData['membership_status'] = "????"; if (isset ($_POST['uniselect'])) $pageData['unie_uid'] = $_POST['uniselect']; else $pageData['unie_uid'] = $this->uri->rsegment(4); $pageData['expertise'] = "????"; $pageData['bachelor_programs_en'] = "????"; $pageData['bachelor_programs_nl'] = "????"; $pageData['master_programs_en'] = "????"; $pageData['master_programs_nl'] = "????"; //ophalen van expertise if (isset($row->uid)) { $result_exp = $this->university_model->getFieldOfStudy($row->uid); $expertise =""; //print_r($result_exp); //die($this->db->last_query()); foreach ( $result_exp as $row2) { $expertise .= $row2->expertise . ", "; } $pageData['expertise'] = $expertise; //$pageData['brin_index'] = $row->brin_index; //ophalen vestigingen $pageData['vestigingen'] = $this->university_model->getVestigingen($row->org_uid, $row->uid); //degrees offered $result_deg = $this->university_model->getDegrees($row->uid); $degrees =""; //print_r($result_exp); //die($this->db->last_query()); foreach ( $result_deg as $row3) { $degrees .= $row3->levels . ", "; } $pageData['degrees'] = substr($degrees, 0, -2); $show_location =0; ############################ BACHELOR ###################### //dit is nodig om de engelse bachelor lijst te tonen $searchParams_ba_en = array ( 'orgLocation_uid' => $row->uid, // uniek id vestiging //'organization_uid' => $row->org_uid, // uniek id vestiging 'language' => 'en', // en of nl 'level' => 2, // zie programLevel tabel ); $bachelor_programs_en = $this->program_model->search($searchParams_ba_en); $pageData['count_bachelor_programs_en'] = count($bachelor_programs_en); $bachelor_programs_en_html = ""; foreach ( $bachelor_programs_en as $row_ba_en) { $bachelor_programs_en_html .= '' . $row_ba_en->name . ''; if ( $show_location == 1 ) $bachelor_programs_en_html .= ' (' . $row_ba_en->location . ')'; $bachelor_programs_en_html .= '
'; } $pageData['bachelor_programs_en'] = $bachelor_programs_en_html; //dit is nodig om de nederlandse bachelor lijst te tonen $searchParams_ba_nl = array ( 'orgLocation_uid' => $row->uid, // uniek id vestiging //'organization_uid' => $row->org_uid, // uniek id vestiging 'language' => 'nl', // en of nl 'level' => 2, // zie programLevel tabel ); $bachelor_programs_nl = $this->program_model->search($searchParams_ba_nl); $bachelor_programs_nl_html = ""; $pageData['count_bachelor_programs_nl'] = count($bachelor_programs_nl); foreach ( $bachelor_programs_nl as $row_ba_nl) { $bachelor_programs_nl_html .= '' . $row_ba_nl->name . ''; if ( $show_location == 1 ) $bachelor_programs_nl_html .= ' (' . $row_ba_nl->location . ')'; $bachelor_programs_nl_html .= '
'; } $pageData['bachelor_programs_nl'] = $bachelor_programs_nl_html; ########################################################## ############################ MASTER ###################### //dit is nodig om de engelse master lijst te tonen $searchParams_ma_en = array ( 'orgLocation_uid' => $row->uid, // uniek id vestiging //'organization_uid' => $row->org_uid, // uniek id vestiging 'language' => 'en', // en of nl 'level' => 3, // zie programLevel tabel ); $master_programs_en = $this->program_model->search($searchParams_ma_en); $master_programs_en_html = ""; $pageData['count_master_programs_en'] = count($master_programs_en); foreach ( $master_programs_en as $row_ma_en) { $master_programs_en_html .= '' . $row_ma_en->name . ''; if ( $show_location == 1 ) $master_programs_en_html .= ' (' . $row_ma_en->location . ')'; $master_programs_en_html .= '
'; } $pageData['master_programs_en'] = $master_programs_en_html; //dit is nodig om de nederlandse bachelor lijst te tonen $searchParams_ma_nl = array ( 'orgLocation_uid' => $row->uid, // uniek id vestiging //'organization_uid' => $row->org_uid, // uniek id vestiging 'language' => 'nl', // en of nl 'level' => 3, // zie programLevel tabel ); $master_programs_nl = $this->program_model->search($searchParams_ma_nl); $master_programs_nl_html = ""; $pageData['count_master_programs_nl'] = count($master_programs_nl); foreach ( $master_programs_nl as $row_ma_nl) { $master_programs_nl_html .= '' . $row_ma_nl->name . ''; if ( $show_location == 1 ) $master_programs_nl_html .= ' (' . $row_ma_nl->location . ')'; $master_programs_nl_html .= '
'; } $pageData['master_programs_nl'] = $master_programs_nl_html; ########################################################## ############################ SHORTCOURSE ###################### //dit is nodig om de engelse master lijst te tonen $searchParams_sc_en = array ( 'orgLocation_uid' => $row->uid, // uniek id vestiging //'organization_uid' => $row->org_uid, // uniek id vestiging 'language' => 'en', // en of nl 'level' => 5, // zie programLevel tabel ); $sc_programs_en = $this->program_model->search($searchParams_sc_en); $sc_programs_en_html = ""; $pageData['count_sc_programs_en'] = count($sc_programs_en); foreach ( $sc_programs_en as $row_sc_en) { $sc_programs_en_html .= '' . $row_sc_en->name . ''; if ( $show_location == 1 ) $sc_programs_en_html .= ' (' . $row_sc_en->location . ')'; $sc_programs_en_html .= '
'; } $pageData['sc_programs_en'] = $sc_programs_en_html; //dit is nodig om de nederlandse bachelor lijst te tonen $searchParams_sc_nl = array ( 'orgLocation_uid' => $row->uid, // uniek id vestiging //'organization_uid' => $row->org_uid, // uniek id vestiging 'language' => 'nl', // en of nl 'level' => 5, // zie programLevel tabel ); $sc_programs_nl = $this->program_model->search($searchParams_sc_nl); $sc_programs_nl_html = ""; $pageData['count_sc_programs_nl'] = count($sc_programs_nl); foreach ( $sc_programs_nl as $row_sc_nl) { $sc_programs_nl_html .= '' . $row_sc_nl->name . ''; if ( $show_location == 1 ) $sc_programs_nl_html .= ' (' . $row_sc_nl->location . ')'; $sc_programs_nl_html .= '
'; } $pageData['sc_programs_nl'] = $sc_programs_nl_html; ########################################################## } //laden alsosee $alsosees = array(); $alsosees[] = 1; $alsosees[] = 2; if ($this->session->userdata('lastSeenProgram') != '') $alsosees[] = 7; else $alsosees[] = 3; $alsosees[] = 4; $pageData['alsosees'] = $alsosees; //mochten ze leeg zijn dan standaard value die wordt overide door andere controllers $pageData['page_title'] = "Information about " .$pageData['paginakop']. " - educationfair.nl"; $pageData['page_description'] = "Information about " .$pageData['paginakop']. " - educationfair.nl"; $pageData['page_keywords'] = $pageData['paginakop'] . ", " . $pageData['type'] . ", " . $pageData['degrees']; //org uid voor link fair $pageData['org_uid'] = $row->org_uid; //template laden met sidebar $this->makeAdminMenu($uid, 'view'); $this->template->set('show_sidebar', true); $this->template->load('standard', 'university/view', $pageData); } function fair() { $this->logPage(); $uid = $this->uri->rsegment(4); //ophalen language $lang = $this->config->item('language_current'); //gegevens universiteit $row = $this->university_model->getUniversityFair($uid); if (!$row) { show_404(); } $pageData = array(); //initieren van de opgehaalde gegevens if (isset($row->name)) $pageData['paginakop'] = $row->name; else $pageData['paginakop'] = "????"; if (isset($row->uid)) $pageData['uid'] = $row->uid; else $pageData['uid'] = "????"; //voor het logo moeten we de benaming aanpassen als het gaat om de infostand logos if (isset($row->logo)) $pageData['logo'] = $row->logo; else $pageData['logo'] = "????"; if (isset($row->url_path_segment)) $pageData['url_path_segment'] = $row->url_path_segment; else $pageData['url_path_segment'] = "????"; if (isset($row->facebook)) $pageData['facebook'] = $row->facebook; else $pageData['facebook'] = "????"; if (isset($row->twitter)) $pageData['twitter'] = $row->twitter; else $pageData['twitter'] = "????"; if (isset($row->youtube)) $pageData['youtube'] = $row->youtube; else $pageData['youtube'] = "????"; if (isset($row->video)) $pageData['video'] = $row->video; else $pageData['video'] = "????"; if (isset($row->linkedin)) $pageData['linkedin'] = $row->linkedin; else $pageData['linkedin'] = "????"; if (isset($row->poster)) $pageData['poster'] = $row->poster; else $pageData['poster'] = "????"; if (isset($row->poster_url)) $pageData['poster_url'] = $row->poster_url; else $pageData['poster_url'] = "????"; if (isset($row->email)) $pageData['email'] = $row->email; else $pageData['email'] = "????"; if (isset($row->membership_status)) $pageData['membership_status'] = $row->membership_status; else $pageData['membership_status'] = "????"; if (isset($row->weburl))$pageData['weburl'] = $row->weburl; else $pageData['weburl'] = "????"; //ophalen van expertise if (isset($row->uid)) { $result_exp = $this->university_model->getFieldOfStudy($row->uid); $expertise =""; //ophalen vestigingen $pageData['vestigingen'] = $this->university_model->getVestigingen($row->uid, $pageData['url_path_segment']); //print_r($result_exp); //die($this->db->last_query()); foreach ( $result_exp as $row2) { $expertise .= $row2->expertise . ", "; } $pageData['expertise'] = $expertise; if (count($pageData['vestigingen']) > 1) $show_location =1; else $show_location=0; ############################ BACHELOR ###################### //dit is nodig om de engelse bachelor lijst te tonen $searchParams_ba_en = array ( 'organization_uid' => $row->uid, // uniek id vestiging 'language' => 'en', // en of nl 'level' => 2, // zie programLevel tabel ); $bachelor_programs_en = $this->program_model->search($searchParams_ba_en); $pageData['count_bachelor_programs_en'] = count($bachelor_programs_en); $bachelor_programs_en_html = ""; foreach ( $bachelor_programs_en as $row_ba_en) { $bachelor_programs_en_html .= '' . $row_ba_en->name . ''; if ( $show_location == 1 ) $bachelor_programs_en_html .= ' (' . $row_ba_en->location . ')'; $bachelor_programs_en_html .= '
'; } $pageData['bachelor_programs_en'] = $bachelor_programs_en_html; //dit is nodig om de nederlandse bachelor lijst te tonen $searchParams_ba_nl = array ( 'organization_uid' => $row->uid, // uniek id vestiging 'language' => 'nl', // en of nl 'level' => 2, // zie programLevel tabel ); $bachelor_programs_nl = $this->program_model->search($searchParams_ba_nl); $bachelor_programs_nl_html = ""; $pageData['count_bachelor_programs_nl'] = count($bachelor_programs_nl); foreach ( $bachelor_programs_nl as $row_ba_nl) { $bachelor_programs_nl_html .= '' . $row_ba_nl->name . ''; if ( $show_location == 1 ) $bachelor_programs_nl_html .= ' (' . $row_ba_nl->location . ')'; $bachelor_programs_nl_html .= '
'; } $pageData['bachelor_programs_nl'] = $bachelor_programs_nl_html; ########################################################## ############################ MASTER ###################### //dit is nodig om de engelse master lijst te tonen $searchParams_ma_en = array ( 'organization_uid' => $row->uid, // uniek id vestiging 'language' => 'en', // en of nl 'level' => 3, // zie programLevel tabel ); $master_programs_en = $this->program_model->search($searchParams_ma_en); $master_programs_en_html = ""; $pageData['count_master_programs_en'] = count($master_programs_en); foreach ( $master_programs_en as $row_ma_en) { $master_programs_en_html .= '' . $row_ma_en->name . ''; if ( $show_location == 1 ) $master_programs_en_html .= ' (' . $row_ma_en->location . ')'; $master_programs_en_html .= '
'; } $pageData['master_programs_en'] = $master_programs_en_html; //dit is nodig om de nederlandse bachelor lijst te tonen $searchParams_ma_nl = array ( 'organization_uid' => $row->uid, // uniek id vestiging 'language' => 'nl', // en of nl 'level' => 3, // zie programLevel tabel ); $master_programs_nl = $this->program_model->search($searchParams_ma_nl); $master_programs_nl_html = ""; $pageData['count_master_programs_nl'] = count($master_programs_nl); foreach ( $master_programs_nl as $row_ma_nl) { $master_programs_nl_html .= '' . $row_ma_nl->name . ''; if ( $show_location == 1 ) $master_programs_nl_html .= ' (' . $row_ma_nl->location . ')'; $master_programs_nl_html .= '
'; } $pageData['master_programs_nl'] = $master_programs_nl_html; ########################################################## ############################ SHORTCOURSE ###################### //dit is nodig om de engelse master lijst te tonen $searchParams_sc_en = array ( 'organization_uid' => $row->uid, // uniek id vestiging 'language' => 'en', // en of nl 'level' => 5, // zie programLevel tabel ); $sc_programs_en = $this->program_model->search($searchParams_sc_en); $sc_programs_en_html = ""; $pageData['count_sc_programs_en'] = count($sc_programs_en); foreach ( $sc_programs_en as $row_sc_en) { $sc_programs_en_html .= '' . $row_sc_en->name . ''; if ( $show_location == 1 ) $sc_programs_en_html .= ' (' . $row_sc_en->location . ')'; $sc_programs_en_html .= '
'; } $pageData['sc_programs_en'] = $sc_programs_en_html; //dit is nodig om de nederlandse bachelor lijst te tonen $searchParams_sc_nl = array ( 'organization_uid' => $row->uid, // uniek id vestiging 'language' => 'nl', // en of nl 'level' => 5, // zie programLevel tabel ); $sc_programs_nl = $this->program_model->search($searchParams_sc_nl); $sc_programs_nl_html = ""; $pageData['count_sc_programs_nl'] = count($sc_programs_nl); foreach ( $sc_programs_nl as $row_sc_nl) { $sc_programs_nl_html .= '' . $row_sc_nl->name . ''; if ( $show_location == 1 ) $sc_programs_nl_html .= ' (' . $row_sc_nl->location . ')'; $sc_programs_nl_html .= '
'; } $pageData['sc_programs_nl'] = $sc_programs_nl_html; ########################################################## } //laden alsosee $alsosees = array(); $alsosees[] = 1; $alsosees[] = 2; if ($this->session->userdata('lastSeenProgram') != '') $alsosees[] = 7; else $alsosees[] = 3; $alsosees[] = 4; $pageData['alsosees'] = $alsosees; //mochten ze leeg zijn dan standaard value die wordt overide door andere controllers $pageData['page_title'] = "Visit " .$pageData['paginakop']. " at educationfair.nl"; $pageData['page_description'] = "Visit " .$pageData['paginakop']. " at educationfair.nl and experience what this university has to offer via Facebook, Youtube, Twitter and Linkedin."; $pageData['page_keywords'] = $pageData['paginakop'] . ",find degree programs, interact via Facebook, Youtube, Twitter and Linkedin."; //template laden met sidebar $this->makeAdminMenu($uid, 'fair'); $this->template->set('show_sidebar', true); $this->template->load('standard', 'university/fair', $pageData); } public function edit_view() { $this->logOverlay(); $this->template->addExtraJs('/template/js/university_edit.js'); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); if (isset($_POST['submit'])) { $uid = set_value('uid'); //check fields $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
', '
'); $validate_result = $this->validateUniversity(); if ($validate_result == TRUE) { if (set_value('city_custom') != '') $city = set_value('city_custom'); else $city = set_value('city'); $data = array( 'organization_uid' => set_value('organization_uid'), 'brin' => set_value('brin'), 'brin_index' => set_value('brin_index'), 'name_nl' => set_value('name_nl'), 'name_en' => set_value('name_en'), 'logo' => set_value('logo'), 'url_path_segment_nl' => set_value('url_path_segment_nl'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'shortDescription_nl' => html_entity_decode(set_value('shortDescription_nl')), 'shortDescription_en' => html_entity_decode(set_value('shortDescription_en')), 'departments_nl' => html_entity_decode(set_value('departments_nl')), 'departments_en' => html_entity_decode(set_value('departments_en')), 'city' => $city, 'homepage_nl' => set_value('homepage_nl'), 'homepage_en' => set_value('homepage_en'), 'sksVid' => set_value('sksVid'), 'membership_status' => set_value('membership_status'), 'email' => set_value('email'), ); //call model $this->university_model->updateUniversity($data, $uid); $this->load->view('overlay/reloadparent'); } } $query = $this->db->get_where('orgLocation', array('uid' => $this->uri->segment(3))); if ($query->num_rows() == 1) { //organizations options foreach ($this->university_model->getOrganizations() as $row) { $organizations_options[$row->uid] = $row->name_en; } //city options foreach ($this->university_model->getCities() as $row) { if ($row->city_name == 'The Hague') $cityname = 'Den Haag'; else $cityname = $row->city_name; $city_options[$cityname] = $cityname; } //membership options $membership_options = array( 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', ); $row = $query->row_array(); $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->load('overlay', 'university/edit_view', array('record' => $row, 'organizations_options' => $organizations_options, 'membership_options' => $membership_options, 'city_options' => $city_options)); } } public function delete_view() { $this->logOverlay(); if (isset($_POST['submit'])) { $uid = set_value('uid'); //call model $this->university_model->deleteUniversity($uid); // $this->cache->clean(); $data['redirect_url'] = '/page/view/university-information/'; $this->load->view('overlay/redirectparent', $data); } else { //orgLocation uid $uid = $this->uri->segment(3); //dan checken of er programs gekoppeld zijn aan dit uid $do_delete = $this->university_model->checkUniversityUid($uid); if ($do_delete == true) { //overlay laden met submitknop naar delete $this->template->load('overlay', 'university/delete_view', array('uid' => $uid)); } else { //overlay laden met foutmelding $this->template->load('overlay', 'university/delete_error', array('page' => 'university', 'error' => 'Er zijn nog opleidingen gekoppeld op deze universiteit, deleten is niet mogelijk!')); } } } public function add_view() { $this->logOverlay(); $this->template->addExtraJs('/template/js/university_edit.js'); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); if (isset($_POST['submit'])) { $uid = set_value('uid'); //check fields $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
', '
'); $validate_result = $this->validateUniversity(); if ($validate_result == TRUE) { if (set_value('city_custom') != '') $city = set_value('city_custom'); else $city = set_value('city'); $data = array( 'uid' => '', 'organization_uid' => set_value('organization_uid'), 'brin' => set_value('brin'), 'brin_index' => set_value('brin_index'), 'name_nl' => set_value('name_nl'), 'name_en' => set_value('name_en'), 'logo' => set_value('logo'), 'url_path_segment_nl' => set_value('url_path_segment_nl'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'shortDescription_nl' => html_entity_decode(set_value('shortDescription_nl')), 'shortDescription_en' => html_entity_decode(set_value('shortDescription_en')), 'departments_nl' => html_entity_decode(set_value('departments_nl')), 'departments_en' => html_entity_decode(set_value('departments_en')), 'city' => $city, 'homepage_nl' => set_value('homepage_nl'), 'homepage_en' => set_value('homepage_en'), 'sksVid' => set_value('sksVid'), 'membership_status' => set_value('membership_status'), 'email' => set_value('email'), ); //call model $lastinsertid = $this->university_model->insertUniversity($data); $data['redirect_url'] = '/university/view/' .set_value('url_path_segment_en').'/'.$lastinsertid; $this->load->view('overlay/redirectparent', $data); } } //organizations options foreach ($this->university_model->getOrganizations() as $row) { $organizations_options[$row->uid] = $row->name_en; } //city options foreach ($this->university_model->getCities() as $row) { if ($row->city_name == 'The Hague') $cityname = 'Den Haag'; else $cityname = $row->city_name; $city_options[$cityname] = $cityname; } //membership options $membership_options = array( 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', ); $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->load('overlay', 'university/add_view', array('record' => $row, 'organizations_options' => $organizations_options, 'membership_options' => $membership_options, 'city_options' => $city_options)); } private function validateUniversity() { $rules = array( array( 'field' => 'organization_uid', 'label' => 'Organization uid', 'rules' => 'required' ), array( 'field' => 'brin', 'label' => 'Brin', 'rules' => 'trim|required' ), array( 'field' => 'brin_index', 'label' => 'Brin index', 'rules' => 'trim|required' ), array( 'field' => 'name_nl', 'label' => 'Name (nl)', 'rules' => 'trim|required' ), array( 'field' => 'name_en', 'label' => 'Name (en)', 'rules' => 'trim|required' ), array( 'field' => 'logo', 'label' => 'Logo', 'rules' => 'trim|required' ), array( 'field' => 'url_path_segment_nl', 'label' => 'URL path segment (nl)', 'rules' => 'trim|required' ), array( 'field' => 'url_path_segment_en', 'label' => 'URL path segment (en)', 'rules' => 'trim|required' ), array( 'field' => 'shortDescription_nl', 'label' => 'Short Description (nl)', 'rules' => 'trim' ), array( 'field' => 'shortDescription_en', 'label' => 'Short Description (en)', 'rules' => 'trim' ), array( 'field' => 'departments_nl', 'label' => 'Departments (nl)', 'rules' => 'trim' ), array( 'field' => 'departments_en', 'label' => 'Departments (en)', 'rules' => 'trim' ), array( 'field' => 'city', 'label' => 'City', 'rules' => 'required' ), array( 'field' => 'city_custom', 'label' => 'City Custom', 'rules' => 'trim' ), array( 'field' => 'homepage_nl', 'label' => 'Homepage (nl)', 'rules' => 'trim' ), array( 'field' => 'homepage_en', 'label' => 'Homepage (en)', 'rules' => 'trim' ), array( 'field' => 'sksVid', 'label' => 'sksVid', 'rules' => 'trim' ), array( 'field' => 'membership_status', 'label' => 'Membership status', 'rules' => 'required' ), array( 'field' => 'email', 'label' => 'Email', 'rules' => 'valid_email' ), ); $this->form_validation->set_rules($rules); return $this->form_validation->run(); } ################################################################################################################## public function edit_fair() { $this->logOverlay(); $this->template->addExtraJs('/template/js/fair_edit.js'); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); if (isset($_POST['submit'])) { $uid = set_value('uid'); //check fields $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
', '
'); $validate_result = $this->validateFair(); if ($validate_result == TRUE) { $data = array( 'brin' => set_value('brin'), 'name_nl' => set_value('name_nl'), 'name_en' => set_value('name_en'), 'logo' => set_value('logo'), 'logo_overview_fair' => set_value('logo_overview_fair'), 'url_path_segment_nl' => set_value('url_path_segment_nl'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'organizationType_uid' => set_value('organizationType_uid'), 'timesRanking' => set_value('timesRanking'), 'qsRanking' => set_value('qsRanking'), 'homepage_nl' => set_value('homepage_nl'), 'homepage_en' => set_value('homepage_en'), 'facebook_nl' => set_value('facebook_nl'), 'facebook_en' => set_value('facebook_en'), 'twitter_nl' => set_value('twitter_nl'), 'twitter_en' => set_value('twitter_en'), 'youtube_nl' => set_value('youtube_nl'), 'youtube_en' => set_value('youtube_en'), 'video_nl' => html_entity_decode(set_value('video_nl')), 'video_en' => html_entity_decode(set_value('video_en')), 'linkedin_nl' => set_value('linkedin_nl'), 'linkedin_en' => set_value('linkedin_en'), 'poster_nl' => set_value('poster_nl'), 'poster_en' => set_value('poster_en'), 'poster_url_nl' => set_value('poster_url_nl'), 'poster_url_en' => set_value('poster_url_en'), 'hodexOrgUnitId' => set_value('hodexOrgUnitId'), 'hodexUrl' => set_value('hodexUrl'), 'sksIid' => set_value('sksIid'), 'email' => set_value('email'), 'membership_status' => set_value('membership_status'), ); //call model $this->university_model->updateFair($data, $uid); $this->load->view('overlay/reloadparent'); } } $query = $this->db->get_where('organization', array('uid' => $this->uri->segment(3))); if ($query->num_rows() == 1) { //organization type options foreach ($this->university_model->getOrganizationTypes() as $row) { $organization_type_options[$row->uid] = $row->name_en; } //membership options $membership_options = array( 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', ); $row = $query->row_array(); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); $this->template->load('overlay', 'university/edit_fair', array('record' => $row, 'organization_type_options' => $organization_type_options, 'membership_options' => $membership_options)); } } public function delete_fair() { $this->logOverlay(); if (isset($_POST['submit'])) { $uid = set_value('uid'); //call model $this->university_model->deleteFair($uid); // $this->cache->clean(); $data['redirect_url'] = '/page/view/university-information/'; $this->load->view('overlay/redirectparent', $data); } else { //dan checken of er vestigingen gekoppeld zijn aan deze hoofdinstelling $do_delete = $this->university_model->checkFair($this->uri->segment(3)); if ($do_delete == true) { //overlay laden met submitknop naar delete $this->template->load('overlay', 'university/delete_fair', array('uid' => $this->uri->segment(3))); } else { //overlay laden met foutmelding $this->template->load('overlay', 'university/delete_error', array('page' => 'fair', 'error' => 'Er zijn nog vestigingen gekoppeld op deze hoofdinstelling, deleten is niet mogelijk!')); } } } public function add_fair() { $this->logOverlay(); $this->template->addExtraJs('/template/js/fair_edit.js'); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); if (isset($_POST['submit'])) { $uid = set_value('uid'); //check fields $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
', '
'); $validate_result = $this->validateFair(); if ($validate_result == TRUE) { $data = array( 'brin' => set_value('brin'), 'name_nl' => set_value('name_nl'), 'name_en' => set_value('name_en'), 'logo' => set_value('logo'), 'logo_overview_fair' => set_value('logo_overview_fair'), 'url_path_segment_nl' => set_value('url_path_segment_nl'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'organizationType_uid' => set_value('organizationType_uid'), 'timesRanking' => set_value('timesRanking'), 'qsRanking' => set_value('qsRanking'), 'homepage_nl' => set_value('homepage_nl'), 'homepage_en' => set_value('homepage_en'), 'facebook_nl' => set_value('facebook_nl'), 'facebook_en' => set_value('facebook_en'), 'twitter_nl' => set_value('twitter_nl'), 'twitter_en' => set_value('twitter_en'), 'youtube_nl' => set_value('youtube_nl'), 'youtube_en' => set_value('youtube_en'), 'video_nl' => html_entity_decode(set_value('video_nl')), 'video_en' => html_entity_decode(set_value('video_en')), 'linkedin_nl' => set_value('linkedin_nl'), 'linkedin_en' => set_value('linkedin_en'), 'poster_nl' => set_value('poster_nl'), 'poster_en' => set_value('poster_en'), 'poster_url_nl' => set_value('poster_url_nl'), 'poster_url_en' => set_value('poster_url_en'), 'hodexOrgUnitId' => set_value('hodexOrgUnitId'), 'hodexUrl' => set_value('hodexUrl'), 'sksIid' => set_value('sksIid'), 'email' => set_value('email'), 'membership_status' => set_value('membership_status'), ); //call model $lastinsertid = $this->university_model->insertFair($data); //overnemen van data uit orglocation //if ( set_value('homepage_nl') ) $homepage_nl = set_value('homepage_nl'); else $homepage_nl = ''; //if ( set_value('homepage_en') ) $homepage_en = set_value('homepage_en'); else $homepage_en = ''; //if ( set_value('email') ) $email = set_value('email'); else $email = ''; //er moet ook een record komen in orgLocation /*$data2 = array( 'uid' => '', 'organization_uid' => $lastinsertid, 'brin' => set_value('brin'), 'brin_index' => '', 'name_nl' => set_value('name_nl'), 'name_en' => set_value('name_en'), 'logo' => '', 'url_path_segment_nl' => set_value('url_path_segment_nl'), 'url_path_segment_en' => set_value('url_path_segment_en'), 'shortDescription_nl' => '', 'shortDescription_en' => '', 'departments_nl' => '', 'departments_en' => '', 'city' => '', 'homepage_nl' => $homepage_nl, 'homepage_en' => $homepage_en, 'sksVid' => '', 'membership_status' => 'D', 'email' => $email, ); //call model $this->university_model->insertUniversity($data2); */ $data['redirect_url'] = '/university/fair/' .set_value('url_path_segment_en').'/'.$lastinsertid; $this->load->view('overlay/redirectparent', $data); } } $query = $this->db->get_where('organization', array('uid' => $this->uri->segment(3))); if ($query->num_rows() == 1) { //organization type options foreach ($this->university_model->getOrganizationTypes() as $row) { $organization_type_options[$row->uid] = $row->name_en; } //membership options $membership_options = array( 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', ); $row = $query->row_array(); $this->template->addExtraJs('/template/ckfinder/ckfinder.js'); $this->template->load('overlay', 'university/add_fair', array('record' => $row, 'organization_type_options' => $organization_type_options, 'membership_options' => $membership_options)); } } private function validateFair() { $rules = array( array( 'field' => 'brin', 'label' => 'Brin', 'rules' => 'trim|required' ), array( 'field' => 'name_nl', 'label' => 'Name (nl)', 'rules' => 'trim|required' ), array( 'field' => 'name_en', 'label' => 'Name (en)', 'rules' => 'trim|required' ), array( 'field' => 'logo', 'label' => 'Logo', 'rules' => 'trim' ), array( 'field' => 'logo_overview_fair', 'label' => 'Logo overview fair', 'rules' => 'trim' ), array( 'field' => 'url_path_segment_nl', 'label' => 'Url path segment (nl)', 'rules' => 'trim|required' ), array( 'field' => 'url_path_segment_en', 'label' => 'Url path segment (en)', 'rules' => 'trim|required' ), array( 'field' => 'organizationType_uid', 'label' => 'OrganizationType uid', 'rules' => 'trim|required' ), array( 'field' => 'timesRanking', 'label' => 'TimesRanking', 'rules' => 'trim' ), array( 'field' => 'qsRanking', 'label' => 'qs Ranking', 'rules' => 'trim' ), array( 'field' => 'homepage_nl', 'label' => 'Homepage (nl)', 'rules' => 'trim' ), array( 'field' => 'homepage_en', 'label' => 'Homepage (en)', 'rules' => 'trim' ), array( 'field' => 'facebook_nl', 'label' => 'Facebook (nl)', 'rules' => 'trim' ), array( 'field' => 'facebook_en', 'label' => 'Facebook (en)', 'rules' => 'trim' ), array( 'field' => 'twitter_nl', 'label' => 'Twitter (nl)', 'rules' => 'trim' ), array( 'field' => 'twitter_en', 'label' => 'Twitter (en)', 'rules' => 'trim' ), array( 'field' => 'youtube_nl', 'label' => 'Youtube (nl)', 'rules' => 'trim' ), array( 'field' => 'youtube_en', 'label' => 'Youtube (en)', 'rules' => 'trim' ), array( 'field' => 'video_nl', 'label' => 'Video (nl)', 'rules' => 'trim' ), array( 'field' => 'video_en', 'label' => 'Video (en)', 'rules' => 'trim' ), array( 'field' => 'linkedin_nl', 'label' => 'LinkedIn (nl)', 'rules' => 'trim' ), array( 'field' => 'linkedin_en', 'label' => 'LinkedIn (en)', 'rules' => 'trim' ), array( 'field' => 'poster_nl', 'label' => 'Poster (nl)', 'rules' => 'trim' ), array( 'field' => 'poster_en', 'label' => 'Poster (en)', 'rules' => 'trim' ), array( 'field' => 'poster_url_nl', 'label' => 'Poster url (nl)', 'rules' => 'trim' ), array( 'field' => 'poster_url_en', 'label' => 'Poster url (en)', 'rules' => 'trim' ), array( 'field' => 'hodexOrgUnitId', 'label' => 'HodexOrgUnitId', 'rules' => 'trim' ), array( 'field' => 'hodexUrl', 'label' => 'HodexUrl', 'rules' => 'trim' ), array( 'field' => 'sksIid', 'label' => 'sksIid', 'rules' => 'trim' ), array( 'field' => 'email', 'label' => 'Email', 'rules' => 'valid_email' ), array( 'field' => 'membership_status', 'label' => 'Membership status', 'rules' => 'trim|required' ), ); $this->form_validation->set_rules($rules); return $this->form_validation->run(); } ######################################################################### private function makeAdminMenu($uid = NULL, $page) { if ( $page == 'view') { if ($this->user->hasPermission('university', 'edit_view') && $uid != NULL) { $this->template->addAdminMenu('edit', site_url('university/edit_view/'.$uid)); } if ($this->user->hasPermission('university', 'delete_view') && $uid != NULL) { $this->template->addAdminMenu('delete', site_url('university/delete_view/'.$uid)); } if ($this->user->hasPermission('university', 'add_view') && $uid != NULL) { $this->template->addAdminMenu('add', site_url('university/add_view/'.$uid)); } } if ( $page == 'fair') { if ($this->user->hasPermission('university', 'edit_fair') && $uid != NULL) { $this->template->addAdminMenu('edit', site_url('university/edit_fair/'.$uid)); } if ($this->user->hasPermission('university', 'delete_fair') && $uid != NULL) { $this->template->addAdminMenu('delete', site_url('university/delete_fair/'.$uid)); } if ($this->user->hasPermission('university', 'add_fair') && $uid != NULL) { $this->template->addAdminMenu('add', site_url('university/add_fair/'.$uid)); } } } }

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/university.php:1186)

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.