Skip to content
Snippets Groups Projects
Commit d8ba6020 authored by kukuhbr's avatar kukuhbr
Browse files

ubah index.html jadi index.php | @kukuhbr

parent bc9093f6
Branches
No related merge requests found
<!DOCTYPE html> <?php
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="index.css" />
<title>PR-OJEK: Profile</title>
<script>
var clickedButton = null;
function buttonHighlight(i) {
if(clickedButton != null) {
clickedButton.className = "menu-buttons";
}
clickedButton = document.getElementById(i); echo '
clickedButton.className = "menu-buttons-clicked"; <!DOCTYPE html>
} <html lang="en">
function loadOrderDoc() { <head>
var xhttp; <meta charset="UTF-8">
if(window.XMLHttpRequest) { <link rel="stylesheet" href="index.css" />
xhttp = new XMLHttpRequest(); <title>PR-OJEK: Profile</title>
} else { <script>
xhttp = new ActiveXObject("Microsoft.XMLHTTP"); var clickedButton = null;
} function buttonHighlight(i) {
xhttp.onreadystatechange = function() { if(clickedButton != null) {
if (this.readyState == 4 && this.status == 200) { clickedButton.className = "menu-buttons";
document.getElementById("loadable").innerHTML = }
this.responseText;
clickedButton = document.getElementById(i);
clickedButton.className = "menu-buttons-clicked";
}
function loadOrderDoc() {
var xhttp;
if(window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("loadable").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "orderdestination.php", true);
xhttp.send();
} }
};
xhttp.open("GET", "orderdestination.php", true);
xhttp.send();
}
function loadHistoryDoc() { function loadHistoryDoc() {
var xhttp; var xhttp;
if(window.XMLHttpRequest) { if(window.XMLHttpRequest) {
xhttp = new XMLHttpRequest(); xhttp = new XMLHttpRequest();
} else { } else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP"); xhttp = new ActiveXObject("Microsoft.XMLHTTP");
} }
xhttp.onreadystatechange = function() { xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
document.getElementById("loadable").innerHTML = document.getElementById("loadable").innerHTML =
this.responseText; this.responseText;
}
};
xhttp.open("GET", "history-penumpang.php", true);
xhttp.send();
} }
};
xhttp.open("GET", "history-penumpang.php", true);
xhttp.send();
}
function loadProfileDoc() { function loadProfileDoc() {
var xhttp; var xhttp;
if(window.XMLHttpRequest) { if(window.XMLHttpRequest) {
xhttp = new XMLHttpRequest(); xhttp = new XMLHttpRequest();
} else { } else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP"); xhttp = new ActiveXObject("Microsoft.XMLHTTP");
} }
xhttp.onreadystatechange = function() { xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
document.getElementById("loadable").innerHTML = document.getElementById("loadable").innerHTML =
this.responseText; this.responseText;
}
};
xhttp.open("GET", "profile.php", true);
xhttp.send();
} }
}; </script>
xhttp.open("GET", "profile.php", true); </head>
xhttp.send(); <body>
} <div class="all-wrapper">
</script> <div class="header-wrapper">
</head> <div class="user-logo">
<body> <div class="pr-ojek-logo">
<div class="all-wrapper"> <div class="logo">
<div class="header-wrapper"> <span class="pr">PR</span>-<span class="ojek">OJEK</span>
<div class="user-logo"> </div>
<div class="pr-ojek-logo"> <div class="slogan">
<div class="logo"> wushh... wushh... ngeeeeeenggg...
<span class="pr">PR</span>-<span class="ojek">OJEK</span> </div>
</div>
<div class="user-wrapper">
Hi, <span class="username">bocanhesen</span> ! <br>
<a href="#">Logout</a>
</div>
</div> </div>
<div class="slogan"> <div class="menu-wrapper">
wushh... wushh... ngeeeeeenggg... <button type="button" onclick="loadOrderDoc(); buttonHighlight('order')" id="order" class="menu-buttons">ORDER</button>
<button type="button" onclick="loadHistoryDoc(); buttonHighlight('history')" id="history" class="menu-buttons">HISTORY</button>
<button type="button" onclick="loadProfileDoc(); buttonHighlight('profile')" id="profile" class="menu-buttons">MY PROFILE</button>
</div> </div>
</div> </div>
<div class="user-wrapper">
Hi, <span class="username">bocanhesen</span> ! <br> <div id="loadable" class="loadable">
<a href="#">Logout</a>
</div> </div>
</div> </div>
<div class="menu-wrapper">
<button type="button" onclick="loadOrderDoc(); buttonHighlight('order')" id="order" class="menu-buttons">ORDER</button>
<button type="button" onclick="loadHistoryDoc(); buttonHighlight('history')" id="history" class="menu-buttons">HISTORY</button>
<button type="button" onclick="loadProfileDoc(); buttonHighlight('profile')" id="profile" class="menu-buttons">MY PROFILE</button>
</div>
</div>
<div id="loadable" class="loadable">
</div>
</div>
</body>
</html>
'
</body> ?>
</html> \ No newline at end of file
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<?php
$conn = new mysqli("localhost", "root", "", "projek_db");
$id = $_GET['id_active'];
$sql = "SELECT * FROM users WHERE id='$id' limit 1";
$result = mysqli_query($conn, $sql);
$uname = mysqli_fetch_assoc($result)["uname"];
echo '
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="index.css" />
<title>PR-OJEK: Profile</title>
<script>
var id = '.$id.'
var clickedButton = null;
function buttonHighlight(i) {
if(clickedButton != null) {
clickedButton.className = "menu-buttons";
}
clickedButton = document.getElementById(i);
clickedButton.className = "menu-buttons-clicked";
}
function loadOrderDoc() {
var xhttp;
if(window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("loadable").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "orderdestination.php?id_active="+id, true);
xhttp.send();
}
function loadHistoryDoc() {
var xhttp;
if(window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("loadable").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "history-penumpang.php?id_active="+id, true);
xhttp.send();
}
function loadProfileDoc() {
var xhttp;
if(window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("loadable").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "profile.php?id_active="+id, true);
xhttp.send();
}
</script>
</head>
<body>
<div class="all-wrapper">
<div class="header-wrapper">
<div class="user-logo">
<div class="pr-ojek-logo">
<div class="logo">
<span class="pr">PR</span>-<span class="ojek">OJEK</span>
</div>
<div class="slogan">
wushh... wushh... ngeeeeeenggg...
</div>
</div>
<div class="user-wrapper">
Hi, <span class="username">'.$uname.'</span> ! <br>
<a href="#">Logout</a>
</div>
</div>
<div class="menu-wrapper">
<button type="button" onclick="loadOrderDoc(); buttonHighlight(\'order\')" id="order" class="menu-buttons">ORDER</button>
<button type="button" onclick="loadHistoryDoc(); buttonHighlight(\'history\')" id="history" class="menu-buttons">HISTORY</button>
<button type="button" onclick="loadProfileDoc(); buttonHighlight(\'profile\')" id="profile" class="menu-buttons">MY PROFILE</button>
</div>
</div>
<div id="loadable" class="loadable">
</div>
</div>
</body>
'
?>
</html>
...@@ -60,7 +60,7 @@ if (isset($_POST['submit'])) { ...@@ -60,7 +60,7 @@ if (isset($_POST['submit'])) {
} }
if ($psw === $pswconfirm) { if ($psw === $pswconfirm) {
header("Location: index.html?id_active=". $id); header("Location: index.php?id_active=". $id);
} else { } else {
echo "<script>alert('Wrong password!')</script>"; echo "<script>alert('Wrong password!')</script>";
exit; exit;
......
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