Commit 87691fe8 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

initial commit

parent e175116a
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>UNL_Studentjobs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
database: studentjobs
####application
####a new row is created for each edit so that previous submissions display the application as it looked at the time of submission
id int(10) No auto_increment
username varchar(255) utf8_general_ci No
firstname varchar(255) utf8_general_ci No
mi varchar(5) utf8_general_ci Yes NULL
lastname varchar(255) utf8_general_ci No
address varchar(255) utf8_general_ci No
city varchar(255) utf8_general_ci No
state varchar(255) utf8_general_ci No
zip varchar(10) utf8_general_ci No
phone varchar(255) utf8_general_ci No
email varchar(255) utf8_general_ci No
misdemeanor varchar(5) utf8_general_ci No
misdetails longtext utf8_general_ci Yes NULL
felony varchar(5) utf8_general_ci No
feldetails longtext utf8_general_ci Yes NULL
courtorder varchar(5) utf8_general_ci No
codetails longtext utf8_general_ci Yes NULL
####contacts
####users granted permission to view submissions for the appropriate dept
id int(10) No auto_increment
department_id int(10) No
username varchar(255) utf8_general_ci No
name varchar(255) utf8_general_ci No
email varchar(255) utf8_general_ci No
phone varchar(255) utf8_general_ci Yes NULL
####department
####departments that are part of the system, these are the depts that submissions can be made to
id int(10) No auto_increment
name varchar(255) utf8_general_ci No
address varchar(255) utf8_general_ci Yes NULL
sup_app_url varchar(255) utf8_general_ci Yes NULL
####education
####0 or more education records are made for each application
id int(10) No auto_increment
application_id int(10) No
name varchar(255) utf8_general_ci No
frommonth varchar(10) utf8_general_ci Yes NULL
fromyear varchar(10) utf8_general_ci Yes NULL
tomonth varchar(10) utf8_general_ci Yes NULL
toyear varchar(10) utf8_general_ci Yes NULL
major varchar(255) utf8_general_ci Yes NULL
graduate varchar(10) utf8_general_ci Yes NULL
degree varchar(255) utf8_general_ci Yes NULL
####employer
####0 or more previous employer records are made for each application
id int(10) No auto_increment
application_id int(10) No
name varchar(255) utf8_general_ci No
address varchar(255) utf8_general_ci Yes NULL
city varchar(255) utf8_general_ci Yes NULL
state varchar(255) utf8_general_ci Yes NULL
zip varchar(255) utf8_general_ci Yes NULL
supervisor varchar(255) utf8_general_ci Yes NULL
phone varchar(255) utf8_general_ci Yes NULL
frommonth varchar(10) utf8_general_ci Yes NULL
fromyear varchar(10) utf8_general_ci Yes NULL
tomonth varchar(10) utf8_general_ci Yes NULL
toyear varchar(10) utf8_general_ci Yes NULL
hoursweek varchar(255) utf8_general_ci Yes NULL
title varchar(255) utf8_general_ci Yes NULL
duties longtext utf8_general_ci Yes NULL
salary varchar(255) utf8_general_ci Yes NULL
####submissions
####these are the actual submissions for consideration made to the departments
id int(10) No auto_increment
username varchar(255) utf8_general_ci No
application_id int(10) No
department_id int(10) No
positionappliedfor varchar(255) utf8_general_ci Yes NULL
timestamp timestamp No CURRENT_TIMESTAMP
resume_id int(10) No
cover_id int(10) No
####uploads
####file uploads: resumes and cover letters
id int(10) No auto_increment
username varchar(255) utf8_general_ci No
showflag tinyint(4) No
kind varchar(20) utf8_general_ci No
name varchar(255) utf8_general_ci No
type varchar(255) utf8_general_ci No
size int(10) No
content longblob BINARY No
\ No newline at end of file
<?php
#include our functions and vars
require_once('functions.inc.php');
#SimpleCAS http://code.google.com/p/simplecas/
require_once 'UNL/Auth.php';
$cas_client = UNL_Auth::factory('SimpleCAS');
if (isset($_GET['login'])) {
$cas_client->login();
}
if (isset($_GET['logout'])) {
header("Location: main.php?logout");
exit();
}
if($cas_client->isLoggedIn()){
$current_user = $cas_client->getUser();
#get the current user's application if it exists
$profile = get_users_profile($current_user);
}
?>
<?php
#SUBMIT HAS BEEN PRESSED
if (isset($_POST['submit']) &&
$_POST['student_firstname'] != '' &&
$_POST['student_lastname'] != '' &&
$_POST['student_address'] != '' &&
$_POST['student_city'] != '' &&
$_POST['student_state'] != '' &&
$_POST['student_zip'] != '' &&
$_POST['student_phone'] != '' &&
$_POST['student_email'] != '' &&
$_POST['misdemeanor'] != '' &&
$_POST['felony'] != '' &&
$_POST['courtorder'] != '')
{
/*
* General Information
*/
$appID = add_application( $current_user,
$_POST['student_firstname'],$_POST['student_mi'],$_POST['student_lastname'],
$_POST['student_address'],$_POST['student_city'],$_POST['student_state'],$_POST['student_zip'],
$_POST['student_phone'],$_POST['student_email'],
$_POST['misdemeanor'],$_POST['misdetails'],
$_POST['felony'],$_POST['feldetails'],
$_POST['courtorder'],$_POST['codetails']);
/*
* Employers
*/
foreach ($_POST['employer_name'] as $key => $value) {
//only start to do this if they've entered an employer, some students might not have one to enter
if($value != ""){
add_employer( $appID,
$_POST['employer_name'][$key],$_POST['employer_address'][$key],$_POST['employer_city'][$key],$_POST['employer_state'][$key],$_POST['employer_zip'][$key],
$_POST['employer_supervisor'][$key],$_POST['employer_phone'][$key],
$_POST['employer_fromyear'][$key],$_POST['employer_frommonth'][$key],$_POST['employer_toyear'][$key],$_POST['employer_tomonth'][$key],
$_POST['employer_hoursweek'][$key],$_POST['employer_title'][$key],$_POST['employer_duties'][$key],$_POST['employer_salary'][$key] );
}
}
/*
* Schools
*/
foreach ($_POST['education_name'] as $key => $value) {
//only start to do this if they've entered an education, some students might not have one to enter
if($value != ""){
add_education( $appID,
$_POST['education_name'][$key],$_POST['education_fromyear'][$key],$_POST['education_frommonth'][$key],
$_POST['education_toyear'][$key],$_POST['education_tomonth'][$key],
$_POST['education_major'][$key],$_POST['education_graduate'][$key],$_POST['education_degree'][$key] );
}
}
if(!$profile){
$msg = "Successfully created your application!" ;
header("Location: main.php?msg=$msg&success");
exit();
}else{
$msg = "Successfully edited your application!" ;
header("Location: main.php?msg=$msg&success");
exit();
}
}
?>
<?php
require_once 'UNL/Templates.php';
UNL_Templates::$options['version'] = 3;
$page = UNL_Templates::factory('Document');
$page->navlinks = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/navigation.html'));
$page->breadcrumbs = "<!-- WDN: see glossary item \'breadcrumbs\' --> <ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li><a href=\"".$site_url."\">Student Jobs Application</a></li> <li>Your Application</li></ul>";
$page->doctitle = '<title>UNL | Student Jobs | Your Application</title>';
$page->head = '
<script type="text/javascript">
WDN.jQuery(document).ready(function(){
var employer_content = \''.str_replace("\n", "", displayEmployerForm()).'\';
WDN.jQuery("#wantmoreemployer").click(function(){
WDN.jQuery("#employerinfo").append(employer_content);
WDN.jQuery("#employerinfo fieldset:last-child").hide().fadeIn(1400);
});
var education_content = \''.str_replace("\n", "", displayEducationForm()).'\';
WDN.jQuery("#wantmoreeducation").click(function(){
WDN.jQuery("#educationinfo").append(education_content);
WDN.jQuery("#educationinfo fieldset:last-child").hide().fadeIn(1400);
});
});
</script>
';
$page->addStyleSheet($site_url.'style.css');
$page->addStyleSheet('/wdn/templates_3.0/css/content/forms.css');
$page->titlegraphic = '<h1>Student Jobs</h1>';
$page->pagetitle = '<h2>Your Application</h2>';
$page->maincontentarea = '';
//if they are logged in and have not created an application yet
if ( $cas_client->isLoggedIn() ) {
$page->maincontentarea .= '<div class="three_col left">';
if (isset($_POST['submit'])){
if ($_POST['student_firstname'] == '')
$page->maincontentarea .= '<h3 class="warn">First Name cannot be blank</h3>';
if ($_POST['student_lastname'] == '')
$page->maincontentarea .= '<h3 class="warn">Last Name cannot be blank</h3>';
if ($_POST['student_address'] == '')
$page->maincontentarea .= '<h3 class="warn">Your Address cannot be blank</h3>';
if ($_POST['student_city'] == '')
$page->maincontentarea .= '<h3 class="warn">Your City cannot be blank</h3>';
if ($_POST['student_state'] == '')
$page->maincontentarea .= '<h3 class="warn">Your State cannot be blank</h3>';
if ($_POST['student_zip'] == '')
$page->maincontentarea .= '<h3 class="warn">Your Zip cannot be blank</h3>';
if ($_POST['student_phone'] == '')
$page->maincontentarea .= '<h3 class="warn">Your Phone cannot be blank</h3>';
if ($_POST['student_email'] == '')
$page->maincontentarea .= '<h3 class="warn">Your Email cannot be blank</h3>';
if ($_POST['misdemeanor'] == '' || $_POST['felony'] == '' || $_POST['courtorder'] == '' )
$page->maincontentarea .= '<h3 class="warn">Must check "Yes" or "No" on questions related to criminal background.</h3>';
}
$page->maincontentarea .= '
<form class="cool" method="post" name="add" action="" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="'.$size_bytes.'" />
<div class="two_col left">
<p class="largertext">
Filling out this application only saves it to your profile.<br />
Saving it does not submit it to any employers.<br />
You will choose departments to submit it to on the main page.
</p>
</div>
<div class="col right">
<p class="required">Indicates a required field.</p>
</div>
<div class="clear"></div>
<fieldset>
<legend>General Information</legend>
<ol>
<li>
<label class="element">My.UNL Username</label>
<div class="element" style="margin-top:10px">
'.$current_user.'
</div>
</li>
<li class="required">
<label class="element">First Name</label>
<div class="element">
<input type="text" class="general-textarea" name="student_firstname" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_firstname'], ENT_QUOTES) : $profile['firstname']).'" />
</div>
</li>
<li>
<label class="element">M.I.</label>
<div class="element">
<input type="text" class="general-textarea" name="student_mi" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_mi'], ENT_QUOTES) : $profile['mi']).'" />
</div>
</li>
<li class="required">
<label class="element">Last Name</label>
<div class="element">
<input type="text" class="general-textarea" name="student_lastname" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_lastname'], ENT_QUOTES) : $profile['lastname']).'" />
</div>
</li>
</ol>
<ol>
<li class="required">
<label class="element">Street Address</label>
<div class="element">
<input type="text" class="general-textarea" name="student_address" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_address'], ENT_QUOTES) : $profile['address']).'" />
</div>
</li>
<li class="required">
<label class="element">City</label>
<div class="element">
<input type="text" class="general-textarea" name="student_city" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_city'], ENT_QUOTES) : $profile['city']).'" />
</div>
</li>
<li class="required">
<label class="element">State</label>
<div class="element">
<select name="student_state">
<option value=""></option>
<option value="AL" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"AL") : sel($profile['state'],"AL")).'>Alabama</option>
<option value="AK" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"AK") : sel($profile['state'],"AK")).'>Alaska</option>
<option value="AZ" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"AZ") : sel($profile['state'],"AZ")).'>Arizona</option>
<option value="AR" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"AR") : sel($profile['state'],"AR")).'>Arkansas</option>
<option value="CA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"CA") : sel($profile['state'],"CA")).'>California</option>
<option value="CO" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"CO") : sel($profile['state'],"CO")).'>Colorado</option>
<option value="CT" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"CT") : sel($profile['state'],"CT")).'>Connecticut</option>
<option value="DE" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"DE") : sel($profile['state'],"DE")).'>Delaware</option>
<option value="DC" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"DC") : sel($profile['state'],"DC")).'>District of Columbia</option>
<option value="FL" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"FL") : sel($profile['state'],"FL")).'>Florida</option>
<option value="GA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"GA") : sel($profile['state'],"GA")).'>Georgia</option>
<option value="HI" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"HI") : sel($profile['state'],"HI")).'>Hawaii</option>
<option value="ID" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"ID") : sel($profile['state'],"ID")).'>Idaho</option>
<option value="IL" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"IL") : sel($profile['state'],"IL")).'>Illinois</option>
<option value="IN" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"IN") : sel($profile['state'],"IN")).'>Indiana</option>
<option value="IA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"IA") : sel($profile['state'],"IA")).'>Iowa</option>
<option value="KS" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"KS") : sel($profile['state'],"KS")).'>Kansas</option>
<option value="KY" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"KY") : sel($profile['state'],"KY")).'>Kentucky</option>
<option value="LA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"LA") : sel($profile['state'],"LA")).'>Louisiana</option>
<option value="ME" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"ME") : sel($profile['state'],"ME")).'>Maine</option>
<option value="MD" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MD") : sel($profile['state'],"MD")).'>Maryland</option>
<option value="MA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MA") : sel($profile['state'],"MA")).'>Massachusetts</option>
<option value="MI" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MI") : sel($profile['state'],"MI")).'>Michigan</option>
<option value="MN" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MN") : sel($profile['state'],"MN")).'>Minnesota</option>
<option value="MS" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MS") : sel($profile['state'],"MS")).'>Mississippi</option>
<option value="MO" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MO") : sel($profile['state'],"MO")).'>Missouri</option>
<option value="MT" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"MT") : sel($profile['state'],"MT")).'>Montana</option>
<option value="NE" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NE") : sel($profile['state'],"NE")).'>Nebraska</option>
<option value="NV" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NV") : sel($profile['state'],"NV")).'>Nevada</option>
<option value="NH" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NH") : sel($profile['state'],"NH")).'>New Hampshire</option>
<option value="NJ" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NJ") : sel($profile['state'],"NJ")).'>New Jersey</option>
<option value="NM" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NM") : sel($profile['state'],"NM")).'>New Mexico</option>
<option value="NY" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NY") : sel($profile['state'],"NY")).'>New York</option>
<option value="NC" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"NC") : sel($profile['state'],"NC")).'>North Carolina</option>
<option value="ND" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"ND") : sel($profile['state'],"ND")).'>North Dakota</option>
<option value="OH" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"OH") : sel($profile['state'],"OH")).'>Ohio</option>
<option value="OK" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"OK") : sel($profile['state'],"OK")).'>Oklahoma</option>
<option value="OR" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"OR") : sel($profile['state'],"OR")).'>Oregon</option>
<option value="PA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"PA") : sel($profile['state'],"PA")).'>Pennsylvania</option>
<option value="RI" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"RI") : sel($profile['state'],"RI")).'>Rhode Island</option>
<option value="SC" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"SC") : sel($profile['state'],"SC")).'>South Carolina</option>
<option value="SD" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"SD") : sel($profile['state'],"SD")).'>South Dakota</option>
<option value="TN" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"TN") : sel($profile['state'],"TN")).'>Tennessee</option>
<option value="TX" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"TX") : sel($profile['state'],"TX")).'>Texas</option>
<option value="UT" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"UT") : sel($profile['state'],"UT")).'>Utah</option>
<option value="VT" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"VT") : sel($profile['state'],"VT")).'>Vermont</option>
<option value="VA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"VA") : sel($profile['state'],"VA")).'>Virginia</option>
<option value="WA" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"WA") : sel($profile['state'],"WA")).'>Washington</option>
<option value="WV" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"WV") : sel($profile['state'],"WV")).'>West Virginia</option>
<option value="WI" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"WI") : sel($profile['state'],"WI")).'>Wisconsin</option>
<option value="WY" '.( isset($_POST['submit']) ? sel($_POST['student_state'],"WY") : sel($profile['state'],"WY")).'>Wyoming</option>
</select>
</div>
</li>
<li class="required">
<label class="element">Zip Code</label>
<div class="element">
<input type="text" class="general-textarea" name="student_zip" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_zip'], ENT_QUOTES) : $profile['zip']).'" />
</div>
</li>
</ol>
<ol>
<li class="required">
<label class="element">Phone Number</label>
<div class="element">
<input type="text" class="general-textarea" name="student_phone" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_phone'], ENT_QUOTES) : $profile['phone']).'" />
</div>
</li>
<li class="required">
<label class="element">Email</label>
<div class="element">
<input type="text" class="general-textarea" name="student_email" value="'.( isset($_POST['submit']) ? htmlentities($_POST['student_email'], ENT_QUOTES) : $profile['email']).'" />
</div>
</li>
</ol>
</fieldset>
<div id="employerinfo" class="clear">
<h4 class="sec_header">Previous Employment</h4>
<p>
Include U.S. Armed Forces and Volunteer experiences.<br />
Resumes are accepted (see link on main page to upload) but may <strong>not</strong> be substituted for the following information.<br />
We will conduct references with previous employers.
</p>
';
if(isset($_POST['submit'])) {
foreach ($_POST['employer_name'] as $key => $value) {
if($value != ""){
$page->maincontentarea .= displayEmployerForm( htmlentities($_POST['employer_name'][$key], ENT_QUOTES),
htmlentities($_POST['employer_address'][$key], ENT_QUOTES),
htmlentities($_POST['employer_city'][$key], ENT_QUOTES),
htmlentities($_POST['employer_state'][$key], ENT_QUOTES),
htmlentities($_POST['employer_zip'][$key], ENT_QUOTES),
htmlentities($_POST['employer_supervisor'][$key], ENT_QUOTES),
htmlentities($_POST['employer_phone'][$key], ENT_QUOTES),
htmlentities($_POST['employer_fromyear'][$key], ENT_QUOTES),
htmlentities($_POST['employer_frommonth'][$key], ENT_QUOTES),
htmlentities($_POST['employer_toyear'][$key], ENT_QUOTES),
htmlentities($_POST['employer_tomonth'][$key], ENT_QUOTES),
htmlentities($_POST['employer_hoursweek'][$key], ENT_QUOTES),
htmlentities($_POST['employer_title'][$key], ENT_QUOTES),
htmlentities($_POST['employer_duties'][$key], ENT_QUOTES),
htmlentities($_POST['employer_salary'][$key], ENT_QUOTES)
);
$wehavedisplayedaform = true;
}
}
if($wehavedisplayedaform==false)
$page->maincontentarea .= displayEmployerForm();
}else {
$query = "SELECT * FROM employer WHERE application_id = '" . $profile['id'] . "'";
$result = mysql_query($query);
//this case submit has not been pressed and there are no employers in the DB for this user
if (mysql_num_rows($result) == 0)
$page->maincontentarea .= displayEmployerForm();
//pull the employers out of the DB for this student and display each one
else {
while($row=mysql_fetch_array($result)){
$page->maincontentarea .= displayEmployerForm( $row['name'],
$row['address'],
$row['city'],
$row['state'],
$row['zip'],
$row['supervisor'],
$row['phone'],
$row['fromyear'],
$row['frommonth'],
$row['toyear'],
$row['tomonth'],
$row['hoursweek'],
$row['title'],
$row['duties'],
$row['salary']
);
}
}
}
$page->maincontentarea .= '
</div>
<div class="clear">
<h3 id="wantmoreemployer" class="wantmore">Click Here to Add Another Employer</h3>
</div>
<div id="educationinfo" class="clear">
<h4 class="sec_header">Education Information</h4>
<p>
List post-secondary (post-high school) schools attended.<br />
List your work at UNL, other Universities attended, and any Graduate, Professional, Business, Technical or Military school work.
</p>
';
if(isset($_POST['submit'])) {
foreach ($_POST['education_name'] as $key => $value) {
if($value != ""){
$page->maincontentarea .= displayEducationForm( htmlentities($_POST['education_name'][$key], ENT_QUOTES),
htmlentities($_POST['education_fromyear'][$key], ENT_QUOTES),
htmlentities($_POST['education_frommonth'][$key], ENT_QUOTES),
htmlentities($_POST['education_toyear'][$key], ENT_QUOTES),
htmlentities($_POST['education_tomonth'][$key], ENT_QUOTES),
htmlentities($_POST['education_major'][$key], ENT_QUOTES),
htmlentities($_POST['education_graduate'][$key], ENT_QUOTES),
htmlentities($_POST['education_degree'][$key], ENT_QUOTES)
);
}else{
$page->maincontentarea .= displayEducationForm();
}
}
}else {
$query = "SELECT * FROM education WHERE application_id = '" . $profile['id'] . "'";
$result = mysql_query($query);
//this case submit has not been pressed and there are no employers in the DB for this user
if (mysql_num_rows($result) == 0)
$page->maincontentarea .= displayEducationForm();
//pull the employers out of the DB for this student and display each one
else {
while($row=mysql_fetch_array($result)){
$page->maincontentarea .= displayEducationForm( $row['name'],
$row['fromyear'],
$row['frommonth'],
$row['toyear'],
$row['tomonth'],
$row['major'],
$row['graduate'],
$row['degree']
);
}
}
}
$page->maincontentarea .= '
</div>
<div class="clear">
<h3 id="wantmoreeducation" class="wantmore">Click Here to Add Another School</h3>
</div>
<fieldset>
<legend>Additional Information</legend>