Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <?php session_start();
- include 'koneksi.php';
- if (isset($_POST['username']) && isset($_POST['password']))
- {
- $username = mysqli_real_escape_string($conn, $_POST['username']);
- $password = md5(mysqli_real_escape_string($conn, $_POST['password']));
- $result = mysqli_query($conn, "SELECT * FROM tb_user WHERE u_username='$username' and u_password='$password'");
- $count = mysqli_num_rows($result);
- $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
- if($row['level'] == 1){
- $_SESSION['login_user']=$username;
- echo '<script language="javascript">alert("Anda berhasil Login Admin!"); document.location="inventory/index.php";</script>';
- }else if($row['level'] == 2){
- $_SESSION['login_user']=$username;
- echo '<script language="javascript">alert("Anda berhasil Login Admin!"); document.location="pengiriman/index.php";</script>';
- }else if($row['level'] == 3){
- $_SESSION['login_user']=$username;
- echo '<script language="javascript">alert("Anda berhasil Login Admin!"); document.location="general/index.php";</script>';
- }else
- {
- echo '<script language="javascript">alert("Maaf Username Password anda salah!"); document.location="index.php";</script>';
- }
- } ?>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
- <title>
- My Site
- </title>
- <link rel="stylesheet" href="css/bootstrap.css"/>
- <link rel="stylesheet" href="css/custom.css"/>
- <script src="js/jquery.min.js">
- </script>
- <script src="js/jquery.ui.shake.js">
- </script>
- <script>
- </script>
- </head>
- <body>
- <div class="container">
- <div id="box" class="">
- <div class="card card-container wella">
- <div align="center">
- <h4>Application Inventory</h4>
- <img id="profile-img" class="" src="images/perhutani.png" width="50px" height="50px" align="center" />
- </div>
- <p id="profile-name" class="profile-name-card">
- </p>
- <form action="" method="post">
- <label>
- Username
- </label>
- <input type="text" name="username" class="form-control" autocomplete="off" id="username" required/>
- <label>
- Password
- </label>
- <input type="password" name="password" class="form-control" autocomplete="off" id="password" required/>
- <br/>
- <input type="submit" class="btn btn-lg btn-primary btn-block btn-signin" value="Login" id="login"/>
- <span class='alert'>
- </span>
- <div id="error">
- </div>
- </form>
- </div>
- </div>
- </div>
- <script src="js/jquery.backstretch.js">
- </script>
- <script>
- $.backstretch(["images/1.jpg", "images/2.jpg", "images/3.jpg", "images/4.jpg"], {
- fade: 750,
- duration: 4000
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement