SHOW:
|
|
- or go back to the newest paste.
| 1 | <!DOCTYPE html> | |
| 2 | <html> | |
| 3 | <head> | |
| 4 | <title>Halaman Administrator</title> | |
| 5 | ||
| 6 | <link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css"> | |
| 7 | <link rel="stylesheet" type="text/css" href="../css/costum.css"> | |
| 8 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
| 9 | <script type="text/javascript" src="../jquery/jquery-2.0.2.min.js"></script> | |
| 10 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
| 11 | ||
| 12 | <script type="text/javascript"> | |
| 13 | $(function(){
| |
| 14 | $('.alert').hide();
| |
| 15 | $('.panel-body').submit(function(){
| |
| 16 | $('.alert').hide();
| |
| 17 | if($('input[name=username]').val() == ""){
| |
| 18 | $('.alert').fadeIn().html('Kotak input <b>Username</b> masih kosong!');
| |
| 19 | }else if($('input[name=password]').val() == ""){
| |
| 20 | $('.alert').fadeIn().html('Kotak input <b>Password</b> masih kosong!');
| |
| 21 | }else{
| |
| 22 | $.ajax({
| |
| 23 | type : "POST", | |
| 24 | url : "login_cek.php", | |
| 25 | - | data : $(this).serialize(), |
| 25 | + | data : 'username='+$('input[name=username]').val()+'&password='+$('input[name=password]').val(),
|
| 26 | success : function(data){
| |
| 27 | if(data == "ok") window.location = "index.php"; | |
| 28 | else $('.alert').fadeIn().html(data);
| |
| 29 | } | |
| 30 | }); | |
| 31 | } | |
| 32 | return false; | |
| 33 | }); | |
| 34 | }); | |
| 35 | </script> | |
| 36 | ||
| 37 | </head> | |
| 38 | <body> | |
| 39 | <div class="container" style="margin-top: 100px;"> | |
| 40 | <div class="row"> | |
| 41 | <div class="col-md-4 col-md-offset-4"> | |
| 42 | <div class="alert alert-danger" role="alert"> | |
| 43 | </div> | |
| 44 | <div class="panel panel-default"> | |
| 45 | <h4>login with</h4><br> | |
| 46 | <span><i class="fa fa-facebook"></i></span> | |
| 47 | <span><i class="fa fa-twitter"></i></span> | |
| 48 | <span><i class="fa fa-google-plus"></i></span> | |
| 49 | <br><br> | |
| 50 | <h4>OR</h4><hr> | |
| 51 | <div class="panel-body"> | |
| 52 | ||
| 53 | <form action=""> | |
| 54 | <div class="input-group"> | |
| 55 | <div class="input-group-addon"><i class="glyphicon glyphicon-user"></i></div> | |
| 56 | <input type="text" name="username" placeholder="Username" autofocus class="form-control"> | |
| 57 | </div><br/> | |
| 58 | ||
| 59 | <div class="input-group"> | |
| 60 | <div class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></div> | |
| 61 | <input type="password" name="password" placeholder="Password" class="form-control"> | |
| 62 | </div><br/> | |
| 63 | ||
| 64 | <button class="btn btn-danger pull-right login-button"> | |
| 65 | <i class="glyphicon glyphicon-log-in"></i> Login Administrator | |
| 66 | </button><br/><!--form-group--> | |
| 67 | </form><!--from--> | |
| 68 | </div><!--panel-body--> | |
| 69 | <div class="lock"><i class="fa fa-lock fa-2x"></i></div> | |
| 70 | <div class="label">LOGIN FORM</div> | |
| 71 | <div class="label12"></div> | |
| 72 | </div><!--panel --> | |
| 73 | </div><!--col--> | |
| 74 | </div><!--row--> | |
| 75 | </div> <!--container--> | |
| 76 | </body> | |
| 77 | </html> |