$smarty->assign('has_previous_page', $pagination->has_previous_page()); $smarty->assign('total_pages', $pagination->total_pages()); $smarty->assign('has_next_page', $pagination->has_next_page()); $smarty->assign('next_page', $pagination->next_page()); $offset = $pagination->offset(); $sql = " SELECT * FROM " . TBL_JOB; $sql .= " LIMIT {$per_page} "; $sql .= " OFFSET {$offset} "; $lists = Job::find_by_sql($sql); $manage_lists = array(); if ($lists && is_array($lists)) { $i = 1; foreach ($lists as $list) { unset($employer); if (!empty($list->fk_employer_id) && $list->fk_employer_id != 0) { $employer = Employer::find_by_id($list->fk_employer_id); } $manage_lists[$i]['id'] = $list->id; $manage_lists[$i]['job_title'] = $list->job_title; $manage_lists[$i]['spotlight'] = $list->spotlight == "Y" ? "Spotlight Job" : "Standard Job"; $manage_lists[$i]['created_at'] = strftime(DATE_FORMAT, strtotime($list->created_at)); $manage_lists[$i]['employer_name'] = empty($employer) ? 'Employer not found' : $employer->full_name(); $manage_lists[$i]['employer_id'] = $employer->id; $manage_lists[$i]['employer_username'] = $employer->username; $manage_lists[$i]['views_count'] = $list->views_count; $manage_lists[$i]['apply_count'] = $list->apply_count; $manage_lists[$i]['is_active'] = $list->is_active == "Y" ? "Active" : "Not Active"; $manage_lists[$i]['job_status'] = $list->job_status; $i++; } $smarty->assign('manage_lists', $manage_lists);
$page = "job_by_company"; } else { $page = "not_found"; } } switch ($page) { case "company": $jobcompany = Job::list_job_by_employer(); if ($jobcompany) { $company = array(); $i = 1; foreach ($jobcompany as $job_by_company) { $employer_id = $job_by_company->fk_employer_id; $total_jobs = Job::total_job_by_employer($employer_id); $company[$i]['total'] = $total_jobs; if ($employer = Employer::find_by_id($employer_id)) { $name = $employer->company_name; /**check length of text */ $names = strlen($employer->company_name) > 60 ? substr($employer->company_name, 0, 30) . " ... " : $employer->company_name; $company[$i]['name'] = $names; $company[$i]['employer_id'] = $employer_id; $company[$i]['var_name'] = $employer->var_name; } $i++; } $smarty->assign('company', $company); } $html_title = SITE_NAME . " - " . format_lang('page_title', 'BrowseBYCompany'); //$meta_description = ""; $smarty->assign('message', $message); $smarty->assign('rendered_page', $smarty->fetch('company.tpl'));
$smarty->assign('career', $career_name); //experience $experiences = Experience::find_by_id($jobs->fk_experience_id); $smarty->assign('experiences', $experiences); $experience_name = !empty($experiences) ? $experiences->experience_name : format_lang('not_provided'); $smarty->assign('experience_var_name', $experiences->var_name); $smarty->assign('experience', $experience_name); $smarty->assign('spotlight', $jobs->spotlight); if (!empty($jobs->job_salary) && !empty($jobs->salaryfreq)) { $job_salary = $jobs->job_salary . format_lang('per') . $jobs->salaryfreq; } else { $job_salary = format_lang('not_provided'); } $smarty->assign('job_salary', $job_salary); //$smarty->assign('salaryfreq', $jobs->salaryfreq ); $employer = Employer::find_by_id($jobs->fk_employer_id); $company_name = $employer->company_name; $employer_var_name = $employer->var_name; $smarty->assign('employer_var_name', $employer_var_name); $smarty->assign('company_name', $company_name); $smarty->assign('company_logo', $employer->company_logo); $smarty->assign('contact_name', $jobs->contact_name); $telephone = !empty($jobs->contact_telephone) ? $jobs->contact_telephone : format_lang('not_provided'); $smarty->assign('contact_telephone', $telephone); $link = !empty($jobs->site_link) ? $jobs->site_link : format_lang('not_provided'); $smarty->assign('site_link', $link); //$smarty->assign('poster_email', $jobs->poster_email ); $smarty->assign('views_count', $jobs->views_count); $smarty->assign('apply_count', $jobs->apply_count); $start_date = !empty($jobs->start_date) ? $jobs->start_date : format_lang('not_provided'); $smarty->assign('start_date', $start_date);
<?php $user = Employer::find_by_id($user_id); $email = $user->email_address; $validated = $user->is_active; $username = $user->username; $smarty->assign('current_email', $email); $smarty->assign('is_validated', $validated); if (isset($_POST['bt_email'])) { $error = array(); $email_address = $_POST['txt_email_address']; $con_email = $_POST['txt_confirm_email_address']; if (!check_email($email_address)) { $error[] = format_lang('error', 'incorrect_format_email'); } $email_found = Employer::check_email($email_address); if ($email_found) { $error[] = format_lang('error', 'email_already_existed'); } if (sizeof($error) == 0) { $user = Employer::change_email_address($username, $email_address); if ($user) { $change_key = Employer::change_key($username); if ($change_key) { $mess = "<p>To confirm your profile addition, please click the link below. Or, \r\n\t\t\t\t\t\t\t\tif the link is not clickable, copy and paste it into address bar of your \r\n\t\t\t\t\t\t\t\tweb browser, to directly access it.</p><p> </p>"; $mess .= "<p>#Link#/confirm_reg/{$reg_key}/</p><p> </p>"; $mess .= "<p>If you still have the final step of the registration wizard open, \r\n\t\t\t\t\tyou can input your confirmation code on that screen.</P><p> </p>"; $mess .= "<p>Your confirmation code is: {$reg_key}</p><p> </p>"; } $message = "<div class='success'>" . format_lang('success', 'update_email') . "</div>"; } else {
if (isset($_POST['spotlight_credit_all']) && !empty($_POST['txt_credits'])) { foreach ($_POST['employer_id'] as $key => $value) { if ($value != "") { $username = Employer::find_by_id($value); $employer->username = $username->username; $employer->spotlight_qty = (int) $_POST['txt_credits']; if ($employer->add_more_spotlight_job_post()) { $success = true; } } } } if (isset($_POST['job_credit_all']) && !empty($_POST['txt_credits'])) { foreach ($_POST['employer_id'] as $key => $value) { if ($value != "") { $username = Employer::find_by_id($value); $employer->username = $username->username; $employer->job_qty = (int) $_POST['txt_credits']; if ($employer->add_more_job_post()) { $success = true; } } } } if ($success) { $session->message("<div class='success'>Credit(s) has been added</div>"); redirect_to($_SERVER['PHP_SELF']); die; } } ###############################################################################
function process_payment($invoice_id = null, $params) { $success = false; $invoice = PackageInvoice::find_by_id($invoice_id); // process payment $clint = Employer::find_by_id($invoice->fk_employer_id); if ($invoice->cv_views == "Y") { $clint->cv_qty = $invoice->posts_quantity; $clint->add_cvs(); $success = true; } if ($invoice->spotlight == "Y") { $clint->spotlight_qty = $invoice->posts_quantity; $clint->add_more_spotlight_job_post(); $success = true; } if ($invoice->standard == "Y") { $clint->job_qty = $invoice->posts_quantity; $clint->add_more_job_post(); $success = true; } else { } if ($success) { $invoice->package_status = 'Completed'; $invoice->processed_date = date("Y-m-d H:i:s", time()); $invoice->update_package_status(); $invoice_item = new Invoice(); /* start **/ /** $param['payment_status'] = ""; //what is the status of the payment $param['amount'] = ""; // how much was paid for this total amount for each item $param['currency'] = ""; //what currecy they used to pay for this $param['receiver_id'] = ""; // what is the id of person who is paying $param['payment_email']; // what email have they used to pay $param['txn_id'] = ""; // txt id $param['txn_type'] = ""; // how are they pay for this web or ext. $param['payer_status'] = ""; //is user verfied by the method they pay from $param['residence_country'] = ""; //which country does user belogn to //$param['origin'] = ""; //where is the payment come from $param['payment_method'] = ""; // what methoid of payment they used e.g. paypal, ccbill $param['payment_vars'] = ""; //get all var which are return from online site. $param['payment_type'] = ""; //how they pay for this $param['reason'] = ""; // if they cancel then tell user why **/ $invoice_item->fk_invoice_id = $invoice_id; $invoice_item->payment_status = $params['payment_status']; $invoice_item->payment_type = $params['payment_type']; $invoice_item->amount = $params['amount']; $invoice_item->currency = $params['currency']; $invoice_item->receiver_id = $params['receiver_id']; $invoice_item->payment_email = $params['payment_email']; $invoice_item->txn_id = $params['txn_id']; $invoice_item->txn_type = $params['txn_type']; $invoice_item->payer_status = $params['payer_status']; $invoice_item->residence_country = $params['residence_country']; $invoice_item->payment_date = date("Y-m-d H:i:s", time()); $invoice_item->reason = $params['reason']; $invoice_item->origin = $params['payment_method']; $invoice_item->payment_vars = $params['payment_vars']; if ($invoice_item->save()) { /** EMAIL TEXT **/ $email_template = get_lang('email_template', 'confirm_order'); $subject = str_replace("#SiteName#", SITE_NAME, $email_template['email_subject']); $body = $email_template['email_text']; $body = str_replace("#FullName#", $clint->full_name(), $body); $body = str_replace("#SiteName#", SITE_NAME, $body); $body = str_replace("#InvoiceId#", $invoice_id, $body); $body = str_replace("#Qty#", $invoice->posts_quantity, $body); $body = str_replace("#Amount#", $invoice->amount, $body); $body = str_replace("#PayMethod#", 'None', $body); $body = str_replace("#Domain#", $_SERVER['HTTP_HOST'], $body); $body = str_replace("#ContactUs#", ADMIN_EMAIL, $body); $body = str_replace("#Link#", BASE_URL, $body); $to = array("email" => $clint->email_address, "name" => $clint->full_name()); $from = array("email" => NO_REPLY_EMAIL, "name" => SITE_NAME); /** end email text **/ $mail = send_mail($body, $subject, $to, $from, "", ""); //redirect_to(BASE_URL."employer/credits/"); //die; return $mail; } } return false; }
<?php $records = Job::gorup_jobs_by_dates(); $i = 0; if (!empty($records)) { $record_array = array(); $i = 0; foreach ($records as $record) { $rows = Job::get_group_job($record->created_at); $created_at = date("d M", strtotime($record->created_at)); $i = 0; foreach ($rows as $row) { $city = City::find_by_code($row->country, $row->state_province, $row->county, $row->city); $city_name = empty($city) ? $row->city : $city->name; $company_namer = Employer::find_by_id($row->fk_employer_id); $company_name = $company_namer->company_name; $body = $row->job_description; $record_array[$created_at][$i]['job_title'] = $row->job_title; $record_array[$created_at][$i]['location'] = $city_name; $record_array[$created_at][$i]['job_description'] = subtrack_string($body, 120); $record_array[$created_at][$i]['var_name'] = $row->var_name; $record_array[$created_at][$i]['company_name'] = $company_name; $i++; } //$i++; } $smarty->assign('gorup_jobs_by_dates', $record_array); unset($record_array, $i, $record, $row); }
case "delete_logo": $employer = new Employer(); $employer->company_logo = $user->company_logo; $employer->username = $user->username; if ($employer->destroy_logo()) { $session->message("<div class='success'>" . format_lang('success', 'deleteLogo') . "</div>"); } else { $session->message("<div class='error'>" . format_lang('error', 'deleteLogo') . "</div>"); } redirect_to(BASE_URL . 'employer/account/'); die; break; default: if (isset($_POST['bt_update'])) { $employer = new Employer(); $remove_logo = Employer::find_by_id((int) $user_id); //$remove_logo->company_logo = $employer->company_logo; //$remove_logo->username = $employer->username; $employer->id = (int) $user_id; $employer->company_name = $company_name = $_POST['txt_company_name']; $employer->var_name = $employer->mod_write_check($_POST['txt_company_name'], $user->company_name); $employer->contact_name = $contact_name = $_POST['txt_contact_name']; $employer->site_link = $site = $_POST['txt_site']; $employer->company_desc = $company_desc = allowedTags($_POST['txt_company_desc']); $employer->email_address = $email = $_POST['txt_email']; $employer->username = $username = $user->username; $employer->address = $address = $_POST['txt_address']; $employer->address2 = $address2 = $_POST['txt_address2']; $_SESSION['loc']['citycode'] = $employer->city = $_POST['txtcity']; $_SESSION['loc']['countycode'] = $employer->county = $_POST['txtcounty']; $_SESSION['loc']['stateprovince'] = $employer->state_province = $_POST['txtstateprovince'];
public static function recommendedJob($user_id = 0, $cvjob_title = null, $cvjob_title2 = null, $cvjob_city = null, $cvjob_county = null, $cvjob_state = null, $cvjob_country = null) { global $database, $db; $select = " SELECT job_title, city, county, state_province, country, fk_employer_id,var_name, created_at "; $select .= ", match( job.job_title, job.job_description ) against ('" . $cvjob_title . "' '+" . $cvjob_title2 . "' IN BOOLEAN MODE) as relevance "; $from = " FROM " . self::$table_name . " AS job "; $where = " WHERE job.id NOT IN ( SELECT job_h.fk_job_id from " . TBL_HISTORY . " as job_h WHERE job_h.fk_employee_id={$user_id}) "; $where .= " AND job.is_active='Y' AND job.job_status='approved' AND job.id > 0 "; //$where .= " AND var_name <> '".$old."' "; $where .= " AND match( job.job_title, job.job_description ) against ('" . $cvjob_title . "' '+" . $cvjob_title2 . "' IN BOOLEAN MODE)"; $where .= " AND DATE_ADD( job.created_at, INTERVAL " . JOBLASTFOR . " DAY ) > NOW() "; //$where .= " AND city='{$cvjob_city}' "; $where .= " AND county='{$cvjob_county}' "; $where .= " AND state_province='{$cvjob_state}'"; $where .= " AND country='{$cvjob_country}'"; $order = " ORDER BY relevance, created_at DESC "; $limit = " LIMIT 10 "; //SELECT job.job_title, job.city, job.county, job.state_province, job.country //FROM jobberland_job AS job //WHERE job.id NOT IN (SELECT job_h.fk_job_id from jobberland_job_history as job_h WHERE fk_employer_id = 1) $sql = $select . $from . $where . $order . $limit; //echo $sql; $result = $database->query($sql); $num_rows = $database->num_rows($result); if ($num_rows > 0) { $i = 1; $temp = array(); while ($row = $database->fetch_object($result)) { $temp[$i]['job_title'] = $row->job_title; $temp[$i]['var_name'] = $row->var_name; $temp[$i]['created_at'] = strftime(DATE_FORMAT, strtotime($row->created_at)); //country $country_arry = Country::find_by_code($row->country); $country_name = $country_arry->name; //states $state = StateProvince::find_by_code($row->country, $row->state_province); $state_name = empty($state) ? $row->state_province : $state->name; //county $county = County::find_by_code($row->country, $row->state_province, $row->county); $county_name = empty($county) ? $row->county : $county->name; //city $city = City::find_by_code($row->country, $row->state_province, $row->county, $row->city); $city_name = empty($city) ? $row->city : $city->name; $temp[$i]['location'] = $city_name . ", " . $county_name . ", " . $state_name . ", " . $country_name; $employer = Employer::find_by_id($row->fk_employer_id); $company_name = $employer->company_name; $temp[$i]['company_name'] = $company_name; //$temp[$i]['job_title'] = $row->job_title; //$temp[$i]['job_title'] = $row->job_title; $i++; } return $temp; } return false; }
} $employer = Employer::find_by_id($jobs->fk_employer_id); $country_arry = Country::find_by_code($jobs->country); $country_name = $country_arry->name; $city = City::find_by_code($jobs->country, $jobs->state_province, $jobs->county, $jobs->city); $city_name = empty($city) ? $jobs->city : $city->name; $smarty->assign('apply_for', $jobs->job_title . " " . strtolower(format_lang('at')) . " " . $employer->company_name . " " . strtolower(format_lang('in')) . " " . $city_name . ", " . $country_name); unset($employer, $city, $country_arry); //Congratulations! You've applied for: //IT Manager at IT Lab in London EC1A 9PT if ($jobs) { $job_s = array(); $i = 1; $job_suggestions = Job::apply_suggestion($jobs->job_title, $var_name); foreach ($job_suggestions as $job_suggestion) { $employer = Employer::find_by_id($job_suggestion->fk_employer_id); //locations //country $country_arry = Country::find_by_code($job_suggestion->country); $country_name = $country_arry->name; //states $state = StateProvince::find_by_code($job_suggestion->country, $job_suggestion->state_province); $state_name = empty($state) ? $job_suggestion->state_province : $state->name; //county $county = County::find_by_code($job_suggestion->country, $job_suggestion->state_province, $job_suggestion->county); $county_name = empty($county) ? $job_suggestion->county : $county->name; //city $city = City::find_by_code($job_suggestion->country, $job_suggestion->state_province, $job_suggestion->county, $job_suggestion->city); $city_name = empty($city) ? $job_suggestion->city : $city->name; //end $job_s[$i]['id'] = $job_suggestion->id;