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 /***********************************************************************/
14 $_user_location='public';
15 define(AT_INCLUDE_PATH, '../../../include/');
16 include(AT_INCLUDE_PATH.'vitals.inc.php');
17 include(AT_JB_INCLUDE.'classes/Job.class.php');
18 include(AT_JB_INCLUDE.'classes/Employer.class.php');
19 $_custom_css = $_base_path . AT_JB_BASENAME . 'module.css'; // use a custom stylesheet
21 if (!Employer::authenticate()){
22 $msg->addError('ACCESS_DENIED');
23 header('Location: ../index.php');
28 $employer = new Employer($_SESSION['jb_employer_id']);
30 //save profile changes
31 if ($_POST['submit']){
32 $name = $_POST['jb_employer_name'];
33 $pass = $_POST['jb_employer_password_hidden'];
34 $company = $_POST['jb_employer_company'];
35 $email = $_POST['jb_employer_email'];
36 $email2 = $_POST['jb_employer_email2'];
37 $website = $_POST['jb_employer_website'];
38 $description = $_POST['jb_employer_description'];
40 //check if email has been changed. If it's been changed, check the 2 emails.
41 if ($email!=$employer->getEmail()){
43 $msg->addError('EMAIL_MISMATCH');
44 header('Location: profile.php');
50 if ($_POST['jb_employer_password_error'] != ''){
51 $errors = explode(',', $_POST['jb_employer_password_error']);
52 if(sizeof($errors) > 0){
53 foreach($errors as $err){
57 header('Location: profile.php');
62 if ($pass!='' && strlen($pass)==40){
63 $employer->updatePassword($pass);
66 if ($employer->updateProfile($name, $company, $email, $website, $description)){
67 $msg->addFeedback('JB_PROFILE_UPDATED');
69 $msg->addFeedback('DB_NOT_UPDATED');
71 header('Location: profile.php');
75 include(AT_INCLUDE_PATH.'header.inc.php');
77 echo '<div class="pageinator_box">';
78 $savant->display('employer/jb_employer_header.tmpl.php');
80 $savant->assign('name', $employer->getName());
81 $savant->assign('company', $employer->getCompany());
82 $savant->assign('email', $employer->getEmail());
83 $savant->assign('website', $employer->getWebsite());
84 $savant->assign('description', $employer->getDescription());
85 $savant->display('employer/jb_profile.tmpl.php');
86 include(AT_INCLUDE_PATH.'footer.inc.php');