


<script>


	

	

	
	

	
	
function spinner() {
  
			var x = document.getElementById("spin");
	
	
	
  if (x.style.display === "none") {
    x.style.display = "block ";
	  
	  
  }
	else {
    x.style.display = "none";
  }
	
	
}	//loader for build app
	

	
	
	
	
		function click_spinner() {
  
			var x = document.getElementById("spin");
	
	
	

    x.style.display = "block ";
	  
	  

	
	
}	//loader for build app

		
		
		

</script>


<?PHP
$uname = "";
$pword = "";
$errorMessage = "";
$errorMessage = @ $_GET['txnfailed'];

if ($_SERVER['REQUEST_METHOD'] == 'POST'){
//if($uname==""){
	
	require 'LBS/config.php';

	//$uname = $_POST['username'];
	$uname = $_POST['password'];
	$pword = $_POST['password'];

	$database = "lawpedco_lawpedc3_lbs_users";
	$db_found = new mysqli(DB_SERVER, DB_USER, DB_PASS, $database );
	if ($db_found) {

	$SQL = $db_found->prepare('SELECT * FROM login WHERE L1 = ?');
	$SQL->bind_param('s', $uname);
	$SQL->execute();
	$result = $SQL->get_result();

		if ($result->num_rows == 1) {
 			
			//$errorMessage = "incorrect password";
			
			$db_field = $result->fetch_assoc();

			//$errorMessage = $db_field['L2'];
			//if (password_verify($pword, $db_field['L2'])) {
				
				if($pword==$db_field['L2']){
					
				session_start();
				$_SESSION['login'] = "1";
				$_SESSION['name'] = $db_field['name'];
				$_SESSION['database'] = $db_field['d_b'];
					$_SESSION['db_size'] = $db_field['db_size'];
				$_SESSION['user_id'] = $db_field['ID'];
				$_SESSION['biz_name'] = $db_field['biz_name'];
					$_SESSION['biz_nature'] = $db_field['biz_nature'];
				$_SESSION['status'] = $db_field['status'];
				$_SESSION['privilage'] = $db_field['privilage'];
				$_SESSION['app_name'] = $db_field['app_name'];
					$_SESSION['app_code'] = $db_field['app_code'];
					$_SESSION['activation_date'] = $db_field['activation_date'];
					$_SESSION['expiration_date'] = $db_field['expiration_date'];
					
					
				$ID = $_SESSION['ID'] = $db_field['ID'];
					
					$_SESSION['background_color'] = $db_field['background_color'];
					$_SESSION['text_color'] = $db_field['text_color'];
					
					$_SESSION['bottom_backgroundcolor'] = $db_field['bottom_background'];
					$_SESSION['bottom_textcolor'] = $db_field['bottom_textcolor'];
					
					
					$_SESSION['fone'] = $db_field['fone'];
					$_SESSION['city'] = $db_field['city'];
					$_SESSION['L1'] = $db_field['L1'];
					
					
					
					$_SESSION['product_key'] = $db_field['product_key'];
					$_SESSION['key_update'] = $db_field['key_update'];
					
					
					$_SESSION['address'] = $db_field['address'];
					
					$_SESSION['branch_key'] = $db_field['branch_key'];
					
					
						
					header ("Location: LBS/location.php");	
					
					
					
					
					
				//header ("Location: LBS/dashboard.php");
exit;
			}
			else {
				$errorMessage = "incorrect password ";
				//$errorMessage = $db_field['L2'];
				session_start();
				$_SESSION['login'] = '';
			}
		}
		else {
			$errorMessage = "Access Denied";
			
		}
	}

	/*mysqli_close($db_handle);*/
}


?>




<!--
=========================================================
* Material Dashboard 2 - v3.0.0
=========================================================

* Product Page: https://www.creative-tim.com/product/material-dashboard
* Copyright 2021 Creative Tim (https://www.creative-tim.com)
* Licensed under MIT (https://www.creative-tim.com/license)
* Coded by Creative Tim

=========================================================

* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no,black">
 
  <title>
 Business manager
  </title>
	

	
	
	
	
  <!--     Fonts and icons     -->
  <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900|Roboto+Slab:400,700" />
  <!-- Nucleo Icons -->
 
  <!-- Font Awesome Icons -->
  <script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script>
  <!-- Material Icons -->
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet">
  <!-- CSS Files -->
 <!-- <link id="pagestyle" href="LBS/assets/css/material-dashboard.css" rel="stylesheet" >-->
	
	 <link rel="stylesheet" type="text/css" href="LBS/assets/css/material-dashboard.css" rel="stylesheet" >
	
	
	
	 <!--manifest file for pwa ap-->
	 <link href="manifest.json"  rel = "manifest">
	   <!--manifest file for pwa ap-->
	  
	  <!--ios support-->
	   <link href="img/icons/icon-96.png"  rel = "apple-touch-icon">
	  <meta name="apple-mobile-web-app-status-bar" content="">
	  <meta name="theme-color" content="">
	  <!--ios suppoer-->
	  
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
    <script src="js/jquery-3.4.1.min.js"></script> 
	  
    <!-- Include all compiled plugins (below), or include individual files as needed --> 
    <script src="LBS/assets/js/popper.min.js"></script> 
    <script src="LBS/js/bootstrap-4.4.1.js"></script>
	  
	
	   <script src="app.js"></script>
	  
	
	
	
	
	
	
</head>
	
	<style>
		
			
		
	body, html {

background-color: #918DFC;
		//background-color: #3F3BB1;
}
	</style>
	
	<style>
	
	
	
	.lds-roller {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-roller div {
  animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  transform-origin: 40px 40px;
}
.lds-roller div:after {
  content: " ";
  display: block;
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
 
	
	 background: blue;
	
	
  margin: -4px 0 0 -4px;
}
.lds-roller div:nth-child(1) {
  animation-delay: -0.036s;
}
.lds-roller div:nth-child(1):after {
  top: 63px;
  left: 63px;
}
.lds-roller div:nth-child(2) {
  animation-delay: -0.072s;
}
.lds-roller div:nth-child(2):after {
  top: 68px;
  left: 56px;
}
.lds-roller div:nth-child(3) {
  animation-delay: -0.108s;
}
.lds-roller div:nth-child(3):after {
  top: 71px;
  left: 48px;
}
.lds-roller div:nth-child(4) {
  animation-delay: -0.144s;
}
.lds-roller div:nth-child(4):after {
  top: 72px;
  left: 40px;
}
.lds-roller div:nth-child(5) {
  animation-delay: -0.18s;
}
.lds-roller div:nth-child(5):after {
  top: 71px;
  left: 32px;
}
.lds-roller div:nth-child(6) {
  animation-delay: -0.216s;
}
.lds-roller div:nth-child(6):after {
  top: 68px;
  left: 24px;
}
.lds-roller div:nth-child(7) {
  animation-delay: -0.252s;
}
.lds-roller div:nth-child(7):after {
  top: 63px;
  left: 17px;
}
.lds-roller div:nth-child(8) {
  animation-delay: -0.288s;
}
.lds-roller div:nth-child(8):after {
  top: 56px;
  left: 12px;
}
@keyframes lds-roller {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

		
		
		
		
		
	
	
	
	
	</style>
	
	
	
	
	

<body  onLoad="spinner(), load()">
	
	
	
	
		
  <div class="container position-sticky z-index-sticky top-0">
    <div class="row">
      <div class="col-12">
		  
		  
		  
		  
		
		  
		  
        <!-- Navbar -->
    <!--   <nav class="navbar navbar-expand-lg blur border-radius-xl top-0 z-index-3 shadow position-absolute my-3 py-2 start-0 end-0 mx-4">
          <div class="container-fluid ps-2 pe-0">
            <a class="navbar-brand font-weight-bolder ms-lg-0 ms-3 ">
             powered by LAWPED
            </a>
            <button class="navbar-toggler shadow-none ms-2" type="button" data-bs-toggle="collapse" data-bs-target="#navigation" aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon mt-2">
                <span class="navbar-toggler-bar bar1"></span>
                <span class="navbar-toggler-bar bar2"></span>
                <span class="navbar-toggler-bar bar3"></span>
              </span>
            </button>
            <div class="collapse navbar-collapse" id="navigation">
              <ul class="navbar-nav mx-auto">
                <li class="nav-item">
                  <a class="nav-link d-flex align-items-center me-2 active" aria-current="page" href="index.html">
                    <i class="fa fa-chart-pie opacity-6 text-dark me-1"></i>
                   www.lawped.com.ng
                  </a>
					
					
                </li>
                <li class="nav-item">
                  <a class="nav-link me-2" href="tel:09055158742">
                    <i class="fa fa-user opacity-6 text-dark me-1"></i>
                    Developer(Alaye David, 09055158742)
					  
                  </a>
                </li>
            
				   <li class="nav-item">
                  <a class="nav-link me-2" href="login.php">
                    <i class="fa fa-chart-pie opacity-6 text-dark me-1"></i>
                  LBS (Lawped Business Solution)
                  </a>
                </li>
				  
				  
                <li class="nav-item">
                  
                   
                  <a href="LBS/user_reg.php" class="btn btn-sm mb-0 me-1 bg-gradient-dark" onClick="load()">BUILD APP</a>
					  
                 
                </li>
				
				 <li class="nav-item">
                  
                   
                   <div class="loader" id="load" style="margin: auto"></div>
					  
                 
                </li>
				  
				  
              </ul>
              <ul class="navbar-nav d-lg-block d-none">
             
              </ul>
            </div>
			  
          </div>
        </nav>-->
        <!-- End Navbar -->
      </div>
    </div>
  </div>
	
	


  <main class="main-content  mt-0" >
	  
	  
	  
	  <script>
		  function user_reg(){
			  
			var x = document.getElementById("z");
			  
			  if(x.checked){
				  
				
				  
				  window.location.href= "LBS/user_reg.php";
				 
			  }
			  
			  
			  
		  }
		  
		  
	  </script>
	   
	  
    <div class="page-header align-items-start min-vh-100" style="background-iage: url('https://images.unsplash.com/photo-1497294815431-9365093b7331?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1950&q=80');">
      <span class="mask bg-gradient-dark opacity-6">     <input type="radio" onClick="spinner(),user_reg()" id ="z">   </span>
      <div class="container my-auto">
        <div class="row">
          <div class="col-lg-4 col-md-8 col-12 mx-auto">
            <div class="card z-index-0 fadeIn3 fadeInBottom">
              <div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
                <div class="bg-gradient-primary shadow-primary border-radius-lg py-3 pe-1">
                  <h4 class="text-white font-weight-bolder text-center mt-2 mb-0"> <?php echo $errorMessage;
					?></h4>
               
                </div>
              </div>
				
              <div class="card-body">
				  
				  <!--page loader -->
				  <!-- <div class="loader" id="spin" style="margin: auto"></div>-->
				  
				  <td><div class=" lds-roller" id="spin" style="margin: auto">   <div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div> </td> 
				  
				   <!--page loader -->
				  
				  
                <form  role="form" class="text-start" action="login.php" method="post" >
					
                  <div class="input-group input-group-outline my-3">
                  <!--  <label class="form-label">Username</label>-->
                    <input type="hidden" name="username" class="form-control" >
                  </div>
                  <div class="input-group input-group-outline mb-3">
                    <label class="form-label">Password</label>
                    <input type="password" name="password" class="form-control" >
                  </div>
                  <div class="form-check form-switch d-flex align-items-center mb-3">
                    <input class="form-check-input" type="checkbox" id="rememberMe">
                    <label class="form-check-label mb-0 ms-2" for="rememberMe">Remember me</label>
                  </div>
                  <div class="text-center">
                    <button type="submit" onClick="click_spinner()" class="btn bg-gradient-primary w-100 my-4 mb-2">Sign in</button>
                  </div>
                  <p class="mt-4 text-sm text-center">
                   
                    <a href="password_rec.php" class="text-primary text-gradient font-weight-bold"  onClick="click_spinner()">  Recover Password? </a>
                  </p>
                </form>
				  
				  
              </div>
            </div>
          </div>
        </div>
      </div>
      <footer class="footer position-absolute bottom-2 py-2 w-100">
        <div class="container">
          <div class="row align-items-center justify-content-lg-between">
            <div class="col-12 col-md-6 my-auto">
              <div class="copyright text-center text-sm text-white text-lg-start">
                © <script>
               //   document.write(new Date().getFullYear())
                </script>
                Business Manager
              </div>
            </div>
          
          </div>
        </div>
      </footer>
    </div>
  </main>
  <!--   Core JS Files   -->
  <script src="LBS/assets/js/core/popper.min.js"></script>
  <script src="LBS/assets/js/core/bootstrap.min.js"></script>
 
  <script>
    var win = navigator.platform.indexOf('Win') > -1;
    if (win && document.querySelector('#sidenav-scrollbar')) {
      var options = {
        damping: '0.5'
      }
      Scrollbar.init(document.querySelector('#sidenav-scrollbar'), options);
    }
  </script>
  <!-- Github buttons -->
  <script async defer src="https://buttons.github.io/buttons.js"></script>
  <!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->
 
</body>

</html>




