public function setAttributes($values, $safeOnly = true) { parent::setAttributes($values, $safeOnly); if (isset($values['regTime'])) { $this->setRegTime($values['regTime']); } if (isset($values['id'])) { $this->id = $values['id']; } }
/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { // renders the view file 'protected/views/site/index.php' // using the default layout 'protected/views/layouts/main.php' $cache_name = 'oprecx:Recruitment:active10'; if (($recs = O::app()->cache->get($cache_name)) == false) { $recs = Recruitment::model()->findAll(array('condition' => 'reg_time_begin <= CURRENT_TIMESTAMP AND reg_time_end >= CURRENT_TIMESTAMP', 'order' => 'reg_time_end DESC', 'limit' => 10)); O::app()->cache->set($cache_name, $recs); } $this->render('index', array('recs' => $recs)); }
public function init() { $params = $this->actionParams; if (isset($params['rec_name'])) { $this->_rec = Recruitment::model()->findByName($params['rec_name']); // Organizations::model()->findByAttributes(array('name' => $params['org'])); if (null == $this->_rec) { throw new CHttpException(404, O::t('oprecx', 'Recruitment {rec} Not Found.', array('{rec}' => $params['rec_name']))); } try { $timezone = $this->_rec->timezone; O::app()->setTimeZone($timezone); } catch (Exception $e) { O::log('Setting timezone failed'); } } else { throw new CHttpException(404, O::t('oprecx', 'Page Not Found "{action}".')); } //$this->isWizard = isset($params['wiz']) && $params['wiz'] == 1; //var_dump($this->actionParams); }
<?php $objRecruitment = new Recruitment(); ?> <h2>Applications for Current Recruitments</h2> <?php $applications = $objRecruitment->getApplicationsForCurrentRecruitment(); //print_r($applications); ?> <?php foreach ($applications as $project) { ?> <h6><?php echo strtoupper($project['project']); ?> </h6> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <th class="borderRight"></th> <th>Pending</th> <th>Selected For Interview</th> <th class="borderRight">Accepted</th> <th>Rejected</th> </tr> <?php foreach ($project['teams'] as $team) { ?>
<?php if (isset($data['params'])) { $params = $data['params']; $id = $params['id']; } else { $id = $data['id']; } $objRecruitment = new Recruitment(); $recruitment = $objRecruitment->getRecruitmentById($id); $questions = $objRecruitment->getQuestionsForRecruitment($recruitment['id']); if (count($questions) == 0) { $can_published = false; } else { if (empty($recruitment['positions']) && empty($recruitment['requirements']) && empty($recruitment['responsibilities'])) { $can_published = false; } else { $can_published = true; } } ?> <div class="sectionParams" data-params="id=<?php echo $id; ?> "></div> <table cellpadding="0" cellspacing="0" border="0" style="width:100%;"> <tr> <td style="width:45%;margin:right:5%;" class="alignTop" > <h2>Current Job Description</h2> <table cellpadding="0" cellspacing="0" border="0" > <tr>
<?php if (isset($data['params'])) { $params = $data['params']; $id = $params['id']; } else { $id = $data['id']; } $objRecruitment = new Recruitment(); $questions = $objRecruitment->getQuestionsForRecruitment($id); ?> <h2>Current Questions</h2> <div class="sectionParams" data-params="id=<?php echo $id; ?> "></div> <table cellpadding="0" cellspacing="0" border="0" style="width:100%;" data-object="question"> <tr> <th class="borderRight">+</th> <th>Question Display</th> <th colspan="2">Action</th> </tr> <tbody class="changeOrder" id="order"> <?php if (count($questions) > 0) { foreach ($questions as $question) { ?> <tr id="row-<?php echo $question['id']; ?> " data-id="<?php echo $question['id'];
<?php $rows = array(); $objRecruitment = new Recruitment(); $objProject = new Project(); $projects = $objProject->getAllProjectTypes(); $waves = $objProject->getWaves(); $objTeam = new Team(); $teams = $objTeam->getTeamsForSearch(); $objPosition = new Position(); $positions = $objPosition->getAllPositions(true); $objForm = new Form(); $criteria = array(); if ($objForm->isPost('position')) { $project = $objForm->getPost('project'); if (!empty($project)) { $criteria['project_type_id'] = $project; } $project_year = $objForm->getPost('project_year'); if (!empty($project_year)) { $criteria['project_year'] = $project_year; } $project_wave = $objForm->getPost('project_wave'); if (!empty($project_wave)) { $criteria['project_wave'] = $project_wave; } $team = $objForm->getPost('team'); if (!empty($team)) { $criteria['team_id'] = $team; } $position = $objForm->getPost('position');
switch ($case) { case 'recruitment': if (array_key_exists('deadline', $params)) { $deadline = date('Y-m-d', strtotime($params['deadline'])); $params['deadline'] = $deadline; } break; case 'question': if ($params['type'] == 'radio' || $params['type'] == 'checkbox' || $params['type'] == 'dropdown') { foreach ($params['existing_choices'] as $choice) { $objDbase->changeField('choice', $choice['id'], array('label' => $choice['label'])); } unset($params['existing_choices']); if (!empty($params['new_choices'])) { foreach ($params['new_choices'] as $choice) { $objRecruitment = new Recruitment(); $order = $objRecruitment->getChoiceLastPosition($id) + 1; $objDbase->add('choice', array('label' => $choice, 'question_id' => $id, 'order' => $order)); } } unset($params['new_choices']); } else { if ($params['max'] == 50) { $params['min'] = 10; } else { $params['min'] = $params['max'] - 50; } } break; } if ($objDbase->changeField($case, $id, $params)) {
/** * * @return Recruitment[] */ public function getMyRecruitments($limit = FALSE) { return Recruitment::model()->populateRecords(CDbCommandEx::create()->select('o.id, o.name, o.full_name')->from(TableNames::RECRUITMENT_as('o'))->join(TableNames::REC_ADMIN . ' oa', 'oa.rec_id = $o.id')->where('$oa.user_id = :user_id', array('user_id' => O::app()->user->id))->order('o.updated DESC')->queryAll()); }
<td style="width:32%"><strong>Max Word Limit * </strong></td> <td> <select name="max"> <?php for ($i = 50; $i <= 300; $i += 50) { echo '<option value="' . $i . '"'; echo $question['max'] == $i ? 'selected' : ''; echo '>' . $i . '</option>'; } ?> </select> </td> </tr> <?php } else { $objRecruitment = new Recruitment(); $choices = $objRecruitment->getQuestionChoices($question['id']); ?> <tr> <td style="width:32%" class=" alignTop"><strong>Question Choices *</strong></td> <td> <table cellpadding="0" cellspacing="0" border="0" style="width:100%" class="choices" data-object="choice"> <tr> <th style="width:5px;" class="borderRight">+</th> <th colspan="2">Content</th> </tr> <tbody class="choiceList changeOrder"> <?php foreach ($choices as $choice) { ?> <tr id="choice-<?php
<?php $objRecruitment = new Recruitment(); $objPage = new Page(); $recruitments = $objRecruitment->getCurrentRecruitments(); if (count($recruitments) > 0) { foreach ($recruitments as $recruitment) { ?> <tr data-id="<?php echo $recruitment['id']; ?> "> <td> <?php echo $recruitment['project']; ?> </td> <td> <?php echo $recruitment['position']; ?> </td> <td> <?php echo $recruitment['team']; ?> </td> <td> <?php echo date('d-m-Y', strtotime($recruitment['deadline'])); ?> </td>
//echo Helper::json('23:59:59 '.$params['deadline']); //echo Helper::json(strtotime('23:59:59 '.$params['deadline'])); //$deadline = date('Y-m-d H:i:s', strtotime('23:59:59 '.$params['deadline'])); //echo Helper::json($deadline); $deadline = date('Y-m-d', strtotime($params['deadline'])); $params['deadline'] = $deadline; //check if an identical recruitment has been added $recruitment = $objDbase->get('recruitment', array('project_id' => $params['project_id'], 'team_id' => $params['team_id'], 'position_id' => $params['position_id'], 'deadline' => $params['deadline'])); if (!empty($recruitment)) { echo Helper::json(array('success' => false)); exit; } break; case 'question': $type = $params['type']; $objRecruitment = new Recruitment(); if ($type == 'dropdown' || $type == 'radio' || $type == 'checkbox') { $choices = $params['choices']; unset($params['choices']); unset($params['max']); } else { if ($params['max'] == 50) { $params['min'] = 10; } else { $params['min'] = $params['max'] - 50; } } $order = $objRecruitment->getQuestionLastPosition($params['recruitment_id']) + 1; $params['order'] = $order; break; }