Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
UConnJobSearch/jobs_post.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
194 lines (168 sloc)
6.85 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Authored by Everyone? --> | |
<?php | |
session_start(); | |
if($_POST) | |
{ | |
$connect = mysqli_connect("localhost", "root", '', "databasesproject") or die(mysql_error()); | |
if(!empty($_POST['applybutton'])) | |
{ | |
$jobID = $_GET['jobid']; | |
$UName = $_SESSION['myusername']; | |
$AppID = 0; | |
$date = date('m/d/Y'); | |
$sql = "INSERT INTO applies (JobID, UName, ApplicationID, DateApplied) VALUES (". $jobID .", '".$UName."', ".$AppID.", '".$date."')"; | |
$result = mysqli_query($connect, $sql) or trigger_error($connect->error."[ $sql]"); | |
if($result){ | |
echo "<br><div role='alert' class='alert alert-success'>Application successful!</div>"; | |
} | |
else{ | |
echo '<script type="text/javascript">alert("inserting into applies failed!");</script>'; | |
} | |
} | |
} | |
?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Job Post</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function () { | |
$('div.toshow').fadeIn(2000); | |
// OR $('div.toshow').show(2200); | |
//$('div.toshow').slideDown("slow"); | |
}); | |
</script> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<meta name="description" content="" /> | |
<meta name="copyright" content="" /> | |
<link rel="stylesheet" type="text/css" href="css/kickstart.css" media="all" /> <!-- KICKSTART --> | |
<link rel="stylesheet" type="text/css" href="style.css" media="all" /> <!-- CUSTOM STYLES --> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script type="text/javascript" src="js/kickstart.js"></script> | |
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet"> | |
<link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css"> | |
<link rel="stylesheet" href="jobs_post_formatting.css"> | |
</head> | |
<body> | |
<div class="nav"> | |
<div class="container"> | |
<ul class="pull-left"> | |
<!-- <li><a href=<img><></li> --> | |
<li><a href="http://localhost/UConnJobSearch/index.php">UConnJobSearch</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/about.php">About</a></li> | |
</ul> | |
<ul class="pull-right"> | |
<?php if ($_SESSION): ?> | |
<?php if ($_SESSION['type'] == "Admin"): ?> | |
<li><a href="http://localhost/UConnJobSearch/admin_dashboard.php">Dashboard</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/admin.php">My Account</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/logout.php">Log Out</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/faq.php">Help</a></li> | |
<?php elseif ($_SESSION['type'] == "Poster"): ?> | |
<li><a href="http://localhost/UConnJobSearch/posterDashboard.php">Dashboard</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/poster.php">My Account</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/logout.php">Log Out</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/faq.php">Help</a></li> | |
<?php elseif ($_SESSION['type'] == "Seeker"): ?> | |
<li><a href="http://localhost/UConnJobSearch/dashboard.php">Dashboard</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/seeker.php">My Account</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/logout.php">Log Out</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/faq.php">Help</a></li> | |
<?php endif; ?> <!-- not logged in --> | |
<?php else: header("location:error.php"); ?> | |
<li><a href="http://localhost/UConnJobSearch/register.php">Register</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/login.php">Log In</a></li> | |
<li>|</li> | |
<li><a href="http://localhost/UConnJobSearch/faq.php">Help</a></li> | |
<?php endif; ?> | |
</ul> | |
</div> | |
</div> | |
<?php | |
#echo $_GET['jobid']; | |
$conn = mysqli_connect("localhost", "root", '', "databasesproject") or die(mysql_error()); | |
$jobID = $_GET['jobid']; | |
$sql= "SELECT * FROM job WHERE JobID= '" . $jobID . "'"; | |
$result = mysqli_query($conn, $sql); | |
$row1 = mysqli_fetch_array($result); | |
unset($row1['RFile']); | |
for($x = 0; $x < 5; $x++){ | |
unset($row1[$x]); | |
} | |
$stateID = $row1['StateID']; | |
$sql2= "SELECT * FROM state WHERE StateID= '" . $stateID . "'"; | |
$result2 = mysqli_query($conn, $sql2); | |
$row2 = mysqli_fetch_array($result2); | |
unset($row2['RFile']); | |
for($x = 0; $x < 5; $x++){ | |
unset($row2[$x]); | |
} | |
?> | |
<div class="jumbotron"> | |
<div class="container"> | |
<h1><?php print_r($row1['JobTitle']);?> at <?php print_r($row1['CName']); ?></h1> | |
</div> | |
</div> | |
<div class="grid"> | |
<div class="toshow" style="display:none;"> | |
<div class="col_12"> | |
<div class="col_9"> | |
<h2>Job Information</h2> | |
<p><img class="align-right" src="http://fictitiouscompany.com/images/logo_display.png"/></p> | |
<p> <strong>Company Name: </strong> <?php print_r($row1['CName']); ?></br> | |
<strong>Job Description: </strong><?php print_r($row1['JDuties']); ?></br> | |
<strong>Salary: </strong>$<?php print_r($row1['JLowRange']); echo" - $"; print_r($row1['JHighRange']);?></br> | |
</p> | |
</div> | |
<div class="col_9"> | |
<dd> | |
<h2>Required qualifications</h2> | |
<ul> | |
<strong>Minimum years of experience: </strong> <?php print_r($row1['JYRSExperience']);?> | |
</ul> | |
<h2>Company Location</h2> | |
<ul> | |
<strong>City: </strong><?php print_r($row1['JCity']);?></br> | |
<strong>State: </strong><?php print_r($row2['StateName']);?></br> | |
<strong>Zip Code: </strong><?php print_r($row1['Zipcode']);?></br> | |
<strong>List Date: </strong><?php print_r($row1['JListDate']);?></br> | |
</ul> | |
</dd> | |
</div> | |
<div class = "col_9"> | |
<form action="jobs_post.php?jobid=<?php echo $jobID;?>" method="post"> | |
<input type = "submit" name = "applybutton" value = "Apply Now"> | |
</form> | |
</div> | |
</div> | |
</div> | |
<div class="credits"> | |
<footer> <!-- site wide footer --> | |
<nav> | |
<p><a href="http://localhost/UConnJobSearch/credits.php">Credits</a> | |
<a>|</a> | |
<a href="">Terms of Service</a> | |
<a>|</a> | |
<a herf="">Blog Index</a> | |
</p> | |
</nav> | |
<p>Copyright © 2015 UConn</p> | |
</footer> | |
</div> | |
</div> | |
</body> | |
</html> |