Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
<!-- Authored by Everyone -->
<!DOCTYPE html>
<html>
<style>
form { width: 1200px; }
input { float: right; width: 250px; }
</style>
<head>
<!-- META -->
<title>Register</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/kickstart.css" media="all" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<!-- Javascript -->
<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>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
$('div.toshow').fadeIn(2000);
//$('div.toshow').show(2000);
//$('div.toshow').slideDown("slow");
});
</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="register_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">
<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>
</ul>
</div>
</div>
<div class="toshow" style="display:none;">
<div class="jumbotron">
<div class="container">
<form>
<div class="row">
<div class="col-md-6">
<h1>Register</h1>
<hr style="height: 1px; color: #008000; width: 100% " />
<h4 style="color: #fff">Account Info</h4><br>
<p style="color: #fff; font-size: 15px">
Username: <input type="text" id="userName" style="color:#000"></input><br><br>
Password: <input type="text" id="password" style="color:#000"></input><br><br>
Confirm Password: <input type="text" id="confirmedPassword" style="color:#000"></input><br><br>
Will Post Jobs: <input type="checkbox" id="isJobPoster" style="color:#000"></input><br><br>
</p>
<hr style="height: 1px; color: #008000; width: 100% " />
<h4 style="color: #fff">Personal Info</h4><br>
<p style="color: #fff; font-size: 15px">
First Name: <input type="text" id="firstName" style="color:#000"></input><br><br>
Last Name: <input type="text" id="lastName" style="color:#000"></input><br><br>
</p>
<hr style="height: 1px; color: #008000; width: 100% " />
<h4 style="color: #fff">Contact Info</h4><br>
<p style="color: #fff; font-size: 15px">
Street Address: <input type="text" id="Address" style="color:#000"></input><br><br>
City: <input type="text" id="City" style="color:#000"></input><br><br>
State: <input type="text" id="State" style="color:#000"></input><br><br>
Zip: <input type="text" id="Zip" style="color:#000"></input><br><br>
Email: <input type="email" id="Email" style="color:#000"></input><br><br>
Phone: <input type="tel" id="Phone" style="color:#000"></input><br><br>
Fax: <input type="tel" id="Fax" style="color:#000"></input><br><br>
</p>
</div>
<div class="col-md-6">
<br><br>
<hr style="height: 1px; color: #008000; width: 100% " />
<h4 style="color: #fff">Required for Job Posters</h4><br>
<p style="color: #fff; font-size: 15px">
Company Name: <input type="text" id="companyName" style="color:#000"></input><br><br>
Company Address: <input type="text" id="companyAddress" style="color:#000"></input><br><br>
City: <input type="text" id="CompanyCity" style="color:#000"></input><br><br>
State: <input type="text" id="CompanyState" style="color:#000"></input><br><br>
Zip: <input type="text" id="CompanyZip" style="color:#000"></input><br><br>
Email: <input type="email" id="CompanyEmail" style="color:#000"></input><br><br>
Phone: <input type="tel" id="CompanyPhone" style="color:#000"></input><br><br>
Fax: <input type="tel" id="CompanyFax" style="color:#000"></input><br><br>
Cell: <input type="tel" id="CompanyCell" style="color:#000"></input><br><br>
Website: <input type="text" id="CompanyWebsite" style="color:#000"></input><br><br>
Will Post Resume: <input type="checkbox" id="isResumePoster"></input><br><br>
</p>
</div>
</div>
<br><br>
</form>
<button class="medium blue" onclick="register()"><i class="fa fa-star"></i> Register</button>
<div id='returnHTML'></div>
<br>
<div class='alert alert-danger' role='alert' id='stateAlert' style='display: none'>You must enter a state!</div>
</div>
</div>
<div class="learn-more">
<div class="container">
<div class="row">
</div>
</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 &#169 2015 UConn</p>
</footer>
</div>
</body>
<head>
<!-- JQuery Reference -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script> <!-- Javascript functions here -->
var q = r = s = t = stateID = "";
var INSERT = 0;
var SELECT = 1;
function query(queryString, whichQ){
$.ajax({
url: "query.php",
data: {
query: queryString
},
type: "POST",
dataType: "html",
success: function (data) {
document.getElementById("returnHTML").innerHTML = data;
if(whichQ == 1){ //-- not a select statement
if(document.getElementById("stateTable")){
stateID = getValueFromQueryTable(data);
runInsert();
}
}
},
error: function (xhr, status) {
alert("There was a problem with the request!");
}
});
}
function getValueFromQueryTable(data){
return ((data.split("<td>")[1]).split("</td>")[0]);
}
function register(){
var state = document.getElementById("State").value;
if((state.length < 3) && (state.length >= 0))
//alert("Please type in the full name of the state!");
$('#stateAlert').show();
else{
$('#stateAlert').hide();
query("SELECT StateID FROM state WHERE state.StateName = '" + state + "';", SELECT);
}
}
function runInsert(){
var UName = document.getElementById("userName").value;
var password = document.getElementById("password").value;
var confirmPassword = document.getElementById("confirmedPassword").value;
var isJobPoster = document.getElementById("isJobPoster").checked;
var fName = document.getElementById("firstName").value;
var lName = document.getElementById("lastName").value;
var address = document.getElementById("Address").value;
var city = document.getElementById("City").value;
var zipCode = document.getElementById("Zip").value;
var email = document.getElementById("Email").value;
var phone = document.getElementById("Phone").value;
var fax = document.getElementById("Fax").value;
q = "INSERT INTO user (UName, UPasswd, UFName, ULName, UStreet1, UStreet2, UCity, StateID, Zipcode, UEmail, UPhone, UFax, UCell, UHomePage, UStatusID) VALUES "
+ "('" + UName + "', '" + password + "', '" + fName + "', '" + lName + "', '" + address + "', '', '" + city + "', "
+ stateID
+ ", '" + zipCode + "', '" + email + "', '" + phone + "', '" + fax + "', '', '', '');";
query(q, INSERT);
r = "INSERT INTO `seeker` (`UName`) VALUES "
+ "('" + UName + "');";
query(r, INSERT);
if(isJobPoster)
{
var companyName = document.getElementById("companyName").value;
var companyAddress = document.getElementById("companyAddress").value;
var companyCity = document.getElementById("CompanyCity").value;
var companyState = document.getElementById("CompanyState").value;
var companyZip = document.getElementById("CompanyZip").value;
var companyEmail = document.getElementById("CompanyEmail").value;
var companyPhone = document.getElementById("CompanyPhone").value;
var companyFax = document.getElementById("CompanyFax").value;
var companyCell = document.getElementById("CompanyCell").value;
var companyWebsite = document.getElementById("CompanyWebsite").value;
s = "INSERT INTO `company` (`CName`, `CStreet1`, `CStreet2`, `CCity`, `StateID`, `Zipcode`, `CEmail`, `CPhone`, `CFax`, `CCell`, `CHomePage`) VALUES "
+ "('" + companyName + "', '" + companyAddress + "', '', '" + companyCity + "', "
+ stateID
+ ", '" + companyZip + "', '" + companyEmail + "', '" + companyPhone + "', '" + companyFax + "', '" + companyCell + "', '" + companyWebsite
+ "');";
query(s, INSERT);
t = "INSERT INTO `poster` (`UName`, `PPosition`, `PContactEmail`, `CName`) VALUES "
+ "('" + UName + "', '', '" + email + "', '" + companyName + "');"; //right now there's no input for poster's position
query(t, INSERT);
}
}
</script>
</head>
</html>