dayjobfinder

Topic: How to store applicant name and email address?

When people come to the site and apply for a job, I know that the job id, ip address and datestamp are written to the job_applications table.

I'd like to also store the user's name and email address when someone submits an application.

I've added two fields to the job_applications table:

user_email
user_name

but I'm having trouble with my insert statement within class.JobApplication.php

I know I need to alter line 33 to read:

$sql = 'INSERT INTO job_applications (job_id, created_on, ip, user_email, user_name)

but I don't know how to correctly insert the variables from the $data array that is created in page_apply.php

Can anyone provide a little direction . . . I'm guessing it should look something like:

VALUES (' . $this->mJobId . ', NOW(), "' . $ip . '", "' . emailvariablegoeshere . '", "' . namevariablegoeshere . '")';

Any help you can provide would be appreciated.

Thanks!

dayjobfinder

Re: How to store applicant name and email address?

No need to reply, I figured it out.

flakdesign

Re: How to store applicant name and email address?

Mind Sharing it with everyone in the forum?

benobo

Re: How to store applicant name and email address?

That would be very nice from you to share this mate, maybe you can post it here http://www.jobberbase.com/forum/topic73 … cants.html

putypuruty

Re: How to store applicant name and email address?

Hi.

To save the user's name and email follow these steps:

1. Open page_apply.php and replace line 55 with

Code:
if ($app->Apply($data))

2. Open _includes/class.JobApplication.php and replace line 21 with

Code:
public function Apply($jobApplication)

and also replace

Code:
$sql = 'INSERT INTO job_applications (job_id, created_on, ip)
                                VALUES (' . $this->mJobId . ', NOW(), "' . $ip . '")';

with

Code:
$sql = 'INSERT INTO job_applications (job_id, created_on, ip, user_email, user_name)
                                VALUES (' . $this->mJobId . ', NOW(), "' . $ip . '", "' .
                                $db->real_escape_string($jobApplication['apply_email']) .
                                '","' . $db->real_escape_string($jobApplication['apply_name']). '")';

This should do it smile

N2S

Re: How to store applicant name and email address?

you need to be more specific with you say "line 55"
when people have a highly modified version of the script, line 55 might not be the right line to "replace".

instead use..

FIND: xxxxxx (line 55)
REPLACE WITH: xxxxxxxx

its more accurate and causes less confusion.

not sure if this is correct

Code:

alter table job_applications add column user_name varchar (40) ;
alter table job_applications add column user_email varchar (40) ;

but works fine with my site.

Last edited by N2S (2008-11-14 00:11:28)

http://i34.tinypic.com/2affofk.png

mployr.com

Re: How to store applicant name and email address?

Great work. Thanks for the tip!

Entrepreneur? Check this out...
http://www.eugeneg.com/overview/

casualmusic

Re: How to store applicant name and email address?

any feedback on this?

putypuruty

Re: How to store applicant name and email address?

@casualmusic

What do you mean? What I provided above + the alter statements provided by N2S (which you have to run from phpmyadmin) will do the trick wink

evertsemeijn

Re: How to store applicant name and email address?

The first question that comes into my mind is why you want to store the name and email? Do you use it for autofill the next time they return?

Member of Jobberbase Development Team - Templates/Usability :: Looking for installation and/or custom design? :: Beautiful Wordpress themes

N2S

Re: How to store applicant name and email address?

yes it works for me.
Im not a professional but I am trying to make a quick simple chart/table that displays the latest applicants..
I am just testing this out.. but it works for me.. (but looks VERY ugly..)

create new file...
admin/page_apply.php
insert the following into the file..

Code:

<?php


$query = "SELECT id, user_email FROM job_applications";

$result = mysql_query($query) or die(mysql_error());
echo "<br><table border='1'>";
echo "<tr><th>id</th><th>Email</th></tr>";
while($row = mysql_fetch_array($result)){
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['user_email'];
echo "</td></tr>";
}
echo "</table>";
 
?>

open "admin/index.php"

Code:

FIND 
        case 'page-unavailable':
            if(!isset($_SESSION['AdminId']))
            {
                redirect_to(BASE_URL);
                exit;
            }
            $html_title = 'Page unavailable / ' . SITE_NAME;
            $template = 'error.tpl';
            $flag = 1;
            break;

AFTER ADD
        case 'apply':
            if(!isset($_SESSION['AdminId']))
            {
                redirect_to(BASE_URL);
                exit;
            }
            require_once 'page_apply.php';
            $flag = 1;
            break;

upload both files into correct destination..
go to.. http://yoursite.com/admin/apply

my intention is to create an admin page that allows me to see..
applicants name + jod id + their name + their letter of intention.
(50 applicants per page)

anyone know how to do that?

http://i34.tinypic.com/2affofk.png

bthornic

Re: How to store applicant name and email address?

Hey, I have attempted about 30 different ways of trying this in v1.9 with no luck. Can you please explain how to do this for that version.

Thank you!

testgigs

Re: How to store applicant name and email address?

Can someone tell me what line 55 used to be so I can attempt to implement this.

www.gigajobs.com.au / Aussie IT Jobs