Archive for the 'Website Development' Category


How to add the pricing plan to another page on your site in WebJobs

Thursday, April 17th, 2008

Problem: The dynamic list of prices for posting jobs is only viewable to employers who are logged in.

Solution:

In your new page in engine/pages/new_page.php , make sure the following is included near the top:

require_once ’smartway/lib/table.lib’;

Then add the following two classes, which originate in the engine/pages/employer_home.php file:

class employer_job_plans_table_renderer extends sql_table_renderer{
function employer_job_plans_table_renderer(){
$application =& application();
parent::sql_table_renderer();
$this->table_class = ’seeker_search_res_wide’;
$this->header_class = $this->footer_class = ’seeker_search_ends_wide’;
$this->row_1_class = ’seeker_search_row1_wide’;
$this->row_2_class = ’seeker_search_row2_wide’;
$this->header_navbar_class = ‘narrow_navbar_top’;
$this->footer_navbar_class = ‘narrow_navbar_bottom’;
}

function handle_duration($f){
$application =& application();
return $f[’duration’] .’ ‘.$application->text(’days’);
}
function handle_quantity($f){
$application =& application();
return $f[’quantity’];
}

function handle_price($f){
$application =& application();
if(ceil($f[’price’])==0){
return $application->text(’Free’);
}
else{
return $application->config(’currency_symbol’) . util_funcs::number_format($f[’price’], 2);
}
}
function handle_type($f){
$application =& application();
return $application->text($f[’type’]);
}
function handle_controls($row)
{
$application =& application();
$text = $application->text();
$service = $application->input(’service’);
$PHP_SELF = $application->server(’PHP_SELF’);

if($row[’type’]==’job_postings’){
if(ceil($row[’price’]) != 0){
$output = ” <a href=’$PHP_SELF?page=post_single_job1&job_post_type={$row[’name’]}’>\n{$text[’purchase’]}</a> \n ” ;
}
else{ // User is getting a free plan
$output = ” <a href=’$PHP_SELF?page=employer_home&action=free_plan&plan_id={$row[’id’]}’>\n{$text[’purchase’]}</a> \n ” ;
}
}
else{ // Resume View
if(ceil($row[’price’])!=0){
$output = ” <a href=’$PHP_SELF?page=resume_searches&searches_type={$row[’name’]}’>\n {$text[’purchase’]}</a> \n ” ;
}
else{ // User is getting a free plan
$output = ” <a href=’$PHP_SELF?page=employer_home&action=free_plan&plan_id={$row[’id’]}’>\n{$text[’purchase’]}</a> \n ” ;
}
}
return $output;
} // handle_controls
} // employer_job_plans_table_renderer

class employer_combo_plans_table_renderer extends sql_table_renderer{
function employer_combo_plans_table_renderer(){
$application =& application();
parent::sql_table_renderer();
$this->table_class = ’seeker_search_res_wide’;
$this->header_class = $this->footer_class = ’seeker_search_ends_wide’;
$this->row_1_class = ’seeker_search_row1_wide’;
$this->row_2_class = ’seeker_search_row2_wide’;
$this->header_navbar_class = ‘narrow_navbar_top’;
$this->footer_navbar_class = ‘narrow_navbar_bottom’;
}

function handle_price($f){
$application =& application();
if(ceil($f[’price’])==0){
return $application->text(’Free’);
}
else{
return $application->config(’currency_symbol’) . util_funcs::number_format($f[’price’], 2);
}
}

function handle_posting_plan($f){
return $f[’posting_plan_name’];
}

function handle_resume_plan($f){
return $f[’resume_plan_name’];
}

function handle_name($f){
return $f[’name’];
}

function handle_controls($row)
{
$application =& application();
$text = $application->text();
$service = $application->input(’service’);
$PHP_SELF = $application->server(’PHP_SELF’);

if(ceil($row[’price’])!=0){
return ” <a href=’$PHP_SELF?page=combo_package&plan_id={$row[’id’]}’>\n {$text[’purchase’]}</a> \n ” ;
}
else{ // User is getting a free plan
return ” <a href=’$PHP_SELF?page=employer_home&action=free_combo&plan_id={$row[’id’]}’>\n{$text[’purchase’]}</a> \n ” ;
}
} // handle_controls
} // class employer_combo_plans_table_renderer

(more…)

Add a pending check payment notification email to webjobs

Wednesday, April 16th, 2008

Problem: If you have enabled “Notify admin of new job postings?:” from Admin Area -> Email Notification, an email will be sent to the Admin notifying him when a job has been posted. However, if check payment is selected there will be no email sent to the admin.

In theory, I guess the email ISN’T needed because it is assumed that the siteowner doesn’t need to worry about activating the job until the check is received. However, on one Webjobs site I used the check module as a request from the employer to be invoiced, instead of paying by credit card. The siteowners had to remember to check the Pending Check area in Smartway to see if any employers were waiting to be invoiced.

Solution: Thanks to the new upgraded Webjobs 2.0, the solution is now very simple. Previously, it was difficult to figure out where to generate the email , because of the long posting process (post_single_job2, post_single_job3, confirm_purchase, etc. Where does it go??). Fortunately, this version has a new file — engine/pages/check.php that makes it easy to send the email at the right time in the posting process. (more…)

How to add a “How Did You Hear About Us” survey to WebJobs

Wednesday, April 16th, 2008

This will go in the employer registration form, or both. For the siteowner to review the data, it should go in Smartway as well, under the Statistics section. If adding to the job seeker registration, just follow the same instructions, but use the jobseeker files in the engine/pages and smartway/conf directories.

Step 1

Make new fields in database (use phpmyadmin or a similar tool to make it really easy!)

  • In jb_select_boxes table, make up a group name, such as “referral sources”. Insert a new data record  for each referral source that you want to use. Indicate referral source as the group name. Use the name of the referral source you want to track (i.e. Google) for the name field. The relative order indicates the order in which you want the names to appear in the dropdown list. 1 is on top, 2 is next, etc.
  • In jb_users table, add a new field called referrals - varchar (128), null — to store the data that users choose on their registration form.

Step 2

Edit the php files to pull these new fields.

  • In engine/pages/register_employer.php — around line 148, insert this line, in between ’signup_time” and ‘timezone” lines.

‘referrals’ => $sql->escape_string($input[’referrals’]),

Around line 154, add referrals into array. It should look something like this:

array(’login’, ‘password’, ’status’, ’salutation’, ‘first_name’,'middle_initial’, ‘last_name’,
’suffix’, ’suffix_titles’, ‘company_name’, ‘completed’, ’signup_time’, ‘referrals’, ‘timezone’, ‘language’));

(more…)