<% ############################################################################## # Program Name : accept_resume.php # Location : /employment/ # Author : Vandan Juvekar # Date : 12/03/2001 # For : Accept new resume / Update old resume # Called from : forms in self, updel_resume.php # System Name : Online Resumes Database ############################################################################## # Session Variable (explained later in this script) session_start(); # For openConnection() include("includes/common.inc"); openConnection("resume_db"); $today = date("Y/m/d"); %> Enter your Resume for (var i=0; i') document.resume.positionInfo.selectedIndex = i; } <% } %> }"> <% # For HTML header and Javascript isValid() include("includes/resume_header.inc"); # If form is not shown... if ($action == "") { %>
Please check the desired format in sample resumes before applying
Enter Resume
(Fields marked with * are required)
Name
* First: * Last:
Contact Info
* Email: * Phone:
Address
Street:
City: State: Zip:
Qualifications
* Education:
Certifications:
Work Experience (years+): Position applied for:
Skills:
(Choose all applicable)
Text Resume
Password (For future updation)
* Password: * Confirm:
<% } # If form submitted... else #if (ereg("^http://" . $HTTP_HOST . $SCRIPT_NAME, $HTTP_REFERER)) { switch($action) { # case 1 indicates that the above form is submitted case 1: # case 2 indicates that the below form is submitted # If one selects more than 25 (or so) skills from the above form and submits, # There would be more than 100 selection lists that have to be generated dynamically # (for coursework experience, industry experience, last used - year and last used - month) # When I try to generate these in a single page, the browsers simply do not show them # (which is strange and unexpected!) # Therefore, I am generating selection lists for 10 skills at a time, # until all selected skills are shown. # The session variable $_SESSION['numIter'] is the skills index counter which is used to # show only 10 skills at a time. case 2: { if ($action == 1) # The above form is submitted, I am going to show the selection lists for the first time { $_SESSION['numIter'] = 0; # Reset the skills index counter } # Since this form is different from the above one, we have to preserve the state in hidden variables # The hidden variables skills_coursework_yrs, skills_industry_yrs and skills_last_used_date will # be comma separated values containing all skill info, at the end. %>
<% for ($i = 0; $i < count($skills); $i++) { %> <% } %>
Please give us more information about your skills:
<% $j = $_SESSION['numIter']; # Begin after last shown skill # Show form for next (upto 10) skills for ($i = $_SESSION['numIter']; $i < $j + 10; $i++) { $query = "SELECT skill FROM skills WHERE id = " . $skills[$i]; $result = mysql_query($query); $row = mysql_fetch_array($result); %> <% $_SESSION['numIter']++; if ($_SESSION['numIter'] == count($skills)) # If all skills are shown { %> <% break; } } %>
Skill CourseWork Proficiency (years+)
(Experience in years during education)
Industry Proficiency (years+)
(Experience in years during employment)
Last Used (Month & Year)
<%= $row["skill"] %> -
<% # Javascript to create semicolon-separated values %> <% break; } # case 3 will be executed when all applicant info along with skill info is gathered # Based on the caller form, resume will be either inserted or updated case 3: { $query = "SELECT id, email FROM resumes ORDER BY id desc"; $result = mysql_query($query) or die("SELECT query failed on resumes"); if ($row = mysql_fetch_array($result)) $count = $row["id"] + 1; else $count = 1; if ($row["id"] != $resume_id) $emailExists = ($row["email"] == $email); while (!$emailExists && ($row = mysql_fetch_array($result))) { if ($row["id"] != $resume_id) $emailExists = ($row["email"] == $email); } mysql_free_result($result); if ($emailExists) { %>

A resume with the same email address already exists in our database.

Retry <% } else { if ($upDel == "update") $query = "UPDATE resumes SET last_name='$last_name', first_name='$first_name', email='$email', password='$password1', phone='$phone', street='$street', city='$city', state='$state', zip='$zip', education='$education', certifications='$certifications', experience_yrs=$experience_yrs, resume='$resume', entry_date='$today' WHERE id = $resume_id"; else { $query = "INSERT INTO resumes VALUES($count, '$last_name', '$first_name', '$email', '$password1', '$phone', '$street', '$city', '$state', '$zip', '$education', '$certifications', $experience_yrs, '$resume', '$today')"; $resume_id = $count; } $result = mysql_query($query) or die("

0.Unsuccessful. Please retry.

"); $numSelected = count($skills); if ($numSelected) { $courseworkYrs = split(";", $skills_coursework_yrs); $industryYrs = split(";", $skills_industry_yrs); $lastUsedYr = split(";", $skills_last_used_yr); $lastUsedMo = split(";", $skills_last_used_mo); } if ($upDel == "update") { $query = "DELETE FROM resume_skills_info WHERE resume_id = $resume_id"; $result = mysql_query($query) or die("

1.Unsuccessful. Please retry.

"); } for ($i = 0; $i < $numSelected; $i++) { $query = "INSERT INTO resume_skills_info VALUES ($resume_id, " . $skills[$i] . ", " . $industryYrs[$i] . ", " . $courseworkYrs[$i] . ", " . $lastUsedYr[$i] . ", '" . $lastUsedMo[$i] . "')"; #print "
".$query; $result = mysql_query($query) or die("

2.Unsuccessful. Please retry.

"); } %>

Thank you for applying <% if ($upDel == "update") { $query = "DELETE FROM application_info WHERE resume_id = " . $resume_id; $result = mysql_query($query) or die("

3.Unsuccessful. Please retry.

"); } $positionVar = split("\|", $positionInfo); $positionId = $positionVar[0]; if ($positionId) { $query = "INSERT INTO application_info VALUES ($resume_id, $positionId)"; $result = mysql_query($query); if (mysql_affected_rows()) { %> for the position of <%= stripslashes($positionVar[1]) %> <% } } %> !Go to MKSI home <% } break; } } #switch ends } mysql_close($link); %>