Skip to content
Snippets Groups Projects
Commit cc810201 authored by adyanf's avatar adyanf
Browse files

adding ajax functionality with dummy php handler

parent 9ee26f93
No related merge requests found
......@@ -111,7 +111,8 @@ body {
}
.form-signup .form-group {
margin-bottom: 3px;
margin-bottom: 3px;
display: flex;
}
.form-signup .form-group label {
......@@ -129,6 +130,14 @@ body {
padding-left: 10px;
}
.form-signup .form-group input#username, .form-signup .form-group input#email {
width: 47%;
}
.form-signup .form-group span {
display: none;
}
.form-signup input[type=checkbox] {
margin-top: 15px;
}
......
......@@ -198,7 +198,7 @@ th, td {
height: 25px;
}
td {
td:nth-of-type(2n-1) {
padding-left: 10px;
}
......@@ -236,4 +236,33 @@ td {
border: 1px solid black;
font-family: 'Roboto', sans-serif;
text-decoration: none;
}
.data-location td input {
font-size: 1em;
border: 0;
width: 100%;
padding: 5px 10px;
margin: 0px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
background: inherit;
}
.data-location .edit {
color: orange;
float: left;
cursor: pointer;
margin-left: 3px;
margin-top: 2px;
}
.data-location .delete {
color: red;
font-weight: bold;
float: right;
margin-right: 10px;
cursor: pointer;
margin-top: 2px;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Edit Profile</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/profile.css">
</head>
<body>
<div class="apps">
<div class="heading">
<h2>EDIT PREFERRED LOCATIONS</h2>
</div>
<table border="1" class="data-location">
<thead>
<tr>
<th>No</th>
<th>Location</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Pewter City</td>
<td>&#x270f;</td>
</tr>
<tr>
<td>2</td>
<td>Saffron City</td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>SkyPillar City</td>
<td></td>
</tr>
</tbody>
</table>
<div class="add-location">
<h3>ADD NEW LOCATION</h3>
<form action="">
<input type="text" name="place" required>
<input type="submit" value="ADD">
</form>
</div>
<div class="back">
<a href="#">BACK</a>
</div>
</div>
<script src="js/profile.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Edit Profile</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/profile.css">
</head>
<body>
<div class="apps">
<div class="heading">
<h3>EDIT PROFILE INFORMATION</h3>
</div>
<div class="edit-img">
<div class="profile-img">
<img src="img/profile-placeholder.png" alt="profile image" class="thumbnail">
</div>
<div class="update-img">
<h4>Update profile picture</h4>
<input id="uploadFile" type="text" disabled="disabled">
<div class="fileUpload">
<span>Browse...</span>
<input id="uploadBtn" type="file" class="upload">
</div>
</div>
</div>
<div class="edit-data">
<div class="form-group">
<label for="name">Your Name</label>
<input id="name" type="text" name="name" placeholder="your name" required>
</div>
<div class="form-group">
<label for="phone">Phone</label>
<input id="phone" type="text" name="phone" placeholder="your phone" required>
</div>
<div class="form-group">
<label for="driver">Status Driver</label>
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
<div class="submit">
<input type="submit" class="cancel" value="BACK">
<input type="submit" class="save" value="SAVE">
</div>
</div>
</div>
<script src="js/profile.js"></script>
</body>
</html>
function getUsernameValidation(){
var xmlhttp = new XMLHttpRequest();
if(!xmlhttp){
return;
}
var username = document.getElementById("username");
console.log(username);
var url = "validation.php?u=" + username.value;
console.log(url);
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
var response = xmlhttp.responseText;
console.log(response);
if(response === "true"){
document.getElementById("checkUsername").style.display = "block";
}
else {
document.getElementById("checkUsername").style.display = "none";
}
}
}
xmlhttp.send();
}
function getEmailValidation(){
var xmlhttp = new XMLHttpRequest();
if(!xmlhttp){
return;
}
var email = document.getElementById("email");
console.log(email);
var url = "validation.php?e=" + email.value;
console.log(url);
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
var response = xmlhttp.responseText;
console.log(response);
if(response === "true"){
document.getElementById("checkEmail").style.display = "block";
}
else {
document.getElementById("checkEmail").style.display = "none";
}
}
}
xmlhttp.send();
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Halaman Login</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/auth.css">
</head>
<body>
<div class="apps">
<div class="form-heading">
<div class="heading-left">
<hr>
</div>
<div class="heading-title">
LOGIN
</div>
<div class="heading-right">
<hr>
</div>
</div>
<div class="form-login">
<form action="login.php" method="POST">
<div class="form-group">
<label for="username">Username </label>
<input id="username" type="text" name="username" placeholder="your username" required>
</div>
<div class="form-group">
<label for="password">Password </label>
<input id="password" type="password" name="password" placeholder="your password" pattern=".{5,10}" title="5 to 10 characters" required>
</div>
<div class="action">
<div class="register">
<a href="#">Don't have an account ?</a>
</div>
<div class="submit">
<input type="submit" value="GO!">
</div>
</div>
</form>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Halaman Signup</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/auth.css">
</head>
<body>
<div class="apps">
<div class="form-heading">
<div class="heading-left">
<hr>
</div>
<div class="heading-title">
SIGNUP
</div>
<div class="heading-right">
<hr>
</div>
</div>
<div class="form-signup">
<form action="register.php" method="POST">
<div class="form-group">
<label for="name">Your Name</label>
<input id="name" type="text" name="name" placeholder="your name" required>
</div>
<div class="form-group">
<label for="username">Username</label>
<input id="username" type="text" name="username" placeholder="your username" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input id="email" type="text" name="email" placeholder="your email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input id="password" type="password" name="password" placeholder="your password" pattern=".{5,10}" title="5 to 10 characters" required>
</div>
<div class="form-group">
<label for="password_conf">Password Confirm</label>
<input id="password_conf" type="password" name="password_conf" placeholder="your password again" pattern=".{5,10}" title="5 to 10 characters" required>
</div>
<div class="form-group">
<label for="phone">Phone Number</label>
<input id="phone" type="text" name="phone" placeholder="your phone" required>
</div>
<input type="checkbox" name="driver" value="True"> Also sign me up as a driver!
<div class="action">
<div class="login">
<a href="#">Already have an account ?</a>
</div>
<div class="submit">
<input type="submit" value="REGISTER">
</div>
</div>
</form>
</div>
</div>
</body>
</html>
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