function doUp() { $default_job_types = ["Software Engineer", "Deployment Engineer", "Solutions Architect", "Network", "AppDev", "Marketing"]; foreach ($default_job_types as $type) { $new_job_type = new JobType(); $new_job_type->Type = $type; $new_job_type->write(); } }
function __construct($controller, $name, $use_actions = true) { $fields = new FieldList(); //point of contact $fields->push($point_of_contact_name = new TextField('point_of_contact_name', 'Name')); $fields->push($point_of_contact_email = new EmailField('point_of_contact_email', 'Email')); //main info $fields->push($title = new TextField('title', 'Title')); $fields->push($url = new TextField('url', 'Url')); $fields->push(new CheckboxField('is_coa_needed', 'Is COA needed?')); $fields->push($ddl_type = new DropdownField('job_type', 'Job Type', JobType::get()->sort("Type")->map("ID", "Type"))); $ddl_type->setEmptyString("--SELECT A JOB TYPE --"); $fields->push($description = new HtmlEditorField('description', 'Description')); $fields->push($instructions = new HtmlEditorField('instructions', 'Instructions To Apply')); $fields->push($expiration_date = new TextField('expiration_date', 'Expiration Date')); $fields->push($company = new CompanyField('company', 'Company')); $point_of_contact_name->addExtraClass('job_control'); $point_of_contact_email->addExtraClass('job_control'); $title->addExtraClass('job_control'); $url->addExtraClass('job_control'); $description->addExtraClass('job_control'); $instructions->addExtraClass('job_control'); $expiration_date->addExtraClass('job_control'); $company->addExtraClass('job_control'); //location $ddl_locations = new DropdownField('location_type', 'Location Type', array('N/A' => 'N/A', 'Remote' => 'Remote', 'Various' => 'Add a Location')); $ddl_locations->addExtraClass('location_type'); $ddl_locations->addExtraClass('job_control'); $fields->push($ddl_locations); $fields->push($city = new TextField('city', 'City')); $fields->push($state = new TextField('state', 'State')); $fields->push($country = new CountryDropdownField('country', 'Country')); $city->addExtraClass('physical_location'); $state->addExtraClass('physical_location'); $country->addExtraClass('physical_location'); // Guard against automated spam registrations by optionally adding a field // that is supposed to stay blank (and is hidden from most humans). // The label and field name are intentionally common ("username"), // as most spam bots won't resist filling it out. The actual username field // on the forum is called "Nickname". $fields->push(new TextField('user_name', 'UserName')); // Create action $actions = new FieldList(); if ($use_actions) { $actions->push(new FormAction('saveJobRegistrationRequest', 'Save')); } // Create validators $validator = new ConditionalAndValidationRule([new HtmlPurifierRequiredValidator('title', 'instructions', 'description'), new RequiredFields('job_type', 'point_of_contact_name', 'point_of_contact_email')]); $this->addExtraClass('job-registration-form'); $this->addExtraClass('input-form'); parent::__construct($controller, $name, $fields, $actions, $validator); }
$req = return_url(); $var_name = $req[1]; $jobs = $job->find_by_var_name($var_name); $job_id = (int) $jobs->id; if ($jobs && !empty($jobs)) { $html_title = SITE_NAME . " - " . $jobs->job_title; $meta_description = seo_words(subtrack_string($jobs->job_description, 250)); $meta_keywords = seo_words(subtrack_string($jobs->job_description, 150)); $id = (int) $jobs->id; $jobs->update_views(); //job type $type = Job2Type::find_all_type_by_jobid($id); $type2 = array(); $i = 1; foreach ($type as $job_type) { $type_name = JobType::find_by_id($job_type->fk_job_type_id); $type2[$i]['name'] = $type_name->type_name; $type2[$i]['var_name'] = $type_name->var_name; $i++; } $smarty->assign('jobtype', $type2); $smarty->assign('var_name', $jobs->var_name); $smarty->assign('job_ref', $jobs->job_ref); $smarty->assign('job_title', $jobs->job_title); $smarty->assign('job_description', $jobs->job_description); $smarty->assign('job_postion', $jobs->job_postion); //locations //country $country_arry = Country::find_by_code($jobs->country); //$country_a($country_arry) ? $country_arry->code : $country_a; $country_var_name = $country_arry->var_name;
################# JOB TYPE ################## $job_type_ns = Job2Type::find_all_type_by_jobid($job_id); $job_type_id = array(); foreach ($job_type_ns as $job_type) { $job_type_id[] = $job_type->fk_job_type_id; } $smarty->assign('type_selected', $job_type_id); ########## job_statu_id ####################### $job_statu_id = array(); $job_statu_ns = Job2Status::find_by_job_id($job_id); foreach ($job_statu_ns as $job_statuss) { $job_statu_id[] = $job_statuss->fk_job_status_id; } $smarty->assign('status_selected', $job_statu_id); ######################################################## $job_types = JobType::find_all(); if (is_array($job_types) and !empty($job_types)) { $job_t = array(); foreach ($job_types as $job_type) { $job_t[$job_type->id] = $job_type->type_name; } $smarty->assign('job_type', $job_t); } $job_status = JobStatus::find_all(); if (is_array($job_status) and !empty($job_status)) { $statu_t = array(); foreach ($job_status as $job_statu) { $statu_t[$job_statu->id] = $job_statu->status_name; } $smarty->assign('job_status', $statu_t); }
function getJobTypes() { return JobType::get()->sort('Type'); }
<?php /* @var $this Controller */ $buttonColumns = array('class' => 'bootstrap.widgets.TbButtonColumnExtended', 'template' => '{favorite} {interview}', 'id' => '"resume-actions".$data->stu_job_id', 'buttons' => array('favorite' => array('icon' => 'star', 'visible' => '!isset($data->fav_employer_id)', 'label' => Yii::t('view', 'favorite_lb'), 'url' => 'Yii::app()->createAbsoluteUrl("resume/employerFav/fav",array("stu_job_id"=>$data->stu_job_id))', 'options' => array('class' => 'fav-resume')), 'interview' => array('icon' => 'calendar', 'label' => Yii::t('view', 'interview_lb'), 'visible' => '!isset($data->inte_employer_id)', 'options' => array('class' => 'interview-resume')))); $bulkActionsButtons = array(array('id' => 'btn-download-resume-zip', 'type' => 'primary', 'buttonType' => 'submit', 'icon' => 'white download-alt', 'size' => 'small', 'label' => Yii::t('view', 'employer.resume_grid_detail.download_selected_resumes_lb'), 'click' => 'js:function(values){submitResumeDownloadZip(values);}'), array('id' => 'btn-fav-resumes', 'buttonType' => 'submit', 'icon' => 'star', 'size' => 'small', 'label' => Yii::t('view', 'employer.resume_grid_detail.fav_selected_resumes_lb'), 'click' => 'js:function(values){submitFavResumes(values);}')); $ajaxUrl = $this->createUrl('index'); $dataProvider = $model->searchLatestStuJobResumesWithEmployer(Yii::app()->user->id); $this->widget('bootstrap.widgets.TbEnhancedExtendedGridView', array('id' => 'resume-grid-view', 'dataProvider' => $dataProvider, 'type' => 'striped bordered ', 'enablePageSizeDropdown' => true, 'pageSizeDropdownOptions' => array('selectedValue' => $model->pageSize, 'htmlOptions' => array('class' => 'pageSize-dropdown')), 'filter' => $model, 'ajaxUrl' => $ajaxUrl, 'bulkActions' => array('actionButtons' => $bulkActionsButtons, 'checkBoxColumnConfig' => array('name' => 'stu_job_id')), 'columns' => array(array('class' => 'bootstrap.widgets.TbRelationalColumn', 'header' => "Resume ID", 'name' => 'stu_job_id', 'type' => 'raw', 'value' => 'CHtml::tag("span",array(),$data->stu_job_id,true). $data->getFavIcon(). $data->getInterviewIcon() ', 'url' => $this->createUrl('viewResumeDetails', array('gridViewDetail' => '1')), 'cssClassExpression' => '"resume_id".$data->stu_job_id', 'afterAjaxUpdate' => 'js:function(tr, rowid, data){tr.addClass("resume-detail-row");}'), array('header' => Yii::t('model', 'viewStudentJobTitle.first_name'), 'name' => 'first_name', 'type' => 'raw', 'value' => 'CHtml::link($data->first_name, "#",array("data-value"=>$data->student_id,"onclick"=>new CJavaScriptExpression("return viewProfile(this)")))'), array('header' => Yii::t('model', 'viewStudentJobTitle.last_name'), 'name' => 'last_name'), array('filter' => CHtml::listData(JobCat::getAllCategories(), 'job_cat_id', 'job_cat_name'), 'header' => Yii::t('model', 'viewStudentJobTitle.job_cat_name'), 'name' => 'job_cat_id', 'value' => '$data->job_cat_name'), array('header' => Yii::t('model', 'viewStudentJobTitle.job_title_name'), 'name' => 'job_title_name'), array('filter' => CHtml::listData(College::getAllCollege(), 'college_name', 'college_name'), 'header' => Yii::t('model', 'viewStudent.college_name'), 'name' => 'college_id', 'value' => '$data->collegeName'), array('filter' => CHtml::listData(JobType::getAllTypes(), 'job_type_id', 'job_type_name'), 'header' => Yii::t('model', 'viewStudentJobTitle.job_type_name'), 'name' => 'job_type_id', 'value' => '$data->job_type_name'), array('name' => 'skills', 'sortable' => false, 'filter' => false, 'header' => Yii::t('model', 'viewStudentJobTitle.skills'), 'type' => 'raw', 'value' => '"<div class=\\"btn btn-mini\\"><i class=\\"center icon icon-info-sign\\"></i></div>". CHtml::tag("div",array("id"=>"skill".$data->stu_job_id,"class"=>"hide skill-containter-div"),$data->skills)', 'class' => 'bootstrap.widgets.TbPickerColumnExtended', 'containerTag' => 'div', 'containerHtmlOptions' => array('class' => 'skills-picker-div text-center'), 'pickerOptions' => array('html' => true, 'title' => Yii::t('model', 'viewStudentJobTitle.skills'), 'content' => 'js:function(){ var skills=$(this).children(".skill-containter-div").text().split(","); var content=""; $(skills).each(function(){ content+="<span class=\\"label label-info\\">"+ this + "</span> "; }); return content; }')), $buttonColumns)));
//deleteing job type if (isset($_GET['action']) && $_GET['action'] == "delete" && isset($_GET['id'])) { $job_type = new JobType(); $job_type->id = (int) $_GET['id']; if ($job_type->delete()) { $session->message("Job Type deleted "); redirect_to($_SERVER['PHP_SELF'] . "?#" . $_GET['id']); die; } else { $message = join("<br />", $job_type->errors); } } ///// add new job type if (isset($_GET['action']) && $_GET['action'] == "add") { if (isset($_POST['bt_add'])) { $job_type = new JobType(); $job_type->type_name = $_POST['txt_type_name']; $job_type->var_name = $job_type->mod_write_check($_POST['txt_type_name'], null); $job_type->is_active = $_POST['txt_is_active']; if ($job_type->save()) { $session->message("New Job Type added."); redirect_to($_SERVER['PHP_SELF']); die; } else { $message = join("<br />", $job_type->errors); } } } ######################################### $job_types = JobType::find_all(); $manage_lists = array();
$sql = " SELECT * FROM " . TBL_CV_CAT . " WHERE cv_id=" . $id; $cv_cat = $db->query($sql); $cv_cat_array = array(); while ($row = $db->fetch_object($cv_cat)) { $categories = Category::find_by_id($row->category_id); $cv_cat_array[] = $categories->cat_name; } $smarty->assign('li', join("<br />", $cv_cat_array)); //job states $js = empty($cv_details->look_job_status) ? 0 : $cv_details->look_job_status; $job_status = JobStatus::find_by_id($js); $ljs = $job_status ? $job_status->status_name : format_lang('none'); $smarty->assign('ljs', $ljs); //job type $job_t = empty($cv_details->look_job_type) ? 0 : $cv_details->look_job_type; $job_type_arr = JobType::find_by_id($job_t); //print_r( $job_type_arr); $job_types = $job_type_arr ? $job_type_arr->type_name : format_lang('none'); $smarty->assign('job_type', $job_types); //where do you wont to work //country $country_arry = Country::find_by_code($cv_details->country); $country_var_name = $country_arry->var_name; $country_name = $country_arry->name; $smarty->assign('country', $country_name); //states $state = StateProvince::find_by_code($cv_details->country, $cv_details->state_province); $state_name = empty($state) ? $cv_details->state_province : $state->name; $state_var_name = $state ? $state->var_name : $cv_details->state_province; $smarty->assign('state', $state_name); $smarty->assign('state_url', $country_var_name . "/" . $state_var_name . "/");
</p> </div> <div class="advance-search <?php echo $model->advanced == true ? '' : 'hide'; ?> well"> <h4>Advanced Search Options</h4> <div class="search-control-row"> <?php echo $form->dropDownList($model, 'job_cat_id', CHtml::listData(JobCat::getAllCategories(), 'job_cat_id', 'job_cat_name'), array('prompt' => Yii::t('model', 'postResumeForm.jobCat_empty'), 'id' => 'search-jobCat-dropdown', 'ajax' => array('type' => 'POST', 'url' => $this->createUrl('employer/ajaxGetJobTitles'), 'update' => '#' . CHtml::activeId($model, 'job_title_id'), 'data' => array('jobCat' => 'js:this.value')))); ?> <?php echo $form->dropDownList($model, 'job_type_id', CHtml::listData(JobType::getAllTypes(), 'job_type_id', 'job_type_name'), array('prompt' => Yii::t('model', 'postResumeForm.jobType_empty'))); ?> <?php echo $form->dropDownList($model, 'college_id', CHtml::listData(College::getAllCollege(), 'college_name', 'college_name'), array('prompt' => Yii::t('model', 'student.college_id_empty'))); ?> <?php echo $form->dropDownList($model, 'ECWS_id', CHtml::listData(EcwsCourse::getAllEcws(), 'ECWS_id', 'ECWS_name'), array('prompt' => Yii::t('model', 'postResumeForm.ecwsCourse_empty'))); ?> </div> <div class="search-control-row"> <?php echo $form->textField($model, 'first_name', array('placeholder' => Yii::t('model', 'user.first_name'))); ?> <?php echo $form->textField($model, 'last_name', array('placeholder' => Yii::t('model', 'user.last_name'))); ?>