Archive for the 'Website Development' Category


Add Resume and Add Cover Errors

Saturday, September 20th, 2008

Problem: When attempting to upload a resume or cover letter, users get the following error: You cannot simultaneously use both the text area and file upload box. Please choose one.

Solution: This is a temporary solution — Comment out these lines 72 through 76 in engine/pages/add_resume.php

if ($file_info && $input[’resume_textarea’]){
$this->generate_error(’cannot_use_both_textarea_and_file’);
unlink($file_info[’tmp_name’]);
return false;
}

Comment out these lines in engine/pages/edit_cover.php - lines around 112-118

if ($file_info[’name’] && $input[’cover_textarea’])
{
$this->generate_error(’cannot_use_both_textarea_and_file’);
unlink($file_info[’tmp_name’]);
return false;
}

“How did you hear about us,” cont. Add “Other” text field

Sunday, September 7th, 2008

Following up on a previous post - http://lifehackmom.com/how-to-add-a-how-did-you-hear-about-us-survey-to-webjobs/

Here is how to add a write-in “Other” text field, in case a registrant was referred by a source that isn’t in the drop-down list you created.

Step 1: Add other_referrals field to database

In jb_users table, add a new text field called other_referrals to store the data that users write in on their registration form.

Step 2: Register Employer page:

In engine/pages/register_employer.php — Add this line under the line where you added the referrals - around line 151

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

Add other_referrals into your array a few lines down, so that it looks like this:

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

Step 3:

Add the other field to the xml file (smartway/conf/register_employer or register_employer_city or whatever depending on how you’ve configured webjobs).

<input name=”other_referrals” required=”0″>other_referrals</input>

You are done! So easy!

Next post will be on how to track and view the results in the Smartway statistics section.

Add company name to billing history

Thursday, May 1st, 2008

Problem: When viewing the billing history table in Smartway — the administrative area of webjobs — it is difficult to tell what company paid for the job b/c it only includes the user ID.

Solution: — Add the company name to the billing table.
1. In smartway/modules/billing_history.php, around line 78, add this line into the array:

‘company_name’ => ‘company_name’,

2.Around line 236, add:

$company_name = $input[’company_name’];

3.Around line 312, add the following line into the array:

‘company_name’ => $company_name,

4. Around line 541, after this line:

$constraints[] = “bh.user_id = ‘” . $user_id . ‘\”;

add:

$constraints[] = “u.id = ‘” . $user_id . ‘\”;

5. For the entire SELECT statement and array around line 604, change it to this:

‘SELECT bh.user_id, u.company_name, bh.id, bh.timestamp, bh.name, bh.quantity, bh.price, bh.type, bh.pending, bh.comment ‘ .
‘FROM `jb_billing_history` AS bh, `jb_users` AS u ‘ .
‘WHERE bh.user_id=u.id ‘ .
“AND $constraints $order_clause”,
array(’user_id’, ‘invoice’, ‘company_name’,'id’, ‘timestamp’, ‘name’, ‘quantity’, ‘price’, ‘type’, ‘pending’, ‘comment’, ‘controls’));

6. Change the SQL query around line 706 to:

$sql->query(’SELECT bh.user_id, u.company_name, u.login, bh.timestamp, bh.name, bh.type, bh.quantity, bh.duration, bh.price, bh.comment, bh.pending ‘ .
‘FROM `jb_billing_history` AS bh LEFT JOIN `jb_users` AS u ON(bh.user_id = u.id) ‘ .
“WHERE bh.id = $id LIMIT 1″);

7. Change the language file so that the Company label appears in the table. Open smartway/conf/lang/eng/text.billing_history.php and add

‘company_name’ => ‘Company:’,

on the line below this comment

// Smartway translations for modules billing_history.php

You’re done! If all went as planned, company name should show up in the table after the invoice number.