Advertisement
Guest User

index

a guest
Apr 25th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.27 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <?php session_start();
  3.  
  4.  if(!empty($_SESSION[ 'login_user'] == 1))
  5. {
  6. header( 'Location: penjualan.php');
  7. }
  8. ?>
  9.  
  10.  
  11.  
  12.   <html lang="en">
  13.    
  14.     <head>
  15.       <meta charset="UTF-8" />
  16.       <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
  17.       <title>
  18.         My Site
  19.       </title>
  20.       <link rel="stylesheet" href="css/bootstrap.css"/>
  21.       <link rel="stylesheet" href="css/custom.css"/>
  22.       <script src="js/jquery.min.js">
  23.       </script>
  24.       <script src="js/jquery.ui.shake.js">
  25.       </script>
  26.       <script>
  27.         $(document).ready(function() {
  28.           $('#login').click(function() {
  29.             var username = $("#username").val();
  30.             var password = $("#password").val();
  31.             var dataString = 'username=' + username + '&password=' + password;
  32.             if ($.trim(username).length >= 0 && $.trim(password).length >= 0) {
  33.               $.ajax({
  34.                 type: "POST",
  35.                 url: "cek.php",
  36.                 data: dataString,
  37.                 cache: false,
  38.                 beforeSend: function() {
  39.                   $("#login").val('Loading...');
  40.                 },
  41.                 success: function(data) {
  42.                   if (data['level'] == 1) {
  43.                     $("body").load("penjualan.php").hide().fadeIn(1500).delay(6000);
  44.                   }else if(data['level'] == 2){
  45.                      $("body").load("pembelian.php").hide().fadeIn(1500).delay(6000);
  46.                   }else if(data['level'] == 3){
  47.                      $("body").load("general.php").hide().fadeIn(1500).delay(6000);
  48.                   }else{
  49.                     $('#box').shake();
  50.                     $("#login").val('Login')
  51.                     $("#error").html("<span style='color:#EB242E'>Warning!!</span> username dan password salah. ");
  52.                   }
  53.                 }
  54.               });
  55.             }
  56.             return false;
  57.           });
  58.         });
  59.       </script>
  60.     </head>
  61.    
  62.     <body>
  63.       <div class="container">
  64.         <div id="box" class="">
  65.           <div class="card card-container wella">
  66.             <img id="profile-img" class="profile-img-card" src="images/ava.jpeg" />
  67.             <p id="profile-name" class="profile-name-card">
  68.             </p>
  69.             <form action="" method="post">
  70.               <label>
  71.                 Username
  72.               </label>
  73.               <input type="text" name="username" class="form-control" autocomplete="off" id="username" required/>
  74.               <label>
  75.                 Password
  76.               </label>
  77.               <input type="password" name="password" class="form-control" autocomplete="off" id="password" required/>
  78.               <br/>
  79.               <input type="submit" class="btn btn-lg btn-primary btn-block btn-signin" value="Login" id="login"/>
  80.               <span class='alert'>
  81.               </span>
  82.               <div id="error">
  83.               </div>
  84.             </form>
  85.           </div>
  86.         </div>
  87.       </div>
  88.       <script src="js/jquery.backstretch.js">
  89.       </script>
  90.       <script>
  91.         $.backstretch(["images/1.jpg", "images/2.jpg", "images/3.jpg", "images/4.jpg"], {
  92.           fade: 750,
  93.           duration: 4000
  94.         });
  95.       </script>
  96.     </body>
  97.  
  98.   </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement