edgarrizki

index.php

Jan 15th, 2020
159
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.         <?php
  3.         session_start();
  4.         if($_SESSION) {
  5.             header("location: user.php") ;
  6.         }
  7.  
  8.         ?>
  9.  
  10.  
  11.         <!DOCTYPE HTML>
  12.         <html lang="en">
  13.         <head>
  14.         <title>HOM</title>
  15.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  16.         <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
  17.         <meta name="theme-color" content="#EA4C89">
  18.         <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  19.  
  20.         <link rel='manifest' href='manifest.json'>
  21.  
  22.         <link rel="icon" type="image/png" href="images/splash/android-chrome-192x192.png" sizes="192x192">
  23.         <link rel="apple-touch-icon" sizes="196x196" href="images/splash/apple-touch-icon-196x196.png">
  24.         <link rel="apple-touch-icon" sizes="180x180" href="images/splash/apple-touch-icon-180x180.png">
  25.         <link rel="apple-touch-icon" sizes="152x152" href="images/splash/apple-touch-icon-152x152.png">
  26.         <link rel="apple-touch-icon" sizes="144x144" href="images/splash/apple-touch-icon-144x144.png">
  27.         <link rel="apple-touch-icon" sizes="120x120" href="images/splash/apple-touch-icon-120x120.png">
  28.         <link rel="apple-touch-icon" sizes="114x114" href="images/splash/apple-touch-icon-114x114.png">
  29.         <link rel="apple-touch-icon" sizes="76x76" href="images/splash/apple-touch-icon-76x76.png">
  30.         <link rel="apple-touch-icon" sizes="72x72" href="images/splash/apple-touch-icon-72x72.png">
  31.         <link rel="apple-touch-icon" sizes="60x60" href="images/splash/apple-touch-icon-60x60.png">
  32.         <link rel="apple-touch-icon" sizes="57x57" href="images/splash/apple-touch-icon-57x57.png">
  33.         <link rel="icon" type="image/png" href="images/splash/favicon-96x96.png" sizes="96x96">
  34.         <link rel="icon" type="image/png" href="images/splash/favicon-32x32.png" sizes="32x32">
  35.         <link rel="icon" type="image/png" href="images/splash/favicon-16x16.png" sizes="16x16">
  36.         <link rel="shortcut icon" href="images/splash/favicon-32x32.png" type="image/x-icon" />
  37.  
  38.         <link rel="stylesheet" type="text/css" href="styles/style.css">
  39.         <link rel="stylesheet" type="text/css" href="fonts/css/all.css">
  40.         <link rel="stylesheet" type="text/css" href="styles/framework.css">
  41.         <link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i" rel="stylesheet">
  42.         </head>
  43.         <body>
  44.  
  45.  
  46.         <div id="page-transitions-login">
  47.         <div class="page-content page-content-full">
  48.  
  49.         <div class="cover-item cover-item-full">
  50.         <div class="cover-content cover-content-center">
  51.         <form action="" method="POST">
  52.         <div class="page-login content-boxed content-boxed-padding top-0 bottom-0 bg-white">
  53.         <h2 class=" ultrabold top-20 bottom-0 center-text color-pink">House Of Mom n jo</h2>
  54.                
  55.  
  56.         <?php
  57.             if(isset($_POST['login'])){
  58.                 include("koneksi.php");
  59.                 $nama_gerai     = $_POST['nama_gerai'];
  60.                 $password       = md5($_POST['password']);
  61.                 $id_gerai       = $_POST['id_gerai'];
  62.                 $query = mysqli_query($koneksi, "SELECT * FROM is_gerai WHERE nama_gerai ='$nama_gerai' AND password='$password'");
  63.                 if(mysqli_num_rows($query) == 0){
  64.                     echo '<div class="alert alert-danger"> Login gagal.</div>';
  65.                 }else{
  66.                     $row = mysqli_fetch_assoc($query);
  67.                        
  68.                     if($row['id_gerai'] == GR001 && $id_gerai == GR001){
  69.                         $_SESSION['nama_gerai']=$nama_gerai;
  70.                         $_SESSION['id_gerai']='Darmawangsa';
  71.                         header("Location: home.php");
  72.  
  73.                     }else if($row['id_gerai'] == GR002 && $id_gerai == GR002){
  74.                         $_SESSION['nama_gerai']=$nama_gerai;
  75.                         $_SESSION['id_gerai']='GreenLake';
  76.                         header("Location: home.php");
  77.  
  78.                    
  79.                     }else if ($row['id_gerai'] == GR003 && $id_gerai == GR003){
  80.                         $_SESSION['nama_gerai'] = $nama_gerai;
  81.                         $_SESSION['id_gerai'] = 'Bintaro';
  82.                         header("Location: home.php");
  83.  
  84.  
  85.                     }else if($row['id_gerai'] == GR004 && $id_gerai == GR004){
  86.                         $_SESSION['nama_gerai']=$nama_gerai;
  87.                         $_SESSION['id_gerai']='Bandung';
  88.                         header("Location: home.php");
  89.  
  90.                     }else{
  91.                         echo '<div class="alert alert-danger">Upss...!!! Login gagal.</div>';
  92.  
  93.  
  94.                     }
  95.                     }
  96.                     }
  97.                     ?>
  98.  
  99.                
  100.                     <div class="page-login-field top-30">
  101.                     <!--<em>Pilih Gerai</em>-->
  102.                     <i class="fa fa-store color-blue-dark"></i>
  103.                     <select name="nama_gerai" required>
  104.                     <option value="">Pilih Gerai</option>
  105.  
  106.                     <option value="GR001">Darmawangsa</option>
  107.                     <option value="GR002">Greenlake</option>
  108.                     <option value="GR003">Bintaro</option>
  109.                     <option value="1">Galaxy</option>
  110.                     <option value="1">Bintaro Arcade</option>
  111.                     <option value="1">Bandung</option>
  112.                     <option value="2">FX</option>
  113.                     <option value="2">PIK</option>
  114.                     <option value="2">Gading Serpong</option>
  115.                     <option value="2">Rawamangun</option>
  116.                     <option value="2">Cibubur</option>
  117.                     <option value="2">Kalimalang</option>
  118.                     <option value="2">Kemayoran</option>
  119.                     <option value="2">Harapan Indah</option>
  120.                     <option value="2">Batam</option>
  121.  
  122.                     <option value="3">BSD</option>
  123.                     <option value="3">MOI</option>
  124.  
  125.                     <option value="4">Medan</option>
  126.                     <option value="4">Pekanbaru</option>
  127.  
  128.                     <option value="5">Bali</option>
  129.                     <option value="5">Cirebon</option>
  130.                                        
  131.                     <option value="6">Surabaya</option>
  132.                     </select>
  133.                     </div>
  134.  
  135.         <div class="page-login-field bottom-10">
  136.         <i class="fa fa-lock color-blue-dark"></i>
  137.         <input name="password" type="password" placeholder="Password" required>
  138.         </div>
  139.  
  140.                
  141.  
  142.         <button name="btn_login" type="submit" class="button button-full button-l button-round button-pink button-red-3d ultrabold">Login</button>
  143.         </div>
  144.         </form>
  145.  
  146.         </div>
  147.         <!--<div class="cover-item cover-item-full" style="background-image:url(images/bg/bg2.jpg);"></div>-->
  148.         <div class="cover-overlay overlay bg-pink opacity-100"></div>
  149.         </div>
  150.  
  151.         </div>
  152.         </div>
  153.  
  154.         <script type="text/javascript" src="scripts/jquery.js" defer></script>
  155.         <script type="text/javascript" src="scripts/plugins.js" defer></script>
  156.         <script type="text/javascript" src="scripts/custom.js" defer></script>
  157.  
  158.  
  159.         </body></html>
RAW Paste Data