_plugin_activated=false; $settings=get_option("awp_plugins"); if(get_option("awp_plugins")!=="false"){ if($settings["jobs"]) $this->_plugin_activated=true; } } /** * Returns plugin instance * * @return awp_jobsForms */ function &instance() { static $instances = array(); if (!isset($instances[0])) { $class = __CLASS__; $instances[0] = & new $class(); } return $instances[0]; } /** * Runs plugin */ function run() { if($this->_plugin_activated){ add_action( 'widgets_init',array(&$this, 'register_widget' )); //initialize widget // perform the check when the_posts() function is called add_action('the_posts',array(&$this,'check_for_shortcode')); add_shortcode('apptivo_job_applicantform',array(&$this,'jobapplicantform')); // Sortcode for Job applicant Form. add_shortcode('apptivo_jobs',array(&$this,'listofjobs')); //Shortcode for List Of Jobs. add_shortcode('apptivo_job_searchform',array(&$this,'jobsearchform'));//Shortcode for Job Search Form. add_shortcode('apptivo_job_description',array(&$this,'jobdescription')); //Shortcode for Single Job description. } } /** * Registering widget * */ function register_widget() { register_widget( 'JobSearch_Widget' ); // Job serach Form Widget. register_widget( 'JobList_Widget' ); // Job Lists Widget. } /** * Jobs Form shortcode handler */ function jobapplicantform($atts){ $jobidwith_Number = FALSE; extract(shortcode_atts(array('name'=> ''), $atts)); $formname=trim($name); $content=""; $successmsg=""; $hrjobsform=$this->get_jobapplicantform_fields($formname); $status = array('0' => 'Approved', '1' => 'New'); $allJobs = getAllHrjobs(999,0,'false',$status)->jobDetails; $allJobs = awp_convertObjToArray($allJobs); $jobId = $_POST['jobId']; $jobNo = $_POST['jobNo']; $token = getTokenForDocumentUpload(); if(!empty($hrjobsform[fields])) { foreach($hrjobsform[fields] as $field){ if($field[fieldid]=="country"){ $countrylist = $this->getAllCountryList(); break; } } } $submitformname = $_POST['awp_jobsformname']; if(isset($_POST['awp_jobsformname']) && $submitformname==$formname) { if(trim($jobId) == '' && isset($_POST['jobidwithnumber'])) { $jobid_Number = $_POST['jobidwithnumber']; $jobid_No = explode('::',$jobid_Number); $jobId = $jobid_No[0]; $jobNo = $jobid_No[1]; $jobidwith_Number = TRUE; } $successmsg=$this->save_applicantjobs($submitformname,$jobId,$jobNo); } if($jobidwith_Number) { $jobId = ''; } ob_start(); if(!empty($hrjobsform)){ include $hrjobsform['templatefile']; } else { echo awp_messagelist('jobapplicant-form-display-page'); } $content = ob_get_clean(); return $content; } function jobsearchform($atts){ $jobsearchForm_Submit = FALSE; extract(shortcode_atts(array('name'=> '','resulttype' => ''), $atts)); $result_type = trim($resulttype); $formname=trim($name); $jobsSettings = get_option('awp_jobs_settings'); $target_pageid = $jobsSettings['description_page']; $content=""; $successmsg=""; $jobsearchform=$this->get_jobsearch_field($formname); $submitformname=$_POST['awp_job_seachformname']; if(isset($_POST['awp_job_seachformname']) && $submitformname==$formname){ // Shortcode Form Submit. $keywords = $_POST['keywords']; if( $keywords == 'Keyword' ) { $keywords = ''; } $industry = $_POST['customfield1']; $jobtype = $_POST['customfield2']; if(!is_array($jobtype)) { $jobtype =array($jobtype); } $response = serchByJobs($keywords, $industry, $jobtype); $jobDetails_Response = $response->return->jobDetails; $JobSearchResults = awp_convertObjToArray($jobDetails_Response); $jobsearchForm_Submit = TRUE; } $widgetFormname=$_POST['job_seachformname_widget']; if(isset($_POST['job_seachformname_widget'])){ // Widget Form Submit. $keywords = $_POST['keywords']; if( $keywords == 'Keyword' ) { $keywords = ''; } $industry = $_POST['customfield1']; $jobtype = $_POST['customfield2']; $maxcount = $_POST['maxcnt']; if(!is_array($jobtype)) { $jobtype =array($jobtype); } $response = serchByJobs($keywords, $industry, $jobtype); $jobDetails_Response = $response->return->jobDetails; $JobSearchResults = awp_convertObjToArray($jobDetails_Response); $jobsearchForm_Submit = TRUE; } //To check custiom field (except fieldid=keywords) option is empty or not. //To avoid Empty page. $jobsearch_field = $jobsearchform['fields']; $job_searchform_display = true; if(count(($jobsearch_field) == 1)) { if( $jobsearch_field[0]['fieldid'] != 'keywords' ) { if( empty($jobsearch_field[0]['options'] )) { $job_searchform_display = false; } } } ob_start(); if($jobsearchForm_Submit && $response->return->methodResponse->responseCode == '1000' & $response->return->numResults == 0 ) { echo awp_messagelist('jobsearch-noresult').'
'; //Display error Message. $jobsearchForm_Submit = FALSE; }else if(isset($response->return->methodResponse) && $jobsearchForm_Submit && $response->return->methodResponse->responseCode != '1000') { echo awp_messagelist('validate-searchJobsBySearchText'); //Display Apptivo Validation Error.(E.g Invalide SiteKey and others..) $jobsearchForm_Submit = FALSE; } if(!empty($jobsearchform) && $job_searchform_display) { include $jobsearchform['templatefile']; }else { echo awp_messagelist('jobsearch-form-display-page'); //Display error Message (E.g forms are not available..). } $content = ob_get_clean(); return $content; } function jobdescription($atts) { extract(shortcode_atts(array('applicantpage'=> ''), $atts)); $jobNo= $_GET['vacancyno']; //Request Job vacancy number $jobDetail = jobdescriptionByNumber($jobNo); //Get job details of selected job number $jobDescription = $jobDetail->jobDescription; $jobs_settings = get_option('awp_jobs_settings'); $applicantFormList = get_option('awp_jobsforms'); $applicantformName = $jobs_settings['applicant_form']; $templateName = $jobs_settings['desc_template_name']; $template_type = $jobs_settings['jobdescription_template_type']; //added template files if($template_type == 'theme_template') : $template_File = TEMPLATEPATH."/jobs/jobdescription/".$templateName; //Job Description theme template else: $template_File = AWP_JOBDESCRIPTION_TEMPLATEPATH."/".$templateName; //Job Description plugin template. endif; if(!empty($applicantFormList)) { foreach($applicantFormList as $applicantform) { if($applicantformName == $applicantform[name]) { $applicantpageUrl = $applicantform[properties][jobapplicant_page]; } } } if($jobs_settings['submit_type'] == 'image') { $value = ''; if(strlen(trim($jobs_settings['submit_val'])) != 0) { $imageSrc = 'src="'.$jobs_settings['submit_val'].'"'; } else { $imageSrc = 'src="'.awp_image('submit_button').'"'; } } else { $imageSrc = ''; if(strlen(trim($jobs_settings['submit_val'])) != 0) { $value = 'value="'.$jobs_settings['submit_val'].'"'; } else { $value = 'value="Submit"'; } } ob_start(); if(!empty($templateName) && strlen(trim($jobDescription)) != 0 && $jobDetail->methodResponse->responseCode == '1000'){ include $template_File; }else if(empty($templateName)) { echo awp_messagelist('jobdescription-display-page'); //Display error Message. }else { echo awp_messagelist('validate-getJobsByNo'); } $content = ob_get_clean(); return $content; ?> 'Approved', '1' => 'New'); $getalljobs_response = getAllHrjobs(999,0,'false',$status); $allJobs = $getalljobs_response->jobDetails; $allJobs = awp_convertObjToArray($allJobs); ob_start(); if( isset($getalljobs_response->methodResponse) && $getalljobs_response->methodResponse->responseCode != '1000') { echo awp_messagelist('validate-getAllJobsWithStatus'); }else if(!empty($templateName) && $getalljobs_response->numResults != 0 ) { include $template_File; }else if(empty($templateName)){ echo awp_messagelist('joblists-display-page'); }else { echo awp_messagelist('joblists-noresults-display-page'); } $content = ob_get_clean(); return $content; } /** * Save Jobs from submitted */ function save_applicantjobs($formname,$jobId,$jobNo){ $hrjobsform=$this->get_jobapplicantform_fields($formname); if(!empty($hrjobsform)){ $hrjobsformfields=$hrjobsform['fields']; //Process the $_POST here.. $submittedformvalues=array(); $submittedformvalues['name']=$hrjobsform[name]; $customfields=""; foreach($hrjobsformfields as $field) { $fieldid=$field['fieldid']; $pos=strpos($fieldid, "customfield"); if($pos===false){ if($fieldid=='telephonenumber'){ if(isset($_POST['telephonenumber1'])){ $submittedformvalues[$fieldid]= $_POST['telephonenumber1'].$_POST['telephonenumber2'].$_POST['telephonenumber3']; } else{ $submittedformvalues[$fieldid]= $_POST[$fieldid]; } }else if($fieldid=='upload') { $submittedformvalues[$fieldid]= $_POST['uploadfile_docid']; } else{ $submittedformvalues[$fieldid]= stripslashes($_POST[$fieldid]); } }else if($fieldid != 'industry'){ if(trim($customfields)!="") { if(is_array($_POST[$fieldid])) { $CustomArr = $_POST[$fieldid]; $customfieldVal= ""; for($i=0; $i: ".stripslashes($customfieldVal); } else { if(is_array($_POST[$fieldid])) { $CustomArr = $_POST[$fieldid]; $customfieldVal= ""; for($i=0; $i:".stripslashes($customfieldVal); } }else { $submittedformvalues[industry]= $_POST[industry]; } } if(trim($customfields)!="") $submittedformvalues["notes"]=$customfields; $firstName = $submittedformvalues['firstname']; $lastName = $submittedformvalues['lastname']; $emailId = $submittedformvalues['email']; $jobTitle = $submittedformvalues['jobtitle']; $company = $submittedformvalues['company']; $address1 = $submittedformvalues['address1']; $address2 = $submittedformvalues['address2']; $city = $submittedformvalues['city']; $provinceAndState = $submittedformvalues['state']; $postalCode = $submittedformvalues['zipcode']; $bestWayTohrjobs = $submittedformvalues['bestway']; $country = $submittedformvalues['country']; $leadSource = $submittedformvalues['name']; $phoneNumber = $submittedformvalues['telephonenumber']; $comments = $submittedformvalues['comments']; $coverletter = $submittedformvalues['coverletter']; $skills = $submittedformvalues['Skills']; $upload_docid = $submittedformvalues['upload']; $industryId = $submittedformvalues['industry']; $noteDetails = $submittedformvalues['notes']; if(!empty($noteDetails)){ $parent1details = nl2br($noteDetails); $noteDetails = notes('Custom Fields',$parent1details,$parent1NoteId); } if(!empty($emailId)){ // $response = saveLeadDetails($firstName , $lastName, $emailId, $jobTitle, $company, $address1, $address2, $city, $state, $zipCode, $bestWayTohrjobs, $country, $leadSource, $phoneNumber, $comments, $noteDetails,$targetlistid); $response = createJobApplicant($addressId, $address1, $address2, $applicantId, $applicantNumber, $city, $comments, $country, $countyAndDistrict, $emailId, $expectedDesignation, $expectedSalary, $firstName, $industryId, $jobApplicantId, $jobId,$jobNo, $lastName, $middleName, $noteDetails, $phoneNumber, $postalCode, $provinceAndState, $coverletter, $resumeDetails, $resumeFileName, $resumeId, $skills,$upload_docid); } if(isset($response) && $response->methodResponse->responseCode == '1000'){ if(!empty($hrjobsform[confmsg])){ $confmsg = $hrjobsform[confmsg]; } else{ $confmsg="Job applicant uploaded Successfully"; } } } return $confmsg; } /** * Get hrjobsform and its fields to render in page which is using shortcode */ function get_jobapplicantform_fields($formname){ $formExists=""; $hrjobs_forms=array(); $hrjobsform=array(); $hrjobsformdetails=array(); $formname=trim($formname); $hrjobs_forms=get_option('awp_jobsforms'); if($formname=="") $formExists=""; else if(!empty($hrjobs_forms)) $formExists = awp_recursive_array_search($hrjobs_forms,$formname,'name' ); if(trim($formExists)!=="" ){ $hrjobsform=$hrjobs_forms[$formExists]; //build hrjobsformdetails array $hrjobsformdetails['name']=$hrjobsform['name']; //add properties $hrjobsformproperties=$hrjobsform['properties']; $hrjobsformdetails['tmpltype']=$hrjobsformproperties['tmpltype']; $hrjobsformdetails['layout']=$hrjobsformproperties['layout']; $hrjobsformdetails['confmsg']= stripslashes($hrjobsformproperties['confmsg']); $hrjobsformdetails['targetlist']=$hrjobsformproperties['targetlist']; $hrjobsformdetails['css']=stripslashes($hrjobsformproperties['css']); $hrjobsformdetails['submit_button_type']=$hrjobsformproperties['submit_button_type']; $hrjobsformdetails['submit_button_val']=$hrjobsformproperties['submit_button_val']; //inclde templates. if($hrjobsformproperties['tmpltype']=="awp_plugin_template") : $templatefile=AWP_JOBSFORM_TEMPLATEPATH."/".$hrjobsformproperties['layout']; //Job Applicant form plugin template else : $templatefile=TEMPLATEPATH."/jobs/jobapplicant/".$hrjobsformproperties['layout']; //Job Applicant form theme template endif; $hrjobsformdetails['templatefile']=$templatefile; //add fields $hrjobsformfields=$hrjobsform['fields']; if(!empty($hrjobsformfields)){ usort($hrjobsformfields, "awp_sort_by_order"); $newhrjobsformfields=$hrjobsformfields; $hrjobsformdetails['fields']=$newhrjobsformfields; } } return $hrjobsformdetails; } function get_jobsearch_field($formname) { $formExists=""; $jobsearch_forms=array(); $jobsearchform=array(); $jobsearchformdetails=array(); $formname=trim($formname); $jobsearch_forms=get_option('awp_jobsearchforms'); if($formname=="") $formExists=""; else if(!empty($jobsearch_forms)) $formExists = awp_recursive_array_search($jobsearch_forms,$formname,'name' ); if(trim($formExists)!=="" ){ $jobsearchform=$jobsearch_forms[$formExists]; //build hrjobsformdetails array $jobsearchformdetails['name']=$jobsearchform['name']; //add properties $jobsearchformproperties=$jobsearchform['properties']; $jobsearchformdetails['tmpltype']=$jobsearchformproperties['tmpltype']; $jobsearchformdetails['layout']=$jobsearchformproperties['layout']; $jobsearchformdetails['confmsg']= stripslashes($jobsearchformproperties['confmsg']); $jobsearchformdetails['targetlist']=$jobsearchformproperties['targetlist']; $jobsearchformdetails['css']=stripslashes($jobsearchformproperties['css']); $jobsearchformdetails['submit_button_type']=$jobsearchformproperties['submit_button_type']; $jobsearchformdetails['submit_button_val']=$jobsearchformproperties['submit_button_val']; $jobsearchformdetails['target_pageurl']=$jobsearchformproperties['target_pageurl']; $jobsearchformdetails['jobapplicant_pageurl']=$jobsearchformproperties['jobapplicant_pageurl']; //Include job serach template if($jobsearchformproperties['tmpltype']=="awp_plugin_template") : $templatefile=AWP_JOBSEARCHFORM_TEMPLATEPATH."/".$jobsearchformproperties['layout']; //Job search form plugin templates else : $templatefile=TEMPLATEPATH."/jobs/jobsearch/".$jobsearchformproperties['layout']; //Job search form theme templates endif; $jobsearchformdetails['templatefile']=$templatefile; //add fields $jobsearchformfields=$jobsearchform['fields']; if(!empty($jobsearchformfields)){ usort($jobsearchformfields, "awp_sort_by_order"); $newhrjobsformfields=$jobsearchformfields; $jobsearchformdetails['fields']=$newhrjobsformfields; } } return $jobsearchformdetails; } /** * Get hrjobs form settings by form name to render in Admin */ function get_settings($formname,$type){ $formExists=""; $hrjobs_forms=array(); $hrjobsform=array(); $formname=trim($formname); if( $type == 'jobsearch') { $hrjobs_forms=get_option('awp_jobsearchforms'); } else { $hrjobs_forms=get_option('awp_jobsforms'); } if($formname=="") $formExists=""; else if(!empty($hrjobs_forms)) $formExists = awp_recursive_array_search($hrjobs_forms,$formname,'name' ); if(trim($formExists)!=="" ){ $hrjobsform=$hrjobs_forms[$formExists]; } return $hrjobsform; } /** * Return master fields lists supported by Apptivo hrjobs Form */ function get_master_fields() { $fields = array( array('fieldid' => 'firstname','fieldname' => 'First Name','defaulttext' => 'First Name','showorder' => '1','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'lastname','fieldname' => 'Last Name','defaulttext' => 'Last Name','showorder' => '2','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'email','fieldname' => 'Email','defaulttext' => 'Email','showorder' => '3','validation' => 'email','fieldtype' => 'text'), array('fieldid' => 'jobtitle','fieldname' => 'Job Title','defaulttext' => 'Job Title','showorder' => '4','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'company','fieldname' => 'Company','defaulttext' => 'Company','showorder' => '5','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'address1','fieldname' => 'Address1','defaulttext' => 'Address1','showorder' => '6','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'address2','fieldname' => 'Address2','defaulttext' => 'Address2','showorder' => '7','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'city','fieldname' => 'City','defaulttext' => 'City','showorder' => '8','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'zipcode','fieldname' => 'ZipCode','defaulttext' => 'ZipCode','showorder' => '10','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'country','fieldname' => 'Country','defaulttext' => 'Country','showorder' => '11','validation' => 'text','fieldtype' => 'select'), array('fieldid' => 'telephonenumber','fieldname' => 'Telephone Number','defaulttext' => 'Telephone Number','showorder' => '12','validation' => 'number','fieldtype' => 'text'), array('fieldid' => 'comments','fieldname' => 'Comments','defaulttext' => 'Comments','showorder' => '13','validation' => 'textarea','fieldtype' => 'textarea'), array('fieldid' => 'coverletter','fieldname' => 'Cover Letter','defaulttext' => 'Cover Letter','showorder' => '14','validation' => 'textarea','fieldtype' => 'textarea'), array('fieldid' => 'Skills','fieldname' => 'Skills','defaulttext' => 'Skills','showorder' => '15','validation' => 'upload','fieldtype' => 'textarea'), array('fieldid' => 'upload','fieldname' => 'Upload File','defaulttext' => 'Upload File','showorder' => '16','validation' => 'textarea','fieldtype' => 'upload'), array('fieldid' => 'industry','fieldname' => 'Industry','defaulttext' => 'Industry','showorder' => '17','validation' => '','fieldtype' => 'select'), array('fieldid' => 'customfield1','fieldname' => 'Custom Field 1','defaulttext' => 'Custom Field1','showorder' => '18','validation' => '','fieldtype' => 'select'), array('fieldid' => 'customfield2','fieldname' => 'Custom Field 2','defaulttext' => 'Custom Field2','showorder' => '19','validation' => '','fieldtype' => 'select'), array('fieldid' => 'customfield3','fieldname' => 'Custom Field 3','defaulttext' => 'Custom Field3','showorder' => '20','validation' => '','fieldtype' => 'select'), array('fieldid' => 'customfield4','fieldname' => 'Custom Field 4','defaulttext' => 'Custom Field4','showorder' => '21','validation' => '','fieldtype' => 'radio'), array('fieldid' => 'customfield5','fieldname' => 'Custom Field 5','defaulttext' => 'Custom Field5','showorder' => '22','validation' => '','fieldtype' => 'checkbox') ); //For Additional custom fields. $addtional_custom = get_option('awp_addtional_custom_jobapplicant'); if(!empty($addtional_custom)): $fields = array_merge($fields,$addtional_custom); endif; return $fields; } function get_master_fieldsfor_searchjobs() { $fields = array( array('fieldid' => 'keywords','fieldname' => 'Keywords','defaulttext' => 'Keywords','showorder' => '1','validation' => 'text','fieldtype' => 'text'), array('fieldid' => 'customfield1','fieldname' => 'Industry','defaulttext' => 'Industry','showorder' => '2','validation' => '','fieldtype' => 'select'), array('fieldid' => 'customfield2','fieldname' => 'JobType','defaulttext' => 'Job Type','showorder' => '3','validation' => '','fieldtype' => 'select'), ); return $fields; } /** * Retrieve list of validations supported by Apptivo hrjobs Form * */ function get_master_validations(){ $validations = array( array('validationLabel' => 'None','validation' => 'none'), array('validationLabel' => 'Email ID','validation' => 'email'), array('validationLabel' => 'Number','validation' => 'number') ); return $validations; } /** * * * Retrieve list of Field Types supported by Apptivo hrjobs Form */ function get_master_fieldtypes(){ $fieldtypes = array( array('fieldtypeLabel' => 'Checkbox','fieldtype' => 'checkbox'), array('fieldtypeLabel' => 'Radio Option','fieldtype' => 'radio'), array('fieldtypeLabel' => 'Select','fieldtype' => 'select'), array('fieldtypeLabel' => 'Textbox','fieldtype' => 'text'), array('fieldtypeLabel' => 'Textarea','fieldtype' => 'textarea') ); return $fieldtypes; } function get_master_fieldtypes_jobsearch(){ $fieldtypes = array( array('fieldtypeLabel' => 'Checkbox','fieldtype' => 'checkbox'), //array('fieldtypeLabel' => 'Radio Option','fieldtype' => 'radio'), array('fieldtypeLabel' => 'Select','fieldtype' => 'select') ); return $fieldtypes; } /** * return array of plugin templates available with Template name and template file name */ function get_plugin_templates($dir_hrjobs) { $default_headers = array( 'Template Name' => 'Template Name' ); $templates = array(); // Open a known directory, and proceed to read its contents if (is_dir($dir_hrjobs)) { if ($dh = opendir($dir_hrjobs)) { while (($file = readdir($dh)) !== false) { if ( substr( $file, -4 ) == '.php' ) { $plugin_data = get_file_data( $dir_hrjobs."/".$file, $default_headers, '' ); if(strlen(trim($plugin_data['Template Name'])) != 0 ) { $templates[$plugin_data['Template Name']] = $file; } } } closedir($dh); } } return $templates; } function get_apptivo_template_data( $apptivo_template_file,$template_filename) { $test = array(); $default_headers = array( 'Apptivo Template Name' => 'Apptivo Template Name', 'Version' => 'Version', 'Description' => 'Description', 'Author' => 'Author', ); $plugin_data = get_file_data( $apptivo_template_file, $default_headers, '' ); if(strlen(trim($plugin_data['Apptivo Template Name'])) != 0 ) { $test[$plugin_data['Apptivo Template Name']] = $template_filename; } } /** * Create field array */ function createformfield_array($fieldid,$showtext,$required,$type,$validation,$options,$displayorder){ if(trim($displayorder)=="") $displayorder=0; $hrjobsformfield= array( 'fieldid'=>$fieldid, 'showtext' => preg_replace('/[^\w\+\s]/', '', $showtext), 'required' => $required, 'type' => $type, 'validation' => $validation, 'options' => $options, 'order' => $displayorder ); return $hrjobsformfield; } function createJobsoptions() { if(isset($_POST['job_delete_form'])) { if(strlen(trim($_POST['job_delete_form'])) != 0) { $jobID = trim($_POST['job_delete_form']); $DeleteJobs = deleteJob($jobID); $sucMsg = "Job Deleted successfully."; } } if($_POST['awp_jobs_add']) //Create Jobs { $jobtitle = $_POST['jobs_title']; $content = stripslashes($_POST['content']); $content = apply_filters('the_content', $content); $jobindustry = $_POST['jobs_industry']; $jobtype = $_POST['jobs_type']; $isFeatured = $_POST['jobs_featured']; if( strlen(trim($jobtitle)) == 0 || strlen(trim($content)) == 0) { $errorMsg = "Job Title and Job Description can not be empty."; } else { $response = createJobs($jobtitle,$content,$jobindustry,$jobtype,$isFeatured); if(isset($response->methodResponse) && $response->methodResponse->responseCode != '1000') { $sucMsg = ''.$response->methodResponse->responseMessage.''; } else { $sucMsg = "Job Created successfully."; } } } //End of Create Jobs. if($_POST['awp_updatejobs']) // Update Jobs { $jobtitle = $_POST['jobs_title']; $content = stripslashes($_POST['editcontent']); $content = apply_filters('the_content', $content); $jobId = $_POST['jobs_id']; $industryId = $_POST['jobs_industry']; $jobtype = $_POST['jobs_type']; $jobstatus = $_POST['jobs_status']; $isFeatured = $_POST['jobs_featured']; if( strlen(trim($jobtitle)) == 0 || strlen(trim($content)) == 0) { $errorMsg = "Job Title and Job Description can not be empty."; }else { if(isset($jobId) && is_numeric($jobId)) { $response = updatejobs($jobId,$jobtitle,$content,$industryId,$jobtype,$isFeatured,$jobstatus); if(isset($response->methodResponse) && $response->methodResponse->responseCode != '1000') { $sucMsg = ''.$response->methodResponse->responseMessage.''; }else { $sucMsg = "Job Updated successfully.";} } } } //End of Update Jobs. $jobTypeLists = array('Full Time' => 'Full Time','Part Time' => 'Part Time','Contract' => 'Contract'); $jobTypeStatus = array('New' => 'New','Approved' => 'Approved','Closed' => 'Closed','Canceled' => 'Canceled'); $allIndustries = getAllIndustries(); ?>

_plugin_activated){ echo "
Jobs plugin currently disabled. Please enable this in Apptivo General Settings
"; } ?>

Jobs

For Complete instructions, see the - Developer's Guide. _plugin_activated) : $this->AllJobs(); endif; //Displaying Job Lists if(strlen($sucMsg) != 0 ) { ?>

return; if($selectedJobs->methodResponse->responseCode != '1000') { echo '

'.$selectedJobs->methodResponse->responseMessage.'

'; } ?>

 *
 *
jobDescription; } the_editor($updated_value,'editcontent','',FALSE); ?>
isFeatured); ?> type="checkbox" id="jobs_featured" name="jobs_featured" />

 *
 *
_plugin_activated) { echo 'disabled="disabled"'; }?> type="submit" class="button-primary" name="awp_jobs_add" value="">
methodResponse->responseCode != '1000' && isset($Job_results->methodResponse)) { echo '

'.$Job_results->methodResponse->responseMessage.'

'; }*/ $JobSearchResults = awp_convertObjToArray($Job_results->jobDetails); if( $Job_results->numResults != 0) { $numberofjobs = count($JobSearchResults); $jobsperpage =5; $tpages = ceil($numberofjobs/$jobsperpage); $currentpage = intval($_GET['pageno']); if($currentpage<=0) $currentpage = 1; if($currentpage>=$tpages) $currentpage = $tpages; $reload = $_SERVER['PHP_SELF'].'?page=awp_jobs&keys=jobcreation'; $start = ( $currentpage - 1 ) * $jobsperpage; $JobSearchResults = array_slice( $JobSearchResults, $start, $jobsperpage); ?>
_plugin_activated){ echo "Jobs plugin currently disabled. Please enable this in Apptivo General Settings."; }else { $jobapplicant_settings = get_option('awp_jobsforms'); $job_appl_page = $jobapplicant_settings[0][properties][jobapplicant_page]; $awp_jobs_settings = get_option('awp_jobs_settings'); $list_template = $awp_jobs_settings[list_template_name]; if(strlen(trim($job_appl_page)) == 0 && strlen(trim($list_template)) == 0) { echo 'To show job list in Website. Update Job settings and Job Applicant form Configuration before adding Jobs list shortcode in Page or Post.'; }else if(strlen(trim($job_appl_page)) != 0 && strlen(trim($list_template)) == 0) { echo 'To show job list in Website. Update Job settings Configuration before adding Jobs list shortcode in Page or Post.'; }else if(strlen(trim($job_appl_page)) == 0 && strlen(trim($list_template)) != 0) { echo 'To show job list in Website. Update Job Applicant form Configuration before adding Jobs list shortcode in Page or Post.'; } } ?>

$jobsperpage) { echo awp_paginate($reload,$currentpage,$tpages,$numberofjobs); } ?>
id) { $style = 'style="background-color: #E7E7E7;"'; } else { $style = ''; } ?> >
jobTitle; ?>

jobDescription))) < 30) { echo stripslashes(strip_tags($jobs->jobDescription)); } else { $sub = strip_tags($jobs->jobDescription); echo $sub = stripslashes(substr($sub, 0, 30)).'...'; } ?>

industryName; ?> jobStatusName; ?> jobTypeName; ?> _plugin_activated) { ?>

_plugin_activated) { echo '

Copy and Paste this short code in your page to display this list of jobs

'; } ?> numResults != 0) { */ $hrjobs_forms=array(); $hrjobsformdetails=array(); $hrjobs_forms=get_option('awp_jobsforms'); if(empty($hrjobs_forms)) { $jobapplicant_array =array("name"=>'jaform'); $jobapplicantform=array($jobapplicant_array); update_option('awp_jobsforms',$jobapplicantform); $hrjobs_forms=get_option('awp_jobsforms'); } /* * Saving selected form settings */ if(isset($_POST['awp_jobsform_settings'])){ $templatelayout=""; $newformname=$_POST['awp_jobsform_name']; if($_POST['awp_jobsform_templatetype']=="awp_plugin_template") $templatelayout=$_POST['awp_jobsform_plugintemplatelayout']; else $templatelayout=$_POST['awp_jobsform_themetemplatelayout']; $hrjobsformproperties=array( 'tmpltype' =>$_POST['awp_jobsform_templatetype'], 'layout' =>$templatelayout, 'confmsg' => stripslashes($_POST['awp_jobsform_confirmationmsg']), 'css' => stripslashes($_POST['awp_jobsform_customcss']), 'subscribe_option' => $_POST['subscribe_option'], 'submit_button_type' => $_POST['awp_jobsform_submit_type'], 'submit_button_val' => $_POST['awp_jobsform_submit_val'], 'jobapplicant_page' => $_POST['awp_jobapplicant_page'] ); //New custom fields $stack = array(); $addtional_custom = array(); $addtional_order = 23; for($i=6;$i<200;$i++) { if(isset($_POST['customfield'.$i.'_newest']) ) { $addtional_custom = array('fieldid' => 'customfield'.$i.'','fieldname' => 'Custom Field '.$i.'', 'defaulttext' => 'Custom Field'.$i.'','showorder' => $addtional_order,'validation' => '', 'fieldtype' => 'select'); $addtional_order++; array_push($stack, $addtional_custom); }else { break; } } if(!empty($stack)) : update_option('awp_addtional_custom_jobapplicant',$stack); endif; //General fields $hrjobsformfields=array(); foreach( $this->get_master_fields() as $fieldsmasterproperties ) { $enabled=0; $hrjobsformfield=array(); $fieldid=$fieldsmasterproperties['fieldid']; if(!empty ($_POST[$fieldid.'_order'])){ $displayorder = $_POST[$fieldid.'_order']; } else{ $displayorder = $fieldsmasterproperties['showorder']; } if(!empty ($_POST[$fieldid.'_text'])){ $displaytext = $_POST[$fieldid.'_text']; } else{ $displaytext = $fieldsmasterproperties['defaulttext']; } if($fieldid=='lastname' || $fieldid=='email' || $fieldid=='firstname' || $fieldid=='country' ) { $enabled = 1; $required = 1; } else { $enabled = $_POST[$fieldid.'_show']; $required = $_POST[$fieldid.'_require']; } if($enabled){ $hrjobsformfield=$this->createformfield_array($fieldid,$displaytext,$required,$_POST[$fieldid.'_type'],$_POST[$fieldid.'_validation'],$_POST[$fieldid.'_options'],$displayorder); array_push($hrjobsformfields, $hrjobsformfield); } } //usort($hrjobsformfields, "awp_sort_by_order"); if(!empty($hrjobsformfields)){ $newhrjobsformdetails=array('name'=>$newformname,'properties'=>$hrjobsformproperties,'fields'=>$hrjobsformfields); $formExists=""; if(!empty($hrjobs_forms)) $formExists = awp_recursive_array_search($hrjobs_forms,$newformname,'name' ); if(trim($formExists)!=="" ){ unset($hrjobs_forms[$formExists]); array_push($hrjobs_forms, $newhrjobsformdetails); sort($hrjobs_forms); update_option('awp_jobsforms',$hrjobs_forms); $hrjobs_forms=get_option('awp_jobsforms'); $updatemessage= "Jobs Form '".$newformname."' settings updated. Use Short code '[apptivo_job_applicantform name=\"".$newformname."\"]' in your page to use this form."; } }else{ $updatemessage="Select atleast one Form field for jobs Form."; } $selectedhrjobsform=$newformname; } // Now display the settings editing screen echo '
'; //if updatemessage is not empty display the div if(trim($updatemessage)!=""){ ?>

get_plugin_templates(AWP_JOBSFORM_TEMPLATEPATH); //Job applicant form plugin templates ?>
get_settings($selectedhrjobsform,''); if(count($hrjobsformdetails)>0){ $selectedhrjobsform=$hrjobsformdetails[name]; $fields=$hrjobsformdetails[fields]; $formproperties=$hrjobsformdetails[properties]; } ?>
/>

*Developers Guide - Job Applicant Form Shortcodes.
Save the the below settings to get the Shortcode for job applicant form. '; } ?>

*Developers Guide - Job Applicant Form Templates.


This message will shown in your website page, once jobs form submitted.

*Developers Guide - Job Applicant Form CSS.

checked="checked" /> Button /> Image


" . __( 'Job Applicant Form Fields', 'apptivo-businesssite' ) . "";?>
*Developers Guide - Basic Job Applicant Form Config.

get_master_fields() as $fieldsmasterproperties ) { $enabled=0; $fieldExists=array(); $fieldid=$fieldsmasterproperties['fieldid']; $fieldExistFlag=""; if(!empty($fields)) { $fieldExistFlag= awp_recursive_array_search($fields, $fieldid, 'fieldid'); } if(trim($fieldExistFlag)!=="") { $enabled=1; $fieldData=array("fieldid"=>$fieldid, "fieldname"=>$fieldsmasterproperties['fieldname'], "show"=>$enabled, "required"=>$fields[$fieldExistFlag]['required'], "showtext"=>$fields[$fieldExistFlag]['showtext'], "type"=>$fields[$fieldExistFlag]['type'], "validation"=>$fields[$fieldExistFlag]['validation'], "options"=>$fields[$fieldExistFlag]['options'], "order"=>$fields[$fieldExistFlag]['order']); }else{ if($fieldid=='lastname' || $fieldid=='email' || $fieldid=='firstname' || $fieldid=='country') { $enabled =1; $required =1; } $fieldData=array("fieldid"=>$fieldid, "fieldname"=>$fieldsmasterproperties['fieldname'], "show"=>$enabled, "required"=>$required, "showtext"=>$fieldsmasterproperties['defaulttext'], "type"=>"", "validation"=>"", "options"=>"", "order"=>""); } $pos=strpos($fieldsmasterproperties['fieldid'], "customfield"); ?>
checked="checked" disabled="disabled" type="checkbox" id="_show" name="_show" size="30" onclick="hrjobsform_enablefield('')"> 20 ) :?> disabled="disabled" checked="checked" type="checkbox" disabled="disabled" id="_require" name="_require" size="30"> disabled="disabled" > disabled="disabled" type="text" id="_text" name="_text" value=""> value="select" value="textarea" value="text" > disabled="disabled" size="6" readonly="readonly" type="text" id="_typehiddentext" name="_typehiddentext" value="Select" value="Textarea" value="Text box" > value="email" value="number" value="none" > disabled="disabled" size="6" readonly="readonly" type="text" id="_validationhidden" name="_validationhidden" value="Email Id" value="Number" value="None" >

+Add Another Custom Field

_plugin_activated) { echo 'disabled="disabled"'; } ?> type="submit" name="awp_jobsform_settings" id="awp_jobsform_settings" class="button-primary" value="" />



Please create Jobs in apptivo before configuring Jobs form.


numResults != 0) { $JobSearchResults = awp_convertObjToArray($Results->jobDetails); ?>


jobTitle; ?>

jobDescription)) < 30) echo strip_tags($allJobs->jobDescription); else echo substr(strip_tags($allJobs->jobDescription),0,30).'...'; ?>

jobStatusName; ?> jobTypeName; ?> dateCreated; ?>



_plugin_activated) : echo "Jobs Plugin is currently disabled. Please enable this in Apptivo General Settings."; endif; ?>
Jobs Settings'; echo 'Jobs Applicant form'; $this->descriptionSettings(); } if($_GET['step'] == 2) { echo 'Jobs Settings'; echo 'Jobs Applicant form'; $this->jobApplicant(); } ?>
$_POST['awp_joblist_descriptionpage'], 'submit_type' => $_POST['awp_joblist_submit_type'], 'submit_val' => $_POST['awp_joblist_submit_val'], 'applicant_form' => $applicantformName, 'desc_template_name' => $jobdesc_template, 'jobdescription_template_type' => $_POST['awp_jobdesc_templatetype'], 'list_template_name' => $joblist_template, 'joblist_template_type' => $_POST['awp_joblists_templatetype'] ); update_option('awp_jobs_settings',$jobs_settings_post); } $jobs_settings = get_option('awp_jobs_settings'); ?>

Copy and Paste this short code in Job Description Page :

Save the the below settings to get the Shortcode for job description.

'; } ?>

checked="checked" /> Button /> Image

_plugin_activated) { echo 'disabled="disabled"'; } ?> type="submit" value="" class="button-primary" id="awp_joblists_settings" name="awp_joblists_settings">


_plugin_activated) : _e("Jobs Plugin is currently disabled. Please enable this in Apptivo General Settings.",'apptivo-businesssite'); endif; ?> 'jsform'); $newhrjobsform=array($newhrjobsformname_array); update_option('awp_jobsearchforms',$newhrjobsform); $hrjobs_forms=get_option('awp_jobsearchforms'); } /* * Saving selected form settings */ if(isset($_POST['awp_jobsearchform_settings'])){ $templatelayout=""; $newformname=$_POST['awp_jobsearchform_name']; if($_POST['awp_jobsearchform_templatetype']=="awp_plugin_template") $templatelayout=$_POST['awp_jobsearchform_plugintemplatelayout']; else $templatelayout=$_POST['awp_jobsearchform_themetemplatelayout']; $hrjobsformproperties=array( 'tmpltype' =>$_POST['awp_jobsearchform_templatetype'], 'layout' =>$templatelayout, 'confmsg' => stripslashes($_POST['awp_jobsearchform_confirmationmsg']), 'css' => stripslashes($_POST['awp_jobsearchform_customcss']), 'subscribe_option' => $_POST['subscribe_option'], 'submit_button_type' => $_POST['awp_jobsearchform_submit_type'], 'submit_button_val' => $_POST['awp_jobsearchform_submit_val'], 'target_pageurl' => $_POST['awp_target_pageurl'], 'jobapplicant_pageurl' => $_POST['awp_jobapplicant_pageurl'] ); $hrjobsformfields=array(); foreach( $this->get_master_fieldsfor_searchjobs() as $fieldsmasterproperties ) { $enabled=0; $hrjobsformfield=array(); $fieldid=$fieldsmasterproperties['fieldid']; if(!empty ($_POST[$fieldid.'_order'])){ $displayorder = $_POST[$fieldid.'_order']; } else{ $displayorder = $fieldsmasterproperties['showorder']; } if(!empty ($_POST[$fieldid.'_text'])){ $displaytext = $_POST[$fieldid.'_text']; } else{ $displaytext = $fieldsmasterproperties['defaulttext']; } $enabled = $_POST[$fieldid.'_show']; if($enabled){ $hrjobsformfield=$this->createformfield_array($fieldid,$displaytext,'',$_POST[$fieldid.'_type'],'',$_POST[$fieldid.'_options'],$displayorder); array_push($hrjobsformfields, $hrjobsformfield); } } if(!empty($hrjobsformfields)){ $newhrjobsformdetails=array('name'=>$newformname,'properties'=>$hrjobsformproperties,'fields'=>$hrjobsformfields); $formExists=""; if(!empty($hrjobs_forms)) $formExists = awp_recursive_array_search($hrjobs_forms,$newformname,'name' ); if(trim($formExists)!=="" ){ unset($hrjobs_forms[$formExists]); array_push($hrjobs_forms, $newhrjobsformdetails); sort($hrjobs_forms); update_option('awp_jobsearchforms',$hrjobs_forms); $hrjobs_forms=get_option('awp_jobsearchforms'); $updatemessage= "Job Search Form '".$newformname."' settings updated. Use Short code '[apptivo_job_searchform name=\"".$newformname."\"]' in your page to use this form."; } }else{ $updatemessage="Select atleast one Form field for job search Form."; } $selectedhrjobsform=$newformname; } // Now display the settings editing screen echo '
'; // header //if updatemessage is not empty display the div if(trim($updatemessage)!=""){ ?>


get_settings($selectedhrjobsform,'jobsearch'); if(count($hrjobsformdetails)>0){ $selectedhrjobsform=$hrjobsformdetails[name]; $fields=$hrjobsformdetails[fields]; $formproperties=$hrjobsformdetails[properties]; } ?>

*Developers Guide - Job Search Form Shortcodes.
Save the the below settings to get the Shortcode for job search form. '; }?>
*Developers Guide - Job Search Form Templates.


*Developers Guide - Job Search Form CSS.

checked="checked" /> Button /> Image


" . __( 'Job Search Form Fields', 'apptivo-businesssite' ) . "";?>
*Developers Guide - Basic Job Search Form Config.
get_master_fieldsfor_searchjobs() as $fieldsmasterproperties ) { $enabled=0; $fieldExists=array(); $fieldid=$fieldsmasterproperties['fieldid']; $fieldExistFlag=""; if(!empty($fields)) { $fieldExistFlag= awp_recursive_array_search($fields, $fieldid, 'fieldid'); } if(trim($fieldExistFlag)!=="") { $enabled=1; $fieldData=array("fieldid"=>$fieldid, "fieldname"=>$fieldsmasterproperties['fieldname'], "show"=>$enabled, "showtext"=>$fields[$fieldExistFlag]['showtext'], "type"=>$fields[$fieldExistFlag]['type'], "options"=>$fields[$fieldExistFlag]['options'], "order"=>$fields[$fieldExistFlag]['order']); }else{ if($fieldid=='lastname' || $fieldid=='email') { $enabled =1; $required =1; } $fieldData=array("fieldid"=>$fieldid, "fieldname"=>$fieldsmasterproperties['fieldname'], "show"=>$enabled, "showtext"=>$fieldsmasterproperties['defaulttext'], "type"=>"", "options"=>"", "order"=>""); } $pos=strpos($fieldsmasterproperties['fieldid'], "customfield"); ?>
checked="checked" disabled="disabled" type="checkbox" id="_show" name="_show" size="30" onclick="hrjobsform_enablefield('')"> disabled="disabled" > disabled="disabled" type="text" id="_text" name="_text" value=""> value="select" value="textarea" value="text" > disabled="disabled" size="6" readonly="readonly" type="text" id="_typehiddentext" name="_typehiddentext" value="Select" value="Textarea" value="Text box" > 'Full Time','Part Time' => 'Part Time','Contract' => 'Contract'); ?>

_plugin_activated) { echo 'disabled="disabled"'; } ?> type="submit" name="awp_jobsearchform_settings" id="awp_jobsearchform_settings" class="button-primary" value="" />

loadscripts(); $this->loadstyles_uploadify(); } if($searchform_found || $joblists_found || $jobdesc_found || $applicantformfound) { $this->loadstyles(); } return $posts; } function loadstyles() { wp_enqueue_style('style_awp_job', AWP_PLUGIN_BASEURL.'/inc/jobs/css/style.css' , false, '1.0.0', 'screen'); } /** * Load the CSS files */ function loadstyles_uploadify() { wp_enqueue_style('style_uploadify', AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/uploadify.css' , false, '1.0.0', 'screen'); //wp_print_styles('style_hrjobsus'); } /** * Load the JS files */ function loadscripts() { wp_enqueue_script('jquery_validation','http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js',array('jquery')); //wp_enqueue_script('jquery_uploadify_jquery',AWP_PLUGIN_BASEURL.'/inc/jobs/files/jquery.js',array('jquery')); wp_enqueue_script('jquery_uploadify_swfobject',AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/swfobject.js',array('jquery')); wp_enqueue_script('jquery_uploadify_uploadify',AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/jquery.uploadify.v2.1.4.min.js',array('jquery'),'2.1.4'); wp_register_script('jquery_uploadify_uploadjs',AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/upload.js','jquery', '1.0'); wp_enqueue_script('jquery_uploadify_uploadjs'); wp_localize_script( 'jquery_uploadify_uploadjs', 'awp_upload', $this->localize_vars()); } function localize_vars() { return array( 'swfUrl' => AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/uploadify.swf', 'cancelImg' => AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/cancel.png' ); } //End localize_vars /** * Get Country Lists * * @return unknown */ function getAllCountryList() { $countrylist = getAllCountries(); return $countrylist->return; } } //End Class /** * Create Jobs * * @param unknown_type $jobTitle * @param unknown_type $jobDescription * @param unknown_type $industryId * @param unknown_type $jobtype * @param unknown_type $isFeatured * @return unknown */ function createJobs($jobTitle,$jobDescription,$industryId,$jobtype,$isFeatured) { if($isFeatured == 'on') { $isFeatured = 'Y'; }else { $isFeatured = 'N'; } $jobStatusName = 'New'; $jobDetails = new jobDetails($fillByDate, $firmId, $industryId, $industryName, $isFeatured, $jobDescription, $jobId, $jobNumber, $jobStatusId, $jobStatusName, $jobTitle, $jobTypeId, $jobtype); $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" => $jobDetails ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'addJob',$params); return $response->return; } /** * Update Jobs * * @param unknown_type $jobId * @param unknown_type $jobTitle * @param unknown_type $jobDescription * @param unknown_type $industryId * @param unknown_type $jobtype * @param unknown_type $isFeatured * @return unknown */ function updatejobs($jobId,$jobTitle,$jobDescription,$industryId,$jobtype,$isFeatured,$jobStatusName='New') { if($isFeatured == 'on') { $isFeatured = 'Y'; }else { $isFeatured = 'N'; } $jobDetails = new jobDetails($fillByDate, $firmId, $industryId, $industryName, $isFeatured, $jobDescription, $jobId, $jobNumber, $jobStatusId, $jobStatusName, $jobTitle, $jobTypeId, $jobtype); $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" =>$jobDetails ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'editJob',$params); return $response->return; } /** * Get JobByJobId * * @param unknown_type $jobId * @return unknown */ function getJobByJobId($jobId) { $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" => $jobId ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'fetchJobByJobId',$params); return $response; } /** * Create Job Applicant Form * * @param string $addressId * @param string $addressLine1 * @param string $addressLine2 * @param string $applicantId * @param string $applicantNumber * @param string $city * @param string $comments * @param string $country * @param string $countyAndDistrict * @param string $emailId * @param string $expectedDesignation * @param string $expectedSalary * @param string $firstName * @param string $industryId * @param string $jobApplicantId * @param string $jobId * @param string $jobNumber * @param string $lastName * @param string $middleName * @param string $noteDetails * @param string $phoneNumber * @param string $postalCode * @param string $provinceAndState * @param string $resumeCoverLetter * @param string $resumeDetails * @param string $resumeFileName * @param string $resumeId * @param string $skills * @return JobApplicantDetails */ function createJobApplicant($addressId, $addressLine1, $addressLine2, $applicantId, $applicantNumber, $city, $comments, $country, $countyAndDistrict, $emailId, $expectedDesignation, $expectedSalary, $firstName, $industryId, $jobApplicantId, $jobId, $jobNumber, $lastName, $middleName, $noteDetails, $phoneNumber, $postalCode, $provinceAndState, $resumeCoverLetter, $resumeDetails, $resumeFileName, $resumeId, $skills,$upload_docid) { $jobapplicantdetals = new JobApplicantDetails($addressId, $addressLine1, $addressLine2, $applicantId, $applicantNumber, $city, $comments, $country,$countyAndDistrict,$emailId, $expectedDesignation, $expectedSalary, $firstName, $industryId, $jobApplicantId,$jobId, $jobNumber, $lastName, $middleName, $noteDetails, $phoneNumber, $postalCode, $provinceAndState, $resumeCoverLetter, $resumeDetails, $resumeFileName, $resumeId, $skills,$upload_docid); $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" => $jobapplicantdetals ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'addNewJobApplicant',$params); if((isset($response->return->methodResponse) && $response->return->methodResponse->responseCode != '1000') || $response =='E_100') { echo awp_messagelist('jobapplicant-display-page'); } return $response->return; } /** * fetchAllJobsWithStatus * * @param int $maxCount * @param int $offset * @param String $getFeaturedJobsOnly * @param string $status * @return HrJobSearchResultsHelper */ function getAllHrjobs($maxCount=999,$offset=0,$getFeaturedJobsOnly='false',$status = null) { $sortBy = 0; $params_plugincall = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" => $getFeaturedJobsOnly, "arg3" => $maxCount, "arg4" => $offset, "arg5" => $sortBy, "arg6" => $status ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'fetchAllJobsWithStatus',$params_plugincall); if($response == 'E_100') { echo awp_messagelist('validate-getAllJobsWithStatus'); } return $response->return; } /** * Search By jobs. * * @param String $keyword * @param String $industry * @param ArrayLists $job_types * @param int $maxcount * @return HrJobSearchResultsHelper */ function serchByJobs($keyword,$industry,$job_types,$maxcount=999) { $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" => $keyword, "arg3" => $industry, "arg4" => $job_types, "arg5" => 'false', "arg6" => $maxcount, "arg7" => 0, "arg8" => 0 ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'findJobsBySearchText',$params); //searchJobs return $response; } /** * Job Description * * @param unknown_type $jobNo * @return unknown */ function jobdescriptionByNumber($jobNo) { $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => APPTIVO_ACCESS_KEY, "arg2" => $jobNo ); $response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'fetchJobByJobNo',$params); //getJobByJobNumber if( $response == 'E_100') { return $response; } return $response->return; } /** * Get All Industries. * * @return unknown */ function getAllIndustries() { $params = array ( "arg0" => APPTIVO_SITE_KEY, ); $data_key = APPTIVO_SITE_KEY.'-industries'; if(class_exists('Memcache')) { $mcache_obj = new AWP_Cache_Util(); //Create Object in AWP_DataCache clss $mcacheconnect = $mcache_obj->connectmcache(); } else { $mcacheconnect = FALSE; } //To check if the MemCache is connected or not. if( $mcacheconnect ) { // "connected MemCache."; $response = $mcache_obj->getdata($data_key); if( empty($response)) //Check the published date key value is set in memcahe or not. { //echo "Memcache Set"; $response = getsoapCall(APPTIVO_SITE_SERVICES,'getAllIndustries',$params); $mcache_obj->storedata($data_key,$response); } }else { //echo "MemCache is not connected.."; $response = getsoapCall(APPTIVO_SITE_SERVICES,'getAllIndustries',$params); } return $response->return; } /** * Get Token For Upload. * * @return unknown */ function getTokenForDocumentUpload() { $params = array ( "arg0" => APPTIVO_SITE_KEY, "arg1" => '', ); $response = getsoapCall(APPTIVO_SITE_SERVICES,'getTokenForDocumentUpload',$params); return $response->return; } ?>