<?php
session_start();
include("dbConfig.php");
if(isset($_POST['username']) && isset($_POST['password']))
{ 

    $result=mysqli_query($db,"SELECT * FROM BillLogin WHERE Username='$_POST[username]' and Password='$_POST[password]'");
    if(mysqli_num_rows($result)!=0){
       while($row=$result->fetch_assoc()){
           $username=$row['Username'];
           $name=$row['Name'];
       }
       $_SESSION['username']=$username;
       $_SESSION['name']=$name;
       echo "<script>alert('Login Succussful')</script>";
       $url="https://newpriyadarshinihospital.com/Billing/index.php";
echo "<meta http-equiv=\"refresh\" content=\"0;url=$url\" />";
    }
else{
  echo "<script>alert('Incorrect Username or Password')</script>";  
}
    
   
   
 
}
?>
<!DOCTYPE html>
<html>
<head>
  <title>
    
  </title>
  <meta charset="UTF-8">
  <link href="assets/img/favicon.png" rel="icon">
  <link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
  <script src='https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.css'>
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css'>
  <!-- Google Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700" rel="stylesheet">
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css'>
<link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.css'>

  <!-- Vendor CSS Files -->
  <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="assets/vendor/ionicons/css/ionicons.min.css" rel="stylesheet">
  <link href="assets/vendor/animate.css/animate.min.css" rel="stylesheet">
  <link href="assets/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
  <link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
  <link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <script src="https://code.jquery.com/jquery.min.js"></script>
  <script src="jquery.dependent.fields.js"></script>
  <!-- Template Main CSS File -->
  <link href="assets/css/style.css" rel="stylesheet">
  <script src="https://code.jquery.com/jquery.min.js"></script>
<script src="jquery.dependent.fields.js"></script>
<style type="text/css">
.footer {
   position: fixed;
   left: 0;
   bottom: 0;
   width: 100%;
   background-color: #efe8e8;
   color: black;
   text-align: center;
   padding:4px;
   font-size:12px;
}.footer a{
  font-weight: bold;
  color:#0c0c67;
}
  .hide {
  display: none;
}
h4{
  padding-top: 5px;
  padding-bottom: 0px;
  color:#1abfbf;
  font-weight: bold;
}
hr{
  background-color:#1abfbf;
}
span{
    color:red;
}
</style>
</head>
<body>
  <div style="text-align: center">
     <img src="assets/img/logo.png" width="100px" height="100px">
  </div>

  <section style="border:2px solid #279480;">
  <div class="row">
<div class="col-md-4"></div> 
<div class="col-md-4">
  <div class="shadow p-3 mb-5 bg-light rounded">
<form action="" method="POST">
  <h2 style="text-align: center;font-weight: bold;color:#fff;background-color: #279480;padding:10px;">Login</h2>
  
 <div class="form-group">
      <label for="un">Username</label>
      <input  class="form-control" type="text" name="username" id="un" required>
    </div>
    <div class="form-group">
      <label for="pw">Password</label>
      <input  class="form-control" type="password" name="password" id="pw" required>
    </div>
  
   
<div style="text-align: center">
  <button type="submit" class="btn btn-primary">Login</button>
</div>

</form>
</div>
</div> 
<div class="col-md-4"></div>    
  </div>
  </section>

<div class="footer">
        &copy; Copyright 2020 All Rights Reserved <strong>New Priyadharshini Hospital</strong>. | Designed by <a href="http://www.vatsinsoft.in/">Vatsin Soft</a>
      </div>


 <script src='https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js'></script>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
  <script src="assets/vendor/jquery/jquery.min.js"></script>
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
  <script src="assets/vendor/php-email-form/vali.js"></script>
  <script src="assets/vendor/wow/wow.min.js"></script>
  <script src="assets/vendor/venobox/venobox.min.js"></script>
  <script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
  <script src="assets/vendor/jquery-sticky/jquery.sticky.js"></script>
  <script src="assets/vendor/superfish/superfish.min.js"></script>
  <script src="assets/vendor/hoverIntent/hoverIntent.js"></script>
  <script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
  <script src="assets/js/main.js"></script>
</body>
</html>
