Exemple #1
0
 /**
  * @param Vacancy $vacancy
  */
 private function deactivateVacancy(Vacancy $vacancy)
 {
     $vacancy->status = Vacancy::STATUS_CLOSED;
     $vacancy->updated_by = 0;
     $vacancy->hash = md5(microtime(true) . $vacancy->user_id);
     $vacancy->save(false);
 }
 function redirectRole()
 {
     $userName = $this->input->post('userName');
     $password = $this->input->post('password');
     $this->load->model('user');
     $user = new user();
     $results = $user->searchUserByUsename($userName);
     if ($results[0]->userid == 1) {
         $this->load->model('Vacancy');
         $vacancy = new Vacancy();
         $array = $vacancy->getVacancyByUser($results[0]->userid);
         $data["vacancies"] = $array;
         $this->load->view('mainView', $data);
     } else {
         if ($results[0]->userid == 2) {
             $this->load->model('Vacancy');
             $vacancy = new Vacancy();
             $array = $vacancy->getVacancyByUser($results[0]->userid);
             $data["vacancies"] = $array;
             $this->load->view('employerView', $data);
         } else {
             if ($results[0]->userid == 3) {
                 $this->load->model('Event');
                 $event = new Event();
                 $array = $event->getAllEventByUser($results[0]->userid);
                 $data["events"] = $array;
                 $this->load->view('organizerview', $data);
             }
         }
     }
 }
Exemple #3
0
 public function actionAdd($isFancy = 0)
 {
     $model = new Vacancy();
     if (isset($_POST[$this->modelName]) && BlockIp::checkAllowIp(Yii::app()->controller->currentUserIpLong)) {
         $model->attributes = $_POST[$this->modelName];
         if ($model->validate()) {
             $model->user_ip = Yii::app()->controller->currentUserIp;
             $model->user_ip_ip2_long = Yii::app()->controller->currentUserIpLong;
             if ($model->save(false)) {
                 $model->name = CHtml::encode($model->name);
                 $model->body = CHtml::encode($model->body);
                 $notifier = new Notifier();
                 $notifier->raiseEvent('onNewReview', $model);
                 if (Yii::app()->user->checkAccess('vacancy_admin')) {
                     Yii::app()->user->setFlash('success', tt('success_send_not_moderation'));
                 } else {
                     Yii::app()->user->setFlash('success', tt('success_send'));
                 }
                 $this->redirect(array('index'));
             }
             $model->unsetAttributes(array('name', 'body', 'verifyCode'));
         } else {
             Yii::app()->user->setFlash('error', tt('failed_send'));
         }
         $model->unsetAttributes(array('verifyCode'));
     }
     if ($isFancy) {
         $this->excludeJs();
         $this->renderPartial('add', array('model' => $model), false, true);
     } else {
         $this->render('add', array('model' => $model));
     }
 }
Exemple #4
0
 /**
  * Activating vacancy form email link
  * @param $hash
  */
 public function actionActivate_vacancy($hash)
 {
     $hasError = true;
     $errorMessage = '';
     if (!empty($hash)) {
         $vacancy = Vacancy::model()->findByAttributes(['hash' => $hash]);
         if (!empty($vacancy)) {
             $vacancy->status = Vacancy::STATUS_OPEN;
             $vacancy->updated_by = $vacancy->user->id;
             $vacancy->close_time = new CDbExpression('NOW() + INTERVAL ' . Vacancy::INTERVAL_OPENED . ' DAY');
             $vacancy->hash = null;
             if ($vacancy->save()) {
                 $hasError = false;
                 Yii::app()->user->setFlash('success', Yii::t('main', 'vacancy.email.deactivate.message.success', [':date' => date("Y-m-d H:i:s", strtotime('+14day'))]));
             } else {
                 foreach ($vacancy->getErrors() as $err) {
                     $errorMessage .= " " . implode(";", $err);
                 }
             }
         }
     }
     if ($hasError) {
         Yii::app()->user->setFlash('error', Yii::t('main', 'vacancy.email.deactivate.message.error', [':message' => $errorMessage]));
     }
     if (Yii::app()->user->isGuest) {
         $this->redirect('/manage/login');
     } else {
         $this->redirect('/manage/employer/index');
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     DB::table('vacancies')->delete();
     Vacancy::create(array('title' => 'Game Developer (C++)', 'description' => 'Being a part of game developer’s team, you will participate in full cycle of game development process for iOS.', 'city' => 'Pervomaisk', 'category_id' => 3, 'dt_add' => '2015-08-03', 'user_id' => 1));
     $this->command->info('Vacancy table seeded!');
 }
 /**
  * @param $id
  * @return Vacancy
  * @throws CHttpException
  */
 private function getVacancy($id)
 {
     $vacancy = Vacancy::model()->findByPk($id);
     if (empty($vacancy)) {
         throw new CHttpException(404, 'Vacancy not found');
     }
     return $vacancy;
 }
 public function del($id)
 {
     /**
      * @var $obj Vacancy
      */
     $obj = Vacancy::findOrFail($id);
     $obj->delete();
     return Redirect::to(route('home'));
 }
Exemple #8
0
 public static function getLastReview()
 {
     $criteria = new CDbCriteria();
     $criteria->condition = 'active = ' . self::STATUS_ACTIVE;
     $criteria->limit = 1;
     $criteria->order = 'date_created DESC';
     $lastReview = Vacancy::model()->find($criteria);
     return $lastReview;
 }
Exemple #9
0
    ExceptionAllError::$log_type = 'file';
    ExceptionAllError::$log_file = ENGINE_DIR . "/job/logs/errors.log";
}
try {
    $tpl = new TemplateAdmin();
    Licencing::$tpl =& $tpl;
    $timer = new Timer($_TIME);
    if ($db->mysql_extend == 'MySQLi') {
        require_once ENGINE_DIR . "/Core_modules/MySQLi_DLE.php";
        $dbase = new MySQLi_DLE($db, $timer, $TABLES, PREFIX . "_");
    } else {
        require_once ENGINE_DIR . "/Core_modules/MySQL_DLE.php";
        $dbase = new MySQL_DLE($db, $timer, $TABLES, PREFIX . "_");
    }
    $job = new JobAdmin($job_cfg, $lang_job, $dbase);
    Company::$job = Vacancy::$job = Resume::$job =& $job;
    if ($config['version_id'] < 7.5) {
        $job->member = array("id" => $member_db[10], "name" => $member_db[2], "email" => $member_db[5], "group" => $member_db[1], "ip" => $member_db[15]);
    } else {
        $job->member = array("id" => $member_id['user_id'], "name" => $member_id['name'], "email" => $member_id['email'], "group" => $member_id['user_group'], "ip" => $member_id['logged_ip']);
    }
    if (get_magic_quotes_gpc() && function_exists('array_map_recursive')) {
        array_map_recursive('stripslashes', $_GET);
        array_map_recursive('stripslashes', $_POST);
        array_map_recursive('stripslashes', $_COOKIE);
        array_map_recursive('stripslashes', $_REQUEST);
    }
    if ($job->config['general_debug']) {
        $dbase->debug = true;
        TemplateAdmin::$Debug_info =& $dbase->query_list;
    }
 public function def()
 {
     $items = Vacancy::where('active', '=', 1)->orderBy('created_at', 'desc');
     return View::make('pages.home', array('items' => $items));
 }
 /**
  * POST Display a doDelete of the resource.
  *
  * @return Response
  */
 public function doDelete()
 {
     $aData = Input::all();
     if (isset($aData['id'])) {
         $vacancy = Vacancy::find($aData['id']);
         $vacancy->delete();
         return Redirect::route('vacancy-list')->with('message', 'Вакансия успешно удалена');
     }
     return Redirect::route('vacancy-list')->with('message', 'Произошла ошибка удаления');
 }
 public function home()
 {
     $aCategories = Category::all();
     $aVacancies = Vacancy::all();
     return View::make('home/index', array('aCategories' => $aCategories, 'aVacancies' => $aVacancies));
 }
Exemple #13
0
    $countCommentPending = Comment::getCountPending();
    $bageComments = $countCommentPending > 0 ? "&nbsp<span class=\"badge\">{$countCommentPending}</span>" : '';
}
$bageComplain = '';
if (issetModule('apartmentsComplain')) {
    $countComplainPending = ApartmentsComplain::getCountPending();
    $bageComplain = $countComplainPending > 0 ? "&nbsp<span class=\"badge\">{$countComplainPending}</span>" : '';
}
$bageReviews = '';
if (issetModule('reviews')) {
    $countReviewsPending = Reviews::getCountModeration();
    $bageReviews = $countReviewsPending > 0 ? "&nbsp<span class=\"badge\">{$countReviewsPending}</span>" : '';
}
$bageVacancy = '';
if (issetModule('vacancy')) {
    $countVacancyPending = Vacancy::getCountModeration();
    $bageVacancy = $countVacancyPending > 0 ? "&nbsp<span class=\"badge\">{$countVacancyPending}</span>" : '';
}
$bageBooking = '';
if (issetModule('bookingtable')) {
    $countNewPending = Bookingtable::getCountNew();
    $bageBooking = $countNewPending > 0 ? "&nbsp<span class=\"badge\">{$countNewPending}</span>" : '';
}
$bageMessages = '';
if (issetModule('messages')) {
    $countMessagesUnread = Messages::getCountUnread(Yii::app()->user->id);
    $bageMessages = $countMessagesUnread > 0 ? "&nbsp<span class=\"badge\">{$countMessagesUnread}</span>" : '';
}
?>

<div class="bootnavbar-delimiter"></div>
Exemple #14
0
<?php

define('LOGO_PATCH', ROOT_DIR . "/uploads/company_logo/");
define('PHOTO_PATCH', ROOT_DIR . "/uploads/resume_photo/");
define('LOGO_URL_PATCH', $config['http_home_url'] . "uploads/company_logo/");
define('PHOTO_URL_PATCH', $config['http_home_url'] . "uploads/resume_photo/");
define('AJAX', !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || !empty($_REQUEST['rndval']) ? TRUE : FALSE);
define('AJAX_INSIDE', empty($_REQUEST['inside']) ? false : true);
Company::$OPF_array = array('AF' => $lang_job['AF'], 'ZAO' => $lang_job['ZAO'], 'IP' => $lang_job['IP'], 'COO' => $lang_job['COO'], 'NKO' => $lang_job['NKO'], 'OAO' => $lang_job['OAO'], 'OOO' => $lang_job['OOO'], 'POO' => $lang_job['POO'], 'PAR' => $lang_job['PAR'], 'UE' => $lang_job['UE']);
Job::$currecy_array = array('USD' => $lang_job['USD'], 'RUR' => $lang_job['RUR'], 'EUR' => $lang_job['EUR']);
Vacancy::$fields = Resume::$fields = array("experience" => array(1 => $lang_job['experience_1'], $lang_job['experience_2'], $lang_job['experience_3'], $lang_job['experience_4'], $lang_job['experience_5'], $lang_job['experience_6']), "student" => array(1 => $lang_job['student_1'], $lang_job['student_2'], $lang_job['student_3'], $lang_job['student_4']), "education" => array(1 => $lang_job['education_1'], $lang_job['education_2'], $lang_job['education_3'], $lang_job['education_4'], $lang_job['education_5']), "language" => array(1 => $lang_job['language_1'], $lang_job['language_2'], $lang_job['language_3'], $lang_job['language_4'], $lang_job['language_5'], $lang_job['language_6'], $lang_job['language_7'], $lang_job['language_8']), "work_place" => array(1 => $lang_job['work_place_1'], $lang_job['work_place_2']), "work_type" => array(1 => $lang_job['work_type_1'], $lang_job['work_type_2']), "work_schedule" => array(1 => $lang_job['work_schedule_1'], $lang_job['work_schedule_2'], $lang_job['work_schedule_3']), "sex" => array(0 => $lang_job['no_show'], "M" => $lang_job['sex_man'], "W" => $lang_job['sex_woman']));
Vacancy::$count_day_array = Resume::$count_day_array = array(-1 => $lang_job['count_day_never'], 10 => $lang_job['count_day_10'], 14 => $lang_job['count_day_14'], 21 => $lang_job['count_day_21'], 31 => $lang_job['count_day_31'], 62 => $lang_job['count_day_62']);
Vacancy::$search_count_day = Resume::$search_count_day = array(-1 => $lang_job['search_day_all'], 10 => $lang_job['search_day_10'], 14 => $lang_job['search_day_14'], 21 => $lang_job['search_day_21'], 31 => $lang_job['search_day_31'], 62 => $lang_job['search_day_62']);
$TABLES = array('job_companies' => array('company_id' => 'int', 'user_id' => 'int', 'user_name' => 'string', 'name' => 'string', 'alt_name' => 'string', 'company_type' => array('PA', 'EM'), 'OPF' => 'string', 'contact_person' => 'string', 'description' => 'string', 'logo' => 'string', 'country_id' => 'int', 'city_id' => 'int', 'phone' => 'string', 'site' => 'string', 'email' => 'string', 'address' => 'string', 'date_register' => 'string', 'xfields' => 'string', 'add_date' => 'int'), 'job_vacancies' => array('id' => 'int', 'user_id' => 'int', 'user_name' => 'string', 'country_id' => 'int', 'city_id' => 'int', 'sphere_id' => 'int', 'specialty_id' => 'int', 'company_id' => 'int', 'view_count' => 'int', 'experience' => 'int', 'student' => 'int', 'education' => 'int', 'age_min' => 'int', 'age_max' => 'int', 'salary_min' => 'int', 'salary_min_search' => 'int', 'salary_max' => 'int', 'salary_max_search' => 'int', 'currency' => 'string', 'sex' => array('M', 'W', '0'), 'language' => 'int', 'work_place' => 'int', 'work_type' => 'int', 'work_schedule' => 'int', 'description' => 'string', 'contact_person' => 'string', 'email' => 'string', 'phone' => 'string', 'xfields' => 'string', 'add_date' => 'int', 'date_exp' => 'int', 'allow_site' => 'int'), 'job_resumes' => array('id' => 'int', 'user_id' => 'int', 'user_name' => 'string', 'country_id' => 'int', 'photo' => 'string', 'city_id' => 'int', 'sphere_id' => 'int', 'specialty_id' => 'int', 'view_count' => 'int', 'experience' => 'int', 'student' => 'int', 'education' => 'int', 'age' => 'int', 'salary_min' => 'int', 'salary_min_search' => 'int', 'salary_max' => 'int', 'salary_max_search' => 'int', 'currency' => 'string', 'sex' => array('M', 'W', '0'), 'language' => 'int', 'work_place' => 'int', 'work_type' => 'int', 'work_schedule' => 'int', 'description' => 'string', 'contact_person' => 'string', 'email' => 'string', 'phone' => 'string', 'xfields' => 'string', 'add_date' => 'int', 'date_exp' => 'int', 'allow_site' => 'int'), 'job_spheres' => array('id' => 'int', 'name' => 'string', 'alt_name' => 'string'), 'job_specialties' => array('id' => 'int', 'sphere_id' => 'int', 'name' => 'string', 'alt_name' => 'string'), 'job_countries' => array('id' => 'int', 'name' => 'string', 'alt_name' => 'string'), 'job_cities' => array('id' => 'int', 'country_id' => 'int', 'name' => 'string', 'alt_name' => 'string'), 'job_fields' => array('id' => 'int', 'ctype' => 'int', 'title' => 'string', 'description' => 'string', 'type' => array('text', 'select', 'textarea', 'checkbox'), 'data' => 'string', 'regex' => 'string', 'required' => 'int', 'active' => 'int', 'default' => 'string'));
Vacancy::$DB_fields = array_merge(array_keys($TABLES['job_vacancies']), array('sphere_name', 'specialty_name', 'country_name', 'city_name', 'company_name'));
Resume::$DB_fields = array_merge(array_keys($TABLES['job_resumes']), array('sphere_name', 'specialty_name', 'country_name', 'city_name'));
Company::$DB_fields = array_merge(array_keys($TABLES['job_companies']), array('country_name', 'city_name'));
Vacancy::$search_fields = array_merge(array('id', 'user_id', 'country_id', 'city_id', 'sphere_id', 'specialty_id', 'company_id', 'age', 'salary_min', 'salary_max', 'description', 'add_date'), array_keys(Vacancy::$fields));
Resume::$search_fields = array_merge(array('id', 'user_id', 'country_id', 'city_id', 'sphere_id', 'specialty_id', 'age_min', 'age_max', 'salary_min', 'salary_max', 'sex', 'description', 'add_date', 'allow_site'), array_keys(Resume::$fields));
Company::$search_fields = array('company_id', 'user_id', 'name', 'company_type', 'OPF', 'country_id', 'city_id');
Vacancy::$sort_array = array('salary' => $lang_job['sort_salary'], 'age' => $lang_job['sort_age'], 'add_date' => $lang_job['sort_add_date'], 'sex' => $lang_job['sort_sex']);
Resume::$sort_array = array('salary' => $lang_job['sort_salary'], 'age' => $lang_job['sort_age'], 'add_date' => $lang_job['sort_add_date'], 'sex' => $lang_job['sort_sex']);
define('XFIELDS_VACANCY', 2);
define('XFIELDS_RESUME', 4);
define('XFIELDS_COMPANY', 8);
Exemple #15
0
 public function getModelClass()
 {
     return Vacancy::className();
 }
 function getVacancyByUserID()
 {
     $this->load->model('Vacancy');
     $vacancy = new Vacancy();
     $vacancy->getVacancyByUser(1);
 }