Membuat Website Maskapai menggunakan PHP Native
Jadi sebelum kita membuat Website Maskapai, kita harus membuat struktur databasenya terlebih dahulu, berikut struktur skema database dari e-ticket :
Setelah kita membuat struktur skema database, langsung saja kita membuat bagian Login Page untuk User, berikut tampilan Login Page User :
1. Login Page User :
<?php
include "./core/libcore_backend.php";
$core = new Libcore();
$core->connect();
$msg = '<div class="alert alert-warning p-2"><small>Masuk ke akun anda</small></div>';
if(isset($_POST["user"]) && isset($_POST["pass"])) {
if($core->loginUser($_POST["user"], $_POST["pass"])){
header("Location: index.php");
}
else {
$msg = '<div class="alert alert-danger p-2"><small>Email atau Passsword salah</small></div>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ExecutiveFlight - LOGIN</title>
<link href="./styles/bootstrap.min.css" rel="stylesheet">
<link href="./styles/styles.css" rel="stylesheet">
</head>
<body class="container" style="background-image: url(./image/chamber.jpeg); background-repeat: no-repeat;background-size: cover;">
<center>
<form class=" p-3" action="" style="max-width: 500px;border: 2px solid #eee;border-radius: 10px;margin-top: 25vh;background: rgba(255,255,255,0.8)" method="post">
<center><h3 class="mb-0">ExecutiveFlight</h3></center>
<small class="text-muted">Melayani tujuan penerbangan anda.</small>
<hr>
<?= $msg; ?>
<input class="form-control" placeholder="Email" name="user">
<input class="form-control mt-3" placeholder="Password" name="pass">
<button class="btn btn-success mt-3 w-100">Login</button>
<hr>
<a href="register.php">Klik untuk mendaftar akun</a>
</form>
</center>
</body>
</html>