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

initial commit

parent e175116a
<?php
header("Location: main.php");
exit();
?>
<?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'])) {
$cas_client->logout();
}
if($cas_client->isLoggedIn()){
$current_user = $cas_client->getUser();
#get the current user's mysql record id number from the student table if it exists
$profile = get_users_profile($current_user);
}
$msg = htmlentities(trim($_GET['msg']), ENT_QUOTES);
?>
<?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>Student Jobs Application</li> </ul>";
$page->doctitle = '<title>UNL | Student Jobs </title>';
$page->head = '
';
$page->addStyleSheet($site_url.'style.css');
$page->addStyleSheet('/wdn/templates_3.0/css/content/forms.css');
$page->titlegraphic = '<h1>Student Jobs</h1>';
if(isset($current_user))
$page->pagetitle = '<h2>Welcome, '.$current_user.'</h2>';
else
$page->pagetitle = '<h2>Welcome</h2>';
$page->maincontentarea = '<div class="three_col left">';
if ( $cas_client->isLoggedIn() ) {
if (isset($msg) && $msg !== '' && isset($_GET['success']))
$page->maincontentarea .= '<h3 class="success">'.$msg.'</h3>';
else if (isset($msg) && $msg !== '' && !isset($_GET['success']))
$page->maincontentarea .= '<h3 class="warn">'.$msg.'</h3>';
$page->maincontentarea .= '
<p class="largertext">
Be sure to visit <a href="http://www.unl.edu/careers/">Career Services</a> for info about <a href="http://www.unl.edu/careers/seic/studentjobs.shtml">Student Job Opportunities</a>.
</p>
<br />
';
if(!isset($profile['id'])){
$page->maincontentarea .= '
<div class="wdn_notice mb1" style="cursor:pointer;" onclick="window.open(\'app.php\',\'_self\')">
<div class="message">
<h4><a href="app.php">Create Your Application</a></h4>
<p>Fill out your contact, education, and previous employment information.</p>
</div>
</div>
';
}else{
$page->maincontentarea .= '
<div class="wdn_notice mb1" style="cursor:pointer;" onclick="window.open(\'app.php\',\'_self\')">
<div class="message">
<h4><a href="app.php">Edit Your Application</a></h4>
<p>You\'ve saved your application, now make changes if needed.</p>
</div>
</div>
';
}
if(!isset($profile['id'])){
$page->maincontentarea .= '
<div class="wdn_notice mb2">
<div class="message">
<h4>Upload Your Resume</h4>
<p>Optional but recommended: add a resume file to your application.</p>
</div>
</div>
';
}else{
$query = "SELECT * FROM ".$GLOBALS['mysql_prefix']."uploads WHERE showflag = '1' AND kind = 'resume' AND username = '$current_user' ORDER BY id DESC";
$result = mysql_query($query);
if (mysql_num_rows($result)){
$page->maincontentarea .= '
<div class="wdn_notice mb2" style="cursor:pointer;" onclick="window.open(\'resume.php\',\'_self\')">
<div class="message">
<h4><a href="resume.php">Edit Your Resume</a></h4>
<p>Upload a new resume to replace your existing one.</p>
</div>
</div>
';
}else{
$page->maincontentarea .= '
<div class="wdn_notice mb2" style="cursor:pointer;" onclick="window.open(\'resume.php\',\'_self\')">
<div class="message">
<h4><a href="resume.php">Upload Your Resume</a></h4>
<p>Optional but recommended: add a resume file to your application.</p>
</div>
</div>
';
}
}
if(!isset($profile['id'])){
$page->maincontentarea .= '
<div class="wdn_notice mb3">
<div class="message">
<h4>Submit It</h4>
<p>Choose a department to submit your application to. You can also attach a cover letter.</p>
</div>
</div>
';
}else{
$page->maincontentarea .= '
<div class="wdn_notice mb3" style="cursor:pointer;" onclick="window.open(\'submit.php\',\'_self\')">
<div class="message">
<h4><a href="submit.php">Submit It</a></h4>
<p>Choose a department to submit your application to. You can also attach a cover letter.</p>
</div>
</div>
';
}
$page->maincontentarea .= '
<div class="wdn_notice mb4">
<div class="message">
<h4>Answer Supplemental Questions</h4>
<p>Some departments may have an additional form with specific questions related to that job. Once you complete step 2, you will be linked to this form if neccessary.</p>
</div>
</div>
<br /><br />
<h4 class="sec_header">My Submitted Applications</h4>
<table>
';
$result = mysql_query("SELECT * FROM submissions WHERE username='$current_user' ORDER BY timestamp DESC");
if(mysql_num_rows($result) < 1)
$page->maincontentarea .= '<tr><td>You have not submitted an application for consideration yet.</td></tr>';
while($row=mysql_fetch_array($result)){
//get the row from department table with the dept's info that matches who the applicaiton was submitted to
$deptid = $row['department_id'];
$res = mysql_query("SELECT * FROM department WHERE id='$deptid'");
$row_dept = mysql_fetch_array($res);
$page->maincontentarea .= '
<tr>
<td colspan="3">'.$row_dept["name"].'</td>
</tr>
<tr>
<td width="100">&nbsp;</td>
<td colspan="2">'.$row_dept['address'].'</td>
</tr>
<tr>
<td>&nbsp;</td>
<td width="120">Position:</td>
<td>'.$row['positionappliedfor'].'</td>
</tr>
<tr>
<td>&nbsp;</td>
<td width="120">Application:</td>
<td><a href="view.php?id='.$row['application_id'].'">View</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Resume:</td>
<td>'.display_upload(0,'resume',$row["resume_id"]).'</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Cover Letter:</td>
<td>'.display_upload(0,'cover',$row["cover_id"]).'</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Submitted:</td>
<td>'.$row['timestamp'].'</td>
</tr>
';
}
$page->maincontentarea .= '
</table>
</div>
<div class="col right">
<h4 class="sec_header">Menu</h4>
<ul class="appli_nav">
';
#This displays a link to manage applications for each department that the logged in user is listed as a contact for in the "contacts" table
$result = mysql_query("SELECT * FROM contacts WHERE username='$current_user'");
if(mysql_num_rows($result))
$page->maincontentarea .= 'Applications You Can Review:';
while($row=mysql_fetch_array($result)){
$deptid = $row['department_id'];
$res = mysql_query("SELECT * FROM department WHERE id='$deptid'");
$row_dept = mysql_fetch_array($res);
$page->maincontentarea .= '
<li><a href="manage.php?department_id='.$deptid.'">'.$row_dept["name"].' Applications</a></li>
';
}
if(mysql_num_rows($result))
$page->maincontentarea .= 'Your Own Student Application:';
#the main right hand navigation dependent on whether the user has created an applicaiton yet
if(!isset($profile['id'])){
$page->maincontentarea .= '
<li><a href="app.php">Create Application</a></li>
';
}else{
$page->maincontentarea .= '
<li><a href="app.php">Edit Application</a></li>
<li><a href="resume.php">Your Resume</a></li>
<li><a href="submit.php">Submit Application</a></li>
';
}
$page->maincontentarea .= '
<li><a href="main.php?logout">Logout</a></li>
</ul>
</div>
';
}else {
$page->maincontentarea .= '
<div class="wdn_notice">
<div class="message" style="background-image:url(images/ArrowRight_48.png)">
<h4><a href="main.php?login">Login to Get Started</a></h4>
<p>You will need your My.UNL username and password. (This is the same as your Blackboard account.)</p>
</div>
</div>
<div class="wdn_notice mb1">
<div class="message">
<h4>Create Your Application</h4>
<p>Fill out your contact, education, and previous employment information.</p>
</div>
</div>
<div class="wdn_notice mb2">
<div class="message">
<h4>Upload Your Resume</h4>
<p>Optional but recommended: add a resume file to your application.</p>
</div>
</div>
<div class="wdn_notice mb3">
<div class="message">
<h4>Submit It</h4>
<p>Choose a department to submit your application to. You can also attach a cover letter.</p>
</div>
</div>
<div class="wdn_notice mb4">
<div class="message">
<h4>Answer Supplemental Questions</h4>
<p>Some departments may have an additional form with specific questions related to that job. Once you complete step 2, you will be linked to this form if neccessary.</p>
</div>
</div>
</div>
<div class="col right">
<h4 class="sec_header">Menu</h4>
<ul class="appli_nav">
<li><a href="main.php?login">Login</a></li>
</ul>
</div>
';
}
$page->leftcollinks = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/relatedLinks.html'));
$page->contactinfo = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/footerContactInfo.html'));
$page->footercontent = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/footer.html'));
echo $page;
?>
<?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'])) {
$cas_client->logout();
}
if($cas_client->isLoggedIn()){
$current_user = $cas_client->getUser();
#get the current user's mysql record id number from the student table if it exists
$profile = get_users_profile($current_user);
$current_user_id = $profile['id'];
}
$department_id = $_GET['department_id'];
if(!is_numeric($department_id)){
header("Location: main.php");
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>Manage Applications</li></ul>";
$page->doctitle = '<title>UNL | Student Jobs | Manage Applications</title>';
$page->head = '
';
$page->addStyleSheet($site_url.'style.css');
$page->addStyleSheet('/wdn/templates_3.0/css/content/forms.css');
$page->titlegraphic = '<h1>Student Jobs</h1>';
$result = mysql_query("SELECT * FROM department WHERE id='$department_id'");
$row=mysql_fetch_array($result);
$page->pagetitle = '<h2>Applications Submitted to '.$row["name"].'</h2>';
#Check to see if the current user is allowed to view this department's applications
$result = mysql_query("SELECT * FROM contacts WHERE department_id='$department_id' AND username='$current_user'");
$row=mysql_fetch_array($result);
if ( $cas_client->isLoggedIn() && $row['id']>0 ) {
$page->maincontentarea = '
<div class="three_col left">
For technical assistance contact '.$contact_person.' at <a href="mailto:'.$contact_email.'">'.$contact_email.'</a>
</div>
<div class="col right">
<ul class="appli_nav">
<h4 class="sec_header">Menu</h4>
<li><a href="main.php">Home</a></li>
<li><a href="main.php?logout">Logout</a></li>
</ul>
</div>
<table class="zentable neutral">
<thead>
<tr>
<th>Application</th>
<th>Position</th>
<th>Resume</th>
<th>Cover Letter</th>
<th>Date</th>
</tr>
</thead>
';
$result = mysql_query("SELECT * FROM submissions WHERE department_id='$department_id' ORDER BY timestamp DESC");
while($row=mysql_fetch_array($result)){
$app_id = $row['id'];
$application_id = $row['application_id'];
$res = mysql_query("SELECT * FROM application WHERE id='$application_id'");
$row_student = mysql_fetch_array($res);
$page->maincontentarea .= '
<tr>
<td><a href="view.php?id='.$application_id.'">'.$row_student["firstname"].' '.$row_student["mi"].' '.$row_student["lastname"].'</a></td>
<td>'.$row["positionappliedfor"].'</td>
<td>'.display_upload(0,0,$row['resume_id']).'</td>
<td>'.display_upload(0,0,$row['cover_id']).'</td>
<td>'.$row["timestamp"].'</td>
</tr>
';
}
$page->maincontentarea .= '
</table>
';
}else {
header("Location: main.php");
exit();
}
$page->leftcollinks = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/relatedLinks.html'));
$page->contactinfo = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/footerContactInfo.html'));
$page->footercontent = str_replace('="/', '="http://www.unl.edu/', file_get_contents('http://www.unl.edu/ucomm/sharedcode/footer.html'));
echo $page;
?>
\ 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']) )
{
//not actaully deleting, but changing the showflag from 1 to 0. The user no longer sees their old resumes but we still need them for old apps.
$query = "UPDATE ".$GLOBALS['mysql_prefix']."uploads SET showflag='0' WHERE username = '$current_user'";
$result = mysql_query($query);
//Process the uploads - in this case there's only going to be one- the resume
$error = $_FILES["upFile"]["error"];
if ($error == UPLOAD_ERR_OK) {
$fileName = $_FILES['upFile']['name'];
$tmpName = $_FILES['upFile']['tmp_name'];
$fileSize = $_FILES['upFile']['size'];
$fileType = $_FILES['upFile']['type'];
//check to see if file type is in approved limitedext list
$ext = strrchr($fileName,'.');
if (!in_array(strtolower($ext),$limitedext))
$unapprovedfile = true;
if(!isset($unapprovedfile) && !isset($toobig)){
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
$fileName = sanitize($fileName, "text");
$studentID = $profile['id'];
$query = "INSERT INTO ".$GLOBALS['mysql_prefix']."uploads (name, size, type, content, username, showflag, kind) " .
"VALUES ($fileName, '$fileSize', '$fileType', '$content', '$current_user', '1', 'resume')";
if(!mysql_query($query))
$fail=true;
}
}else if($error == 2)
$toobig = true;
if(!isset($unapprovedfile) && !isset($toobig) && !isset($fail)){
//resume has been added, redirect to main with success message
$msg = "Successfully uploaded your resume!" ;
header("Location: main.php?msg=$msg&success");
exit();
}
}else if(isset($_GET['delete']) && isset($profile['id'])){
//not actaully deleting, but changing the showflag from 1 to 0. The user no longer sees their old resumes but we still need them for old apps.
$query = "UPDATE ".$GLOBALS['mysql_prefix']."uploads SET showflag='0' WHERE username = '$current_user'";
$result = mysql_query($query);
}
?>
<?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 Resume</li></ul>";
$page->doctitle = '<title>UNL | Student Jobs | Your Resume</title>';
$page->head = '
';
$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 Resume</h2>';
$page->maincontentarea = '';
//if they are logged in and have not created an application yet
if ( $cas_client->isLoggedIn() && isset($profile['id']) ) {
$page->maincontentarea .= '<div class="three_col left">';
if (isset($_POST['submit'])){
if (isset($unapprovedfile))
$page->maincontentarea .= '<h3 class="warn">You have tried to upload an unapproved type of file, try again</h3>';
if (isset($fail))
$page->maincontentarea .= '<h3 class="warn">File upload failed, try again</h3>';
if (isset($toobig))
$page->maincontentarea .= '<h3 class="warn">Your upload is too big, max allowed is '.($size_bytes/1048576).' mb</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.'" />
';
$query = "SELECT * FROM ".$GLOBALS['mysql_prefix']."uploads WHERE showflag = '1' AND kind = 'resume' AND username = '$current_user' ORDER BY id DESC";
$result = mysql_query($query);
if (mysql_num_rows($result) > 0){
$page->maincontentarea .= '
<h4>Your Uploaded Resume:</h4>
<h3 class="document" style="width:90%">
<a href="resume.php?delete" title="Click to Delete this File" class="right"><img src="images/Delete.png" style="margin-right:10px" alt="Click here to delete your uploaded resume" /></a>
'.display_upload($current_user, "resume").'
</h3>
';
}
$page->maincontentarea .= '
<div class="clear"></div>
<fieldset>