Commit ae5dba5a authored by Ian De La Cruz's avatar Ian De La Cruz

Reworked web-app

-Uses Javascript Promises
-Follows new database design
parent c4b5ff9f
<!-- List all Schedule Times
List all Origin Terminals
List all Destination Terminals
List all Bus Plate of Current Bus Company
List all Bus Types of Current Bus Company -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>uBus | Admin System</title>
<meta charset="utf-8">
<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="js/jquery-2.1.4.js"></script>
<script src="js/parse-1.6.7.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<header class="header">
<a href="index.html" class="header__logo"><img src="img/logo.png" width="40px"></a>
<nav class="header__nav" id="navigation">
<a href=""></a>
<a href=""></a>
</nav>
</header>
<main class="container">
<div class="createTrip card">
<form class="createTrip__form">
<h1 class="createTrip__header">Create Trip</h1>
<label class="createTrip__selectLabel">
<span>Origin: </span>
<select class="createTrip__select" id="selectOrigin">
<option>Hello</option>
</select>
</label>
<label class="createTrip__selectLabel">
<span>Destination: </span>
<select class="createTrip__select" id="selectDestination">
<option>Hello</option>
</select>
</label>
<hr>
<label class="createTrip__selectLabel">
<span>Schedule Code: </span>
<select class="createTrip__select" id="selectSchedule">
<option>Hello</option>
</select>
</label>
<label class="createTrip__information">
<span>Time: </span>
<input type="text" id="scheduleTime" disabled="true" size="10">
<span>Day: </span>
<input type="text" id="scheduleDay" disabled="true" size="10">
</label>
<hr>
<label class="createTrip__selectLabel">
<span>Plate Number: </span>
<select class="createTrip__select" id="selectPlate">
<option>Hello</option>
</select>
</label>
<label class="createTrip__information">
<span>Bus Type: </span>
<input type="text" id="busType" disabled="true" size="10">
</label>
<!-- <label for="cost" class="createTrip__cost">
<span>Costs Per Seat</span>
<input type="text" id="cost">
</label> -->
<label class="createTrip__submit" >
<button id="createTrip__btn">Create Trip</button>
</label>
</form>
</div>
</main>
</body>
</html>
html, body {
margin: 0;
padding: 0;
/*
* Resets
* Typography
* General Style Classes
* → Grid System
* Components
* → Navigation
* → Registration/Login
* → Schedule
* → Adding Credits
*
*
*/
/* Resets */
* {
box-sizing: border-box;
}
body {
font-family: "Courier New", Courier, monospace;
}
nav {
position: relative;
height: 60px;
background-color: #124E78;
html {
font-size: 62.5%;
}
nav a {
display: inline-block;
height: 100%;
padding: 10px;
position: relative;
float:right;
body {
font-size: 1.6em;
margin: 0;
}
nav a:first-child {
float: left;
/* Typography */
body {
font-family: Helvetica, Arial, sans-serif;
}
nav > h1 {
display: inline-block;
margin: 0;
padding-top: 15px;
padding-left: 15px;
color: #fff;
}
.button {
display: inline-block;
width: 45% !important;
text-align:center;
padding: 0 !important;
/* General Style Classes */
.card {
box-shadow:0 1px 2px #aaa;
/*height: 300px;*/
padding: 2rem;
border-radius:3px;
}
.button:first-child {
margin-right: 15px;
/* Components */
.header {
display: block;
width: 100%;
height: 80px;
background-color: #124E78;
}
.button a {
display: block;
width: 100%;
text-decoration: none;
color: black;
}
.button img {
display:block;
width:80%;
margin:0 5% 0 15%;
}
.wrapper {
width: 90%;
.container {
display: block;
width: 80%;
padding-top: 60px;
margin: 0 auto;
padding-top: 20px;
}
.title {
text-align: center;
.login {
display: block;
width: 80%;
margin: 0 auto;
/*-moz-column-count: 2;*/
}
.title h1{
display: inline-block;
.login__form {
display: block;
width: 80%;
margin: 0 auto;
}
.card {
box-shadow:0 1px 2px #aaa;
/*height: 300px;*/
padding: 2rem;
border-radius:3px;
margin: 0 auto;
width: 60%;
}
.login__header {
text-align: center;
}
.card img {
display: inline-block;
position: relative;
top: 0;
left: 0;
.login__uname, .login__pass {
display: block;
width: 50%;
height: 80px;
margin: 0 auto;
}
.row {
position: relative;
.login__uname::before, .login__pass::before {
display: inline-block;
margin-right: 10px;
}
.card .img-placeholder {
position: absolute;
top: 0;
.login__uname input, .login__pass input {
border: 0;
border-bottom: solid 1px;
width: 80%;
margin: 0 auto;
padding: 10px;
}
.card form {
display: inline-block;
margin-left: 80px;
width: calc(100% - 80px);
}
.login__uname input:focus, .login__pass input:focus {
border-bottom-color: #124E78;
border-bottom-width: 2.5px;
}
.card_schedule fieldset {
display: inline-block;
width: 30%;
border:none;
margin-bottom: 20px;
.login__submit {
position: relative;
display: block;
width: 100%;
height: 50px;
}
.card_schedule fieldset input[type="text"], .card_schedule fieldset input[type="datetime-local"] {
font-size: 1em;
border-top:0;
border-left: 0;
border-right: 0;
#login__btn {
position: absolute;
right: 0;
bottom:0;
}
.card_schedule fieldset:nth-child(5) {
width: 80%;
.actionbox__list {
list-style-type: none;
}
.card_schedule fieldset:nth-child(n+6):nth-child(-n+8) {
.tripList {
list-style-type: none;
}
.tripList__item {
display: block;
width: 40%;
width: calc(50% - 10px);
float: left;
}
.card_schedule fieldset:nth-child(n+5):nth-child(-n+8) input[type="text"] {
position: relative;
top: 50%;
transform: translateY(-50%);
margin-left: 10px;
border-top:0;
border-left: 0;
border-right: 0;
.tripList__itemInfo {
display: block;
width: 50%;
float: left;
}
.card_adminAccount fieldset {
display: inline-block;
width: 40%;
border: none;
margin-bottom: 20px;
.createTrip{
display: block;
height: 450px;
padding: 2rem 6rem;
}
.createTrip__selectLabel {
display: inline-block;
width: 45%;
margin-right: 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;
}
.createTrip__selectLabel li:nth-child(4) {
display: block;
}
input[type="text"] {
.createTrip__information {
display: block;
margin-top: 10px;
margin-bottom: 20px;
}
}
.createTrip__information input[type="text"] {
background-color: white;
border: none;
border-bottom: solid 1px;
}
.row {
display: block;
}
\ No newline at end of file
.createTrip hr {
margin: 30px 0;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>uBus | Admin System</title>
<meta charset="utf-8">
<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 type="text/javascript" src="js/jquery-2.1.4.js"></script>
<script src="js/parse-1.6.7.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"style="color:white;"></i></a>
</nav>
</header>
<div id="parent"></div>
<div class="wrapper">
<div class="card button">
<a href="schedule.html" id="admin">
<img src="img/scheduling.png" width="50%">
<br><h3>SCHEDULING</h3>
</a>
</div>
<div class="card button">
<a href="loading.html" id="loading">
<img src="img/loading.png" width="50%">
<br><h3>LOADING</h3>
</a>
</div>
<header class="header">
<a href="index.html" class="header__logo"><img src="img/logo.png" width="40px"></a>
<nav class="header__nav" id="navigation">
<a href=""></a>
<a href=""></a>
</nav>
</header>
<main class="container">
<div class="actionbox card">
<!-- This is not available when user is a Clerk user -->
<h1 class="actionbox__header">Trips Management</h1>
<ul class="actionbox__list">
<li class="actionbox__listitem"><a href="createTrip.html">Create Trips</a></li>
<li class="actionbox__listitem"><a href="viewTrip.html">View All Trips</a></li>
</ul>
</div>
<div class="actionbox card">
<h1 class="actionbox__header">Customer Management</h1>
<ul class="actionbox__list">
<li class="actionbox__listitem"><a href="register.html">Register New User</a></li>
<li class="actionbox__listitem"><a href="reload.html">Reload User Credits</a></li>
</ul>
</div>
<button onclick="app.searchRole()">Print in Console</button>
</main>
</body>
</html>
Parse.initialize("waBL5APV9kwdeqnm1kQ34BivGHQjjHQr1I58ubmJ", "01foVLqzLntdIIplsOJCOkfCGTL63wti1rcUlVCD");
//account key: OSASuXULPMu03QRflj57dfL6TZj579g7y5Wwnd5A
var login = function(){
event.preventDefault();
var uname = document.getElementById("login_uname").value,
pass = document.getElementById("login_pass").value;
console.log(uname + " " + pass);
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);
}
});
}
// Parse.initialize("waBL5APV9kwdeqnm1kQ34BivGHQjjHQr1I58ubmJ", "01foVLqzLntdIIplsOJCOkfCGTL63wti1rcUlVCD");
Parse.initialize("VHNmZxSO2pSrd2KjsjW6a8QUdJYZLFS6Il4WDrQM","s36ClRKw9cXstmvT9Z2L6d5H9CaoUc5V1R9vQ2kP");
var logout = function(){
event.preventDefault();
Parse.User.logOut();
location.href="login.html";
var helper = {
pointerTo : function(objectId, klass) {
return { __type:"Pointer", className:klass, objectId:objectId };
},
appendUsingID : function( parentID, elementName, elementClass, content ) {
var parent = document.getElementById(parentID);
var child = document.createElement(elementName);
child.setAttribute("class", elementClass);
child.innerHTML = content;
parent.appendChild(child);
},
appendUsingObject : function( parentNode, elementName, elementClass, content ) {
return 0;
},
getSelectedOption : function( selectNodeID ){
var origin = document.getElementById( selectNodeID );
var selectedOrigin = origin.options[origin.selectedIndex].text;
return selectedOrigin;
},
getParseObjectID : function( parameter, knownParameterValue, objectName ) {
return new Promise( function(resolve, reject){
var objectQuery = new Parse.Query(objectName);
// var retVal;
objectQuery.equalTo( parameter, knownParameterValue );
objectQuery.find({
success : function(res){
resolve(res[0].id);
},
error : function(err){ console.log(err.code); }
});
})
}
}
var adminSignIn = function(){
event.preventDefault();
var addUname = document.getElementById("addUname").value,
addPassword = document.getElementById("addPassword").value,
addEmail = document.getElementById("addEmail").value,
addBusCompany = document.getElementById("addBusCompany").value;
var user = new Parse.User();
user.set("username", addUname);
user.set("password", addPassword );
user.set("email", addEmail),
user.set("bus_company", addBusCompany);
// other fields can be set just like with Parse.Object
user.signUp(null, {
success: function(user) {
// Hooray! Let them use the app now.
window.location = "index.html";
},
error: function(user, error) {
// Show the error message somewhere and let the user try again.
alert("Error: " + error.code + " " + error.message);
}
});
}
var app = {
login : function(){
event.preventDefault();
var uname = document.getElementById("login_uname").value,
pass = document.getElementById("login_pass").value;
var query = new Parse.Query(Parse.User);
query.equalTo("username", uname);
query.find({
success: function(results){
// console.log(results[0].get("affiliation"));
if(results[0].get("affiliation") != null ){
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);
}
});
} else {
$('#reload').submit(function(event){
event.preventDefault();
}
},
error: function(error){ console.log(error.code); }
});
},
logout : function() {
event.preventDefault();
Parse.User.logOut();
location.href="login.html";
var parent = document.getElementById('navigation');
var btn = document.getElementById("logout");
parent.removeChild(btn);
var cell = document.getElementById("cellphone_number").value,
amt = document.getElementById("amount").value,
intAmt = parseInt(amt),
row = document.getElementById("load_card");
},
searchRole : function(){
var roleQuery = new Parse.Query(Parse.Role);
roleQuery.equalTo("name","Administrator");
roleQuery.find({
success: function(results){
console.log(results[0].getUsers());
},
error: function(error){ console.log(error.code); }
});
},
searchTrip : function(busCompany) {
var tripQuery = new Parse.Query("Trip");
var busQuery = new Parse.Query("Bus_Company");
busQuery.equalTo('companyName', busCompany);
tripQuery.include('origin');
tripQuery.include('destination');
tripQuery.include('assignedBus');
tripQuery.include('assignedSchedule');
tripQuery.include('busCompany');
tripQuery.matchesQuery('busCompany', busQuery);
tripQuery.find({
success : function(results){
var listParent = document.getElementsByClassName("tripList")[0];
for(var i = 0; i < results.length; i++){
var origin = results[i].get("origin").get("location");
var destination = results[i].get("destination").get("location");
var departureTime = results[i].get("assignedSchedule").get("scheduleCode");
var plateNumber = results[i].get("assignedBus").get("plateNumber");
var busType = results[i].get("assignedBus").get("busType");
var listItem = document.createElement("li");
listItem.setAttribute("class", "tripList__item card");
var listItemSpan1 = document.createElement("span");
listItemSpan1.setAttribute("class", "tripList__itemInfo");
listItemSpan1.innerHTML = "Origin: " + origin;
listItem.appendChild(listItemSpan1);
listParent.appendChild(listItem);
var accountDetailDiv = document.createElement("div"),
accountName = document.createElement("p"),
accountAmt = document.createElement("p");
var listItemSpan2 = document.createElement("span");
listItemSpan2.setAttribute("class", "tripList__itemInfo");
listItemSpan2.innerHTML = "Destination: " + destination;
listItem.appendChild(listItemSpan2);
listParent.appendChild(listItem);
var query = new Parse.Query(Parse.User);
query.equalTo("cellPhone", cell);
query.find({
success: function(results){
for (var i = 0; i < results.length; i++) {
var object = results[i];
alert(object.get('load'));
accountNameText = document.createTextNode("Name: " + object.get('username'));
accountAmtText = document.createTextNode("Previous Balance: " + object.get('load'));
accountName.appendChild(accountNameText);
accountAmt.appendChild(accountAmtText);
accountDetailDiv.appendChild(accountName);
accountDetailDiv.appendChild(accountAmt);
row.appendChild(accountDetailDiv);
var intLoad = parseInt(object.get('load'));
var newLoad = intLoad+intAmt;
object.set("load", newLoad.toString());
object.save(null,{
success: function(object){
console.log("Saved.");
},
error: function(error){
console.log("Error " + error.code + " " + error.message);
}
});
}
},
error: function(error){
alert("Could not find account");
}
});
//search for cell number
//update amount value
//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);
}
});
alert(destination);
});
var listItemSpan3 = document.createElement("span");
listItemSpan3.setAttribute("class", "tripList__itemInfo");
listItemSpan3.innerHTML = "Departure: " + departureTime;
listItem.appendChild(listItemSpan3);
listParent.appendChild(listItem);
var listItemSpan4 = document.createElement("span");
listItemSpan4.setAttribute("class", "tripList__itemInfo");
listItemSpan4.innerHTML = "Plate Number: " + plateNumber;
listItem.appendChild(listItemSpan4);
listParent.appendChild(listItem);
var listItemSpan5 = document.createElement("span");
listItemSpan5.setAttribute("class", "tripList__itemInfo");
listItemSpan5.innerHTML = "Bus Type: " + busType;
listItem.appendChild(listItemSpan5);
listParent.appendChild(listItem);
}
},
error : function(error){ console.log(error.code); }
});
},
createTrip : function( currUserAffiliation ) {
// origin, destination, departure, plateNumber, busType, price
// search for id of each parameter
// create a pointer using the helper function
var originTerminal = helper.getSelectedOption("selectOrigin");
var destinationTerminal = helper.getSelectedOption("selectDestination");
var chosenSchedule = helper.getSelectedOption("selectSchedule");
var chosenBus = helper.getSelectedOption("selectPlate");
// console.log(chosenSchedule);
var originPointer, destinationPointer,schedulePointer, busPointer, operatorPointer;
helper.getParseObjectID( "location", originTerminal, "Terminal" )
.then(function(res){
originPointer = helper.pointerTo(res, "Terminal");
return helper.getParseObjectID( "location", destinationTerminal , "Terminal");
})
.catch(function(err){ console.log( "Origin Terminal Error: " + err.code ); })
.then(function(res){
destinationPointer = helper.pointerTo(res, "Terminal");
return helper.getParseObjectID ( "scheduleCode", chosenSchedule, "Schedule" )
})
.catch(function(err){ console.log( "Destination Terminal Error: " + err.code ); })
.then(function(res){
schedulePointer = helper.pointerTo(res, "Schedule");
return helper.getParseObjectID( "plateNumber", chosenBus, "Bus" );
})
.catch(function(err){ console.log( "Schedule Error: " + err.code ); })
.then(function(res){
busPointer = helper.pointerTo(res, "Bus");
})
.catch(function(err){ console.log("Bus Error: " + err.code); })
.then(function(){
var operatorPointer = helper.pointerTo(currUserAffiliation, "Bus_Company");
var Trip = new Parse.Object.extend("Trip");
var trip = new Trip();
trip.set("assignedBus", busPointer);
trip.set("assignedSchedule", schedulePointer);
trip.set("origin", originPointer);
trip.set("destination", destinationPointer);
trip.set("busCompany", operatorPointer);
trip.save()
.then(
function(){
alert("Trip was created successfully.");}
),
function(err){ console.log("An issue popped up. Error code: " + err.code + "was returned by the server."); }
});
// Reset fields
// Add progress screen
},
generateScheduleOptions : function( busCompany, parentNodeID, childClass, key ) {
// To be used in tne onload event
// Search for all schedules that point to specific bus company
// Append to DOM
var skedQuery = new Parse.Query("Schedule");
var busQuery = new Parse.Query("Bus_Company");
busQuery.equalTo('companyName', busCompany);
skedQuery.include("busCompany");
skedQuery.matchesQuery("busCompany", busQuery);
skedQuery.descending("scheduleCode").find({
success : function(res){
for (var i = res.length - 1; i >= 0; i--) {
var content = res[i].get(key);
helper.appendUsingID( parentNodeID, "option", childClass, content );
// when a day is chosen, times are automatically reset to available
// when time is chosen, days are automaticall reset to available
};
},
error : function(error){ console.log(error.code); }
});
},
generateTerminalOptions : function( parentNodeID, childClass ) {
var terminalQuery = new Parse.Query("Terminal");
terminalQuery.descending("location").find({
success : function(res){
for (var i = res.length - 1; i >= 0; i--) {
var content = res[i].get("location");
helper.appendUsingID( parentNodeID, "option", childClass, content );
};
},
error : function(error){ console.log(error.code); }
});
},
generatePlateOptions : function( busCompany, parentNodeID, childClass ) {
var plateQuery = new Parse.Query("Bus");
var busQuery = new Parse.Query("Bus_Company");
busQuery.equalTo("companyName", busCompany);
plateQuery.matchesQuery("operator", busQuery);
plateQuery.include("operator");
plateQuery.find({
success : function(res){
for (var i = res.length - 1; i >= 0; i--) {
var content = res[i].get('plateNumber');
helper.appendUsingID( parentNodeID, "option", "", content );
};
},
error : function(err){ console.log(err.code); }
});
}
};
window.onload = function(){
var currentUser = Parse.User.current();
var currLoc = location.href;
// if(!loggedIn and trying to access index) → go to login
// If(loggedIn) → append logout
var currUserAffiliation = currentUser.get("affiliation").id;
// console.log(currUserAffiliation);
//set affiliation variable
//set role variable → https://www.parse.com/questions/how-to-check-if-a-user-has-a-specific-role
if (!currentUser && currLoc.indexOf("login.html") == -1 ) {
if (currLoc.indexOf("adminAccount.html") == -1){
......@@ -153,21 +272,61 @@ window.onload = function(){
}
} else {
if( currLoc.indexOf("login.html") == -1 && currLoc.indexOf("adminAccount.html") == -1 ) {
var parent = document.getElementById("parent");
var parent = document.getElementById("navigation");
var outBtn = document.createElement("button");
outBtn.setAttribute("onclick", "logout()");
outBtn.setAttribute("id", "logout");
outBtn.setAttribute("onclick", "app.logout()");
outBtn.innerHTML = "Logout";
parent.appendChild(outBtn);
}
}
if (currLoc.indexOf("schedule.html") > -1 && currentUser){
var company = document.getElementById("bus_company");
if( currLoc.indexOf("viewTrip.html") != -1 ){
app.searchTrip(currUserAffiliation);
}
if( currLoc.indexOf("createTrip.html") != -1 ){
app.generateScheduleOptions(currUserAffiliation, "selectSchedule", "", "scheduleCode");
app.generateTerminalOptions("selectOrigin", "");
app.generateTerminalOptions("selectDestination", "");
app.generatePlateOptions(currUserAffiliation, "selectPlate", "");
var scheduleSelect = document.getElementById("selectSchedule");
scheduleSelect.onchange = function(){
var timeOutput = document.getElementById("scheduleTime"),
dayOutput = document.getElementById("scheduleDay"),
value = this.options[this.selectedIndex].text;
var scheduleQuery = new Parse.Query("Schedule");
scheduleQuery.equalTo("scheduleCode", value);
scheduleQuery.first({
success : function(res){
timeOutput.value = res.get("departureTime");
dayOutput.value = res.get("day");
},
error : function(err){ console.log(err.code); }
})
};
var busSelect = document.getElementById("selectPlate");
busSelect.onchange = function(){
var typeOutput = document.getElementById("busType"),
value = this.options[this.selectedIndex].text;
var busQuery = new Parse.Query("Bus");
busQuery.equalTo("plateNumber", value);
busQuery.first({
success : function(res){ typeOutput.value = res.get("busType"); },
error : function(err){ console.log(err.code); }
});
}
var submitBtn = document.getElementById("createTrip__btn");
// submitBtn.onclick = app.createTrip(currUserAffiliation);
submitBtn.addEventListener("click", function(){
event.preventDefault();
app.createTrip(currUserAffiliation);
})
console.log(currentUser.get("bus_company"));
var userCompany = currentUser.get("bus_company");
// console.log(userCompany);
company.value = userCompany;
company.setAttribute("disabled", "true");
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>uBus | Admin System</title>
<meta charset="utf-8">
<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 type="text/javascript" src="js/jquery-2.1.4.js"></script>
<script src="js/parse-1.6.7.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" style="color:white;"></i></a>
</nav>
</header>
<div id="parent"></div>
<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>
<header class="header">
<a href="header__logo"></a>
<nav class="header__nav" id="navigation">
<a href=""></a>
<a href=""></a>
</nav>
</header>
<main class="container">
<div class="login card">
<form class="login__form">
<h1 class="login__header">LOG-IN</h1>
<label class="fa fa-user fa-2x login__uname" >
<input type="text" id="login_uname" placeholder="Username" autofocus></label>
<label class="fa fa-unlock fa-2x login__pass">
<input type="password" id="login_pass" placeholder="Password"></label>
<label class="login__submit" >
<button id="login__btn" onclick="app.login()">Login</button>
</label>
</form>
</div>
</main>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>uBus | Admin System</title>
<meta charset="utf-8">
<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="js/jquery-2.1.4.js"></script>
<script src="js/parse-1.6.7.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<header class="header">
<a href="index.html" class="header__logo"><img src="img/logo.png" width="40px"></a>
<nav class="header__nav" id="navigation">
<a href=""></a>
<a href=""></a>
</nav>
</header>
<main class="container">
<ul class="tripList" id="tripList">
</ul>
</main>
</body>
</html>
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