Commit ffaf6a16 authored by Pearl Jen Santos's avatar Pearl Jen Santos

Merge branch 'master' of https://github.com/chiawase/CS123-uBus

parents ab6c9aa0 944bf227
<!DOCTYPE html>
<html>
<head>
<title>uBus | Bus Schedules</title>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.6.min.js"></script>
</head>
<body>
<header>
<nav>
<a href="index.html"><img src="img/logo.png" width="40px"></a>
<a href="javascript:void(0);"><img src="img/add.png" width="40px"></a>
<a href="javascript:void(0);"><img src="img/search.png" width="40px"></a>
</nav>
</header>
<div class="wrapper">
<div class="title">
<img src="img/scheduling.png" width="40px">
<h1>Create Admin Account</h1>
</div>
<div class="card">
<div class="row">
<form method="post" class="card_adminAccount" id="create_adminAccount" style="display:block; margin:0 auto;">
<fieldset>
<label for="addUname"><i class="fa fa-2x fa-user"></i>
<input type="text" id="addUname" placeholder="Username"></label>
</fieldset>
<fieldset>
<label for="addPassword"><i class="fa fa-2x fa-key"></i>
<input type="password" id="addPassword" placeholder="Password">
</label>
</fieldset>
<fieldset>
<label for="addEmail"><i class="fa fa-2x fa-envelope"></i>
<input type="text" id="addEmail" placeholder="admin@example.com">
</label>
</fieldset>
<fieldset>
<label for="addBusCompany"><i class="fa fa-2x fa-bus"></i>
<input type="text" id="addBusCompany" placeholder="Example Lines">
</label>
</fieldset>
<fieldset style="margin-top: 40px;">
<input type="submit">
</fieldset>
</form>
</div>
</div>
<div class="schedules"></div>
</div>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>
......@@ -3,6 +3,10 @@ html, body {
padding: 0;
}
body {
font-family: "Courier New", Courier, monospace;
}
nav {
position: relative;
height: 60px;
......@@ -21,6 +25,14 @@ nav a:first-child {
float: left;
}
nav > h1 {
display: inline-block;
margin: 0;
padding-top: 15px;
padding-left: 15px;
color: #fff;
}
.button {
display: inline-block;
width: 45% !important;
......@@ -75,8 +87,18 @@ nav a:first-child {
left: 0;
}
.row {
position: relative;
}
.card .img-placeholder {
position: absolute;
top: 0;
}
.card form {
display: inline-block;
margin-left: 80px;
width: calc(100% - 80px);
}
......@@ -113,6 +135,23 @@ nav a:first-child {
border-right: 0;
}
.card_adminAccount fieldset {
display: inline-block;
width: 40%;
border: none;
margin-bottom: 20px;
}
.card_adminAccount input[type="text"], .card_adminAccount input[type="password"] {
position: relative;
top: 50%;
transform: translateY(-50%);
margin-left: 15px;
border-top:0;
border-left: 0;
border-right: 0;
}
input[type="text"] {
}
......
......@@ -3,18 +3,24 @@
<head>
<title>uBus | Admin System</title>
<meta name="description" content="uBus Ticket Reservation System administrator tools.">
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.6.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<header>
<nav>
<a href="index.html"><img src="img/logo.png" width="40px"></a>
<h1 style="display:inline-block; margin:0; padding-top:10px; padding-left:15px;">Bus Ticket Reservation System</h1>
<a href="adminAccount.html" style="color:white;padding:15px 20px;"><i class="fa fa-plus fa-2x"></i></a>
<a href="login.html"><i class="fa fa-2x fa-user"></i></a>
</nav>
</header>
<div class="wrapper">
<div class="wrapper" id="parent">
<div class="card button">
<a href="schedule.html" id="admin">
<img src="img/scheduling.png" width="50%">
......
Parse.initialize("waBL5APV9kwdeqnm1kQ34BivGHQjjHQr1I58ubmJ", "01foVLqzLntdIIplsOJCOkfCGTL63wti1rcUlVCD");
var Schedule = Parse.Object.extend("Schedule");
var login = function(){
event.preventDefault();
var uname = document.getElementById("login_uname").value,
pass = document.getElementById("login_pass").value;
Parse.User.logIn(uname, pass, {
success: function(user){
// console.log("success");
window.location = "index.html";
},
error: function(user, error){
console.log("Error " + error.code + " " + error.message);
}
});
}
var logout = function(){
event.preventDefault();
Parse.User.logOut();
location.href="login.html";
}
$('#reload').submit(function(){
$('#reload').submit(function(event){
event.preventDefault();
var cell = document.getElementById("cellphone_number").value,
......@@ -38,7 +57,7 @@ $('#reload').submit(function(){
console.log("Saved.");
},
error: function(error){
console.log("Error " + error);
console.log("Error " + error.code + " " + error.message);
}
});
}
......@@ -52,61 +71,16 @@ $('#reload').submit(function(){
//save
});
$("#create_schedule").submit(function(event){
event.preventDefault();
var destination = document.getElementById("destination").value,
initial = document.getElementById("initial").value,
etd = document.getElementById("etd").value,
eta = document.getElementById("eta").value,
company = document.getElementById("bus_company").value,
plate = document.getElementById("plate_number").value,
seats = document.getElementById("seats_available").value,
fare = document.getElementById("fare").value;
// console.log(typeof "plate");
var newSchedule = new Schedule();
newSchedule.save({
destination:destination,
startingTerminal: initial,
arrival: eta,
departure: etd,
busCompany: company,
busPlate: plate,
seatsAmount: seats,
ticketPrice: fare
}, {
success: function(newSchedule) {
// Execute any logic that should take place after the object is saved.
alert('New object created with objectId: ' + newSchedule.id);
console.log('New object created with objectId: ' + newSchedule.id);
},
error: function(newSchedule, error) {
// Execute any logic that should take place if the save fails.
// error is a Parse.Error with an error code and message.
alert('Failed to create new object, with error code: ' + error.message);
window.onload = function(){
var currentUser = Parse.User.current();
var currLoc = location.href;
if (!currentUser && currLoc.indexOf("login.html") == -1 ) {
location.href = "login.html";
} else {
var parent = document.getElementById("parent");
var outBtn = document.createElement("button");
outBtn.setAttribute("onclick", "logout()");
outBtn.innerHTML = "Logout";
parent.appendChild(outBtn);
}
});
alert(destination);
});
var query = new Parse.Query(Schedule);
var id;
query.find({
success: function(results) {
console.log("Successfully retrieved " + results.length);
// Do something with the returned Parse.Object values
for (var i = 0; i < results.length; i++) {
var object = results[i];
id = object.id;
console.log(object);
}
},
error: function(error) {
status.error("Error: " + error.code + " " + error.message);
}
});
\ No newline at end of file
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>uBus | Bus Schedules</title>
<title>uBus | Loading User Accounts</title>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.6.min.js"></script>
</head>
......
<!DOCTYPE html>
<html>
<head>
<title>uBus | Admin System</title>
<meta name="description" content="uBus Ticket Reservation System administrator tools.">
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.6.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<header>
<nav>
<a href="index.html"><img src="img/logo.png" width="40px"></a>
<h1 style="display:inline-block; margin:0; padding-top:10px; padding-left:15px;">Bus Ticket Reservation System</h1>
<a href="adminAccount.html" style="color:white;padding:15px 20px;"><i class="fa fa-plus fa-2x"></i></a>
<a href="login.html"><i class="fa fa-2x fa-user"></i></a>
</nav>
</header>
<div class="wrapper">
<form method="post" id="adminLogin">
<input type="text" placeholder="Username" id="login_uname">
<input type="password" placeholder="Password" id="login_pass">
<button type="button" onclick="login()">Log-In</button>
</form>
</div>
</body>
</html>
......@@ -4,6 +4,7 @@
<title>uBus | Bus Schedules</title>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.6.min.js"></script>
</head>
......@@ -13,8 +14,8 @@
<nav>
<a href="index.html"><img src="img/logo.png" width="40px"></a>
<a href="javascript:void(0);"><img src="img/add.png" width="40px"></a>
<a href="javascript:void(0);"><img src="img/search.png" width="40px"></a>
<a href="javascript:void(0);"><i class="fa fa-2x fa-plus" style="color:white; padding-top:5px; padding-right:10px;"></i></a>
<a href="javascript:void(0);"><i class="fa fa-2x fa-search" style="color:white; padding-top:5px; padding-right:10px;"></i></a>
</nav>
</header>
......@@ -25,15 +26,15 @@
</div>
<div class="card">
<div class="row">
<img src="img/scheduling.png" width="60px">
<img class="img-placeholder" src="img/scheduling.png" width="60px">
<form method="post" class="card_schedule" id="create_schedule">
<fieldset>
<label for="etd" style="display:block;">Starting Terminal</label>
<input type="text" id="initial" placeholder="hello">
<input type="text" id="initial" placeholder="Current Terminal">
</fieldset>
<fieldset>
<label for="etd" style="display:block;">Destination</label>
<input type="text" id="destination" placeholder="hello">
<input type="text" id="destination" placeholder="End Terminal">
</fieldset>
<fieldset>
<label for="etd" style="display:block;">ETD</label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment