Advertisement
syari

loginfirst.php

May 5th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.44 KB | None | 0 0
  1. <?php include('header.php'); ?>
  2.   <body id="login">
  3.     <div class="container">
  4.     <?php include('navbar_index.php'); ?>
  5.     <center><img src="images/banner.png" class="img-polaroid"></center>
  6.     <form id="login_form" class="form-signin" method="post">
  7.         <h3 class="form-signin-heading"><i class="icon-lock"></i> Please Login</h3>
  8.         <input type="text" class="input-block-level" id="usernmae" name="username" placeholder="Username" required>
  9.         <input type="password" class="input-block-level" id="password" name="password" placeholder="Password" required>
  10.         <button data-placement="top" title="Click to Login" id="login1" name="login" class="btn btn-success" type="submit"><i class="icon-signin icon-large"></i> Sign in</button>
  11.                                     <script type="text/javascript">
  12.                                         $(document).ready(function(){
  13.                                             $('#login1').tooltip('show');
  14.                                             $('#login1').tooltip('hide');
  15.                                         });
  16.                                     </script>
  17.     </form>
  18.                                     <script>
  19.                                                 jQuery(document).ready(function(){
  20.                                                 jQuery("#login_form").submit(function(e){
  21.                                                         e.preventDefault();
  22.                                                         var formData = jQuery(this).serialize();
  23.                                                         $.ajax({
  24.                                                             type: "POST",
  25.                                                             url: "login.php",
  26.                                                             data: formData,
  27.                                                             success: function(html){
  28.                                                             if(html=='true')
  29.                                                             {
  30.                                                                 $.jGrowl("Loading Please Wait......", { sticky: true });
  31.                                                                 $.jGrowl("Welcome to Medical Requirement Management System", { header: 'Access Granted' });
  32.                                                             var delay = 1000;
  33.                                                                 setTimeout(function(){ window.location = 'staff_login.php'  }, delay);  
  34.                                                             }
  35.                                                             else if (html == 'true_user'){
  36.                                                                 $.jGrowl("Loading Please Wait......", { sticky: true });
  37.                                                                 $.jGrowl("Welcome to Medical Requirement Management System", { header: 'Access Granted' });
  38.                                                             var delay = 1000;
  39.                                                                 setTimeout(function(){ window.location = 'members.php'  }, delay);  
  40.                                                             }
  41.                                                             else
  42.                                                             {
  43.                                                             $.jGrowl("Please Check your username and Password", { header: 'Login Failed' });
  44.                                                             }
  45.                                                             }
  46.                                                         });
  47.                                                         return false;
  48.                                                     });
  49.                                     });
  50.                                     </script>
  51. <?php include('footer_index.php'); ?>
  52.     </div> <!-- /container -->
  53. <?php include('script.php'); ?>
  54.   </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement