Skip to content
Snippets Groups Projects
Commit 8343e500 authored by Aldrich Valentino Halim's avatar Aldrich Valentino Halim
Browse files

added menu styling for choosing order, history, and profile

parent 71f1e32c
1 merge request!42Projekers - 13515051 - Girvandi Ilyas
......@@ -34,6 +34,10 @@
color: #FFF;
}
.order-wrapper, .history-wrapper {
display: none;
}
.sub-header {
font-size: 0;
margin: 10px 0;
......
-- MySQL dump 10.16 Distrib 10.1.21-MariaDB, for Win32 (AMD64)
-- MySQL dump 10.13 Distrib 5.7.14, for Win64 (x86_64)
--
-- Host: localhost Database: localhost
-- Host: localhost Database: projekers
-- ------------------------------------------------------
-- Server version 10.1.21-MariaDB
-- Server version 5.5.5-10.1.25-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
......@@ -40,6 +40,40 @@ INSERT INTO `pref_loc` VALUES (1,'Tubagus Ismail'),(1,'Dago Asri'),(1,'Kopo');
/*!40000 ALTER TABLE `pref_loc` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `transaction`
--
DROP TABLE IF EXISTS `transaction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `transaction` (
`transaction_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`driver_id` int(11) NOT NULL,
`pickup` varchar(20) NOT NULL,
`destination` varchar(20) NOT NULL,
`rating` int(1) NOT NULL,
`comment` text NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`transaction_id`) USING BTREE,
KEY `user_id` (`user_id`),
KEY `driver_id` (`driver_id`),
CONSTRAINT `transaction_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
CONSTRAINT `transaction_ibfk_2` FOREIGN KEY (`driver_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `transaction`
--
LOCK TABLES `transaction` WRITE;
/*!40000 ALTER TABLE `transaction` DISABLE KEYS */;
INSERT INTO `transaction` VALUES (1,1,2,'Tubagus Ismail','Cisitu',5,'Oke banget','2017-09-01');
/*!40000 ALTER TABLE `transaction` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
......@@ -53,11 +87,11 @@ CREATE TABLE `user` (
`name` varchar(20) NOT NULL,
`email` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
`phone` int(11) NOT NULL,
`phone` varchar(12) NOT NULL,
`isDriver` tinyint(1) NOT NULL,
`image` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -66,7 +100,7 @@ CREATE TABLE `user` (
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'pikachu','Pikachu','pikachu@gmail.com','abc123',812345678,0,'pikachu.jpg');
INSERT INTO `user` VALUES (1,'pikachu','Pikachu','pikachu@gmail.com','abc123','081812341234',0,'pikachu.jpg'),(2,'ratata','Ratata','ratata@gmail.com','12345678','081234563456',1,'ratata.png');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......@@ -79,4 +113,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-09-30 10:55:55
-- Dump completed on 2017-09-30 11:50:40
function order_clicked() {
document.getElementById('history').classList.remove('selected');
document.getElementsByClassName('history-wrapper')[0].style.display = 'none';
document.getElementById('profile').classList.remove('selected');
document.getElementsByClassName('profile-wrapper')[0].style.display = 'none';
document.getElementById('order').classList.add('selected');
document.getElementsByClassName('order-wrapper')[0].style.display = 'block';
}
function history_clicked() {
document.getElementById('profile').classList.remove('selected');
document.getElementsByClassName('profile-wrapper')[0].style.display = 'none';
document.getElementById('order').classList.remove('selected');
document.getElementsByClassName('order-wrapper')[0].style.display = 'none';
document.getElementById('history').classList.add('selected');
document.getElementsByClassName('history-wrapper')[0].style.display = 'block';
}
function profile_clicked() {
document.getElementById('history').classList.remove('selected');
document.getElementsByClassName('history-wrapper')[0].style.display = 'none';
document.getElementById('order').classList.remove('selected');
document.getElementsByClassName('order-wrapper')[0].style.display = 'none';
document.getElementById('profile').classList.add('selected');
document.getElementsByClassName('profile-wrapper')[0].style.display = 'block';
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ function getUserProfile(){
xmlhttp.onreadystatechange = function () {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
var result = xmlhttp.responseXML;
console.log(result);
var username = result.getElementsByTagName('username')[0].childNodes[0].nodeValue;
var name = result.getElementsByTagName('name')[0].childNodes[0].nodeValue;
var email = result.getElementsByTagName('email')[0].childNodes[0].nodeValue;
......
......@@ -3,7 +3,9 @@
<title>User Dashboard</title>
<link href="../css/primary.css" type="text/css" rel="stylesheet" />
<link href="../css/dashboard.css" type="text/css" rel="stylesheet" />
<script src="../js/dashboard.js"></script>
<script src="../js/profile.js"></script>
<script src="../js/history.js"></script>
</head>
<body>
<div class="container">
......@@ -15,33 +17,46 @@
</div>
</div>
<div class="menu">
<button class="submenu" id="order">ORDER</button>
<button class="submenu" id="history">HISTORY</button>
<button class="submenu selected" id="profile" onclick="getUserProfile()">PROFILE</button>
</div>
<div class="sub-header">
<div class="sub-header-heading"><h1>MY PROFILE</h1></div>
<div class="edit-icon"><img src="../img/pencil.png" /></div>
</div>
<div class="user-profile">
<div id="user-image"></div>
<h1 id="profile-username"></h1>
<div id="name"></div>
<div id="driver-stats"></div>
<img src="../img/mail.png" /><div id="email"></div><br />
<img src="../img/phone.png" /><div id="phone"></div><br />
</div>
<div class="sub-header">
<div class="sub-header-heading"><h1>PREFERRED LOCATION</h1></div>
<div class="edit-icon"><img src="../img/pencil.png" /></div>
</div>
<div class="user-location">
<ul type="square" id="user-location">
<li>a</li>
<li>b</li>
<li>c</li>
</ul>
<button class="submenu" id="order" onclick="order_clicked()">ORDER</button>
<button class="submenu" id="history" onclick="history_clicked()">HISTORY</button>
<button class="submenu selected" id="profile" onclick="getUserProfile(); profile_clicked();">PROFILE</button>
</div>
<section class="order-wrapper">
</section>
<section class="history-wrapper">
<div id="content"></div>
<button onclick="getAllTransaction()">get transaction</button>
</section>
<section class="profile-wrapper">
<div class="sub-header">
<div class="sub-header-heading"><h1>MY PROFILE</h1></div>
<div class="edit-icon"><img src="../img/pencil.png" /></div>
</div>
<div class="user-profile">
<div id="user-image"></div>
<h1 id="profile-username"></h1>
<div id="name"></div>
<div id="driver-stats"></div>
<img src="../img/mail.png" /><div id="email"></div><br />
<img src="../img/phone.png" /><div id="phone"></div><br />
</div>
<div class="sub-header">
<div class="sub-header-heading"><h1>PREFERRED LOCATION</h1></div>
<div class="edit-icon"><img src="../img/pencil.png" /></div>
</div>
<div class="user-location">
<ul type="square" id="user-location">
<li>a</li>
<li>b</li>
<li>c</li>
</ul>
</div>
</section>
</div>
</body>
......
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