2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Adaptive Technology Resource Centre / Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /***********************************************************************/
15 define(AT_INCLUDE_PATH, '../../../include/');
16 include(AT_INCLUDE_PATH.'vitals.inc.php');
17 include(AT_JB_INCLUDE.'classes/Employer.class.php');
18 $_custom_css = $_base_path . AT_JB_BASENAME . 'module.css'; // use a custom stylesheet
20 admin_authenticate(AT_ADMIN_PRIV_JOB_BOARD);
23 * Add the submenu on this page so that user can go back to the listing.
24 * Reason why this is not included in module.php is because we don't want the
25 * 'edit_post' submenu to show on job_board/index.php
27 $_pages[AT_JB_BASENAME.'admin/employers.php']['children'] = array(AT_JB_BASENAME.'admin/edit_employer.php');
30 $employer = new Employer($_GET['eid']);
32 //save profile changes
33 if ($_POST['submit']){
34 $name = $_POST['jb_employer_name'];
35 $pass = $_POST['jb_employer_password_hidden'];
36 $company = $_POST['jb_employer_company'];
37 $email = $_POST['jb_employer_email'];
38 $email2 = $_POST['jb_employer_email2'];
39 $website = $_POST['jb_employer_website'];
40 $description = $_POST['jb_employer_description'];
41 $approval_state = $_POST['jb_employer_approval_state'];
43 //check if email has been changed. If it's been changed, check the 2 emails.
44 if ($email!=$employer->getEmail()){
46 $msg->addError('EMAIL_MISMATCH');
47 header('Location: edit_employer.php');
53 if ($_POST['jb_employer_password_error'] != ''){
54 $errors = explode(',', $_POST['jb_employer_password_error']);
55 if(sizeof($errors) > 0){
56 foreach($errors as $err){
60 header('Location: edit_employer.php?eid='.intval($_GET['eid']));
65 if ($pass!='' && strlen($pass)==40){
66 $employer->updatePassword($pass);
70 $employer->setApprovalState($approval_state);
72 if ($employer->updateProfile($name, $company, $email, $website, $description)){
73 $msg->addFeedback('JB_PROFILE_UPDATED');
75 $msg->addError('DB_NOT_UPDATED');
77 header('Location: employers.php');
81 include(AT_INCLUDE_PATH.'header.inc.php');
82 $savant->assign('name', $employer->getName());
83 $savant->assign('company', $employer->getCompany());
84 $savant->assign('email', $employer->getEmail());
85 $savant->assign('website', $employer->getWebsite());
86 $savant->assign('description', $employer->getDescription());
87 $savant->assign('approval_state', $employer->getApprovalState());
88 $savant->display('admin/jb_edit_employer.tmpl.php');
89 include(AT_INCLUDE_PATH.'footer.inc.php');