Advertisement
Guest User

Untitled

a guest
May 20th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.42 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  6.     <meta http-equiv="x-ua-compatible" content="ie=edge">
  7.     <title>TokoSosmed</title>
  8.  
  9.     <link href="img/favicon.144x144.html" rel="apple-touch-icon" type="image/png" sizes="144x144">
  10.     <link href="img/favicon.114x114.html" rel="apple-touch-icon" type="image/png" sizes="114x114">
  11.     <link href="img/favicon.72x72.html" rel="apple-touch-icon" type="image/png" sizes="72x72">
  12.     <link href="img/favicon.57x57.html" rel="apple-touch-icon" type="image/png">
  13.     <link href="img/favicon.html" rel="icon" type="image/png">
  14.     <link href="img/favicon-2.html" rel="shortcut icon">
  15.  
  16.     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  17.     <!--[if lt IE 9]>
  18.     <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  19.     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  20.     <![endif]-->
  21.     <link rel="stylesheet" href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css">
  22.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  23.     <link rel="stylesheet" href="css/main.css">
  24.     <link rel="stylesheet" href="css/lib/bootstrap-sweetalert/sweetalert.css"/>
  25. </head>
  26. <body>
  27.  
  28.     <div class="page-center">
  29.         <div class="page-center-in">
  30.             <div class="container-fluid" id="blockui-element-container-dark">
  31.                 <div class="sign-box">
  32.                     <div class="sign-avatar">
  33.                         <img src="img/avatar-sign.png" alt="">
  34.                     </div>
  35.                     <header class="sign-title">Login</header>
  36.                     <div class="form-group">
  37.                         <input type="text" class="form-control" id="emailorusername" placeholder="E-Mail atau Username"/>
  38.                     </div>
  39.                     <div class="form-group">
  40.                         <input type="password" class="form-control" id="password" placeholder="Password"/>
  41.                     </div>
  42.                     <div class="form-group">
  43.                         <div class="float-right reset">
  44.                             <a href="#">Reset Password</a>
  45.                         </div>
  46.                     </div>
  47.                     <div class="login">
  48.                         <button type="submit" class="btn btn-rounded">Login</button>
  49.                     </div>
  50.                     <!--<button type="button" class="close">
  51.                         <span aria-hidden="true">&times;</span>
  52.                     </button>-->
  53.                 </div>
  54.             </div>
  55.         </div>
  56.     </div><!--.page-center-->
  57.  
  58. <script src="js/app.js"></script>
  59. <script src="js/lib/jquery/jquery.min.js"></script>
  60. <script src="js/lib/tether/tether.min.js"></script>
  61. <script src="js/lib/bootstrap/bootstrap.min.js"></script>
  62. <script src="js/plugins.js"></script>
  63. <script type="text/javascript" src="js/lib/blockUI/jquery.blockUI.js"></script>
  64. <script src="js/lib/bootstrap-sweetalert/sweetalert.min.js"></script>
  65. <script type="text/javascript">
  66. $(function() {
  67.     $(".login > button").click(function(x) {
  68.         $.ajax({
  69.             url: 'check.php',
  70.             data: {
  71.                 emailorusername: $(this).parent().parent().find("#emailorusername").val(),
  72.                 password: $(this).parent().parent().find("#password").val(),
  73.             },
  74.             type: 'POST',
  75.             dataType: 'json',
  76.             beforeSend: function() {
  77.                 $('#blockui-element-container-dark').block({
  78.                     message: '<div class="blockui-default-message"><i class="fa fa-circle-o-notch fa-spin"></i><h6>Please Wait</h6></div>',
  79.                     overlayCSS: {
  80.                         background: 'rgba(24, 44, 68, 0.8)',
  81.                         opacity: 1,
  82.                         cursor: 'wait'
  83.                     },
  84.                     css: {
  85.                         width: '50%'
  86.                     },
  87.                     blockMsgClass: 'block-msg-default'
  88.                 });
  89.             },
  90.             complete: function() {
  91.                 $('#blockui-element-container-dark').unblock()
  92.             },
  93.             success: function(e) {
  94.                 var hasil = e;
  95.                 x.preventDefault();
  96.                 if (hasil.result == 200) {
  97.                     swal({
  98.                         title: "Login Berhasil!",
  99.                         text: hasil.reason,
  100.                         type: "success",
  101.                         successButtonClass: "btn-danger",
  102.                         successButtonText: "Cancel"
  103.                     });
  104.                     window.location = "index.php";
  105.                 } else {
  106.                     swal({
  107.                         title: "Error!",
  108.                         text: hasil.reason,
  109.                         type: "error",
  110.                         successButtonClass: "btn-danger",
  111.                         successButtonText: "Cancel"
  112.                     });
  113.                 }
  114.             },
  115.             error: function() {
  116.                 swal({
  117.                     title: "Error!",
  118.                     text: "Terjadi kesalahan! Silahkan refresh halaman!",
  119.                     type: "error",
  120.                     successButtonClass: "btn-danger",
  121.                     successButtonText: "Cancel"
  122.                 });
  123.             }
  124.         });
  125.     });
  126. });
  127. </script>
  128. </body>
  129. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement