<?php

 echo $error =  $_GET['txnfailed'];

if ($error == $error)
{
	echo "<script>alert('it works')</script>";
}

?>

kkkkkk


<?PHP
$uname = "";
$pword = "";
//$errorMessage = "";



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

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

	$database = "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['user_id'] = $db_field['ID'];
				$_SESSION['biz_name'] = $db_field['biz_name'];
				$_SESSION['status'] = $db_field['status'];
				$_SESSION['privilage'] = $db_field['privilage'];
				$_SESSION['app_name'] = $db_field['app_name'];
				
					$priviledge = $db_field['privilage'];
					
					if($priviledge == 'admin') 
					{
					
						//header ("Location:dashboard.php");
						
					}
					
					else 
					{
					echo 'new code';	
					
					}
					
			}
			else {
				$errorMessage = "incorrect password ";
				//$errorMessage = $db_field['L2'];
				session_start();
				$_SESSION['login'] = '';
			}
		}
		else {
			$errorMessage = "Access Denied";
			
		}
	}

	/*mysqli_close($db_handle);*/
}

else{
	 echo $errorMessage =  $_GET['txnfailed'];
}

?>




<!--
=========================================================
* 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">
 
  <title>
    LBS
  </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="assets/css/material-dashboard.css" rel="stylesheet" />
</head>

<body class="bg-gray-200">
		
  <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 " href="../pages/dashboard.html">
             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="lawped.com.ng">
                    <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="../pages/profile.html">
                    <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="lbs_app.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="user_reg.php" class="btn btn-sm mb-0 me-1 bg-gradient-dark">BUILD APP</a>
					  
                 
                </li>
				  
				 <!--  <li class="nav-item">
                  
                   
                  <a href="user_reg.php" class="btn btn-sm mb-0 me-1 bg-gradient-dark">DOWN APP</a>
					  
                 
                </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">
    <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"></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">
				  
				  
                <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"  class="btn bg-gradient-primary w-100 my-4 mb-2">Sign in</button>
                  </div>
                  <p class="mt-4 text-sm text-center">
                    forgot Password?
                    <a href="../pages/sign-up.html" class="text-primary text-gradient font-weight-bold"></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>
                LAWPED iCT,Engineering &amp; Printing Company.
              </div>
            </div>
          
          </div>
        </div>
      </footer>
    </div>
  </main>
  <!--   Core JS Files   -->
  <script src="assets/js/core/popper.min.js"></script>
  <script src="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>