<?php
session_start();
ob_start();

//include_once("alib/hooks/common_func.php");
include_once("alib/extended/indexextended.php");
include_once("alib/hooks/_config_.php");

$conf = new config();

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="https://homeofretailer.com/assets/img/">
    <title> Admin Panel</title>
    <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="alib/assets/css/bootstrap.css">
    <link rel="stylesheet" href="alib/assets/vendors/bootstrap-icons/bootstrap-icons.css">
    <link rel="stylesheet" href="alib/assets/css/app.css">
    <link rel="stylesheet" href="alib/assets/css/pages/auth.css">
</head>

<body class="" style="background-color: #ffffff;">

<!-- aparent Section -->

  <style>

    }
  </style>
<section class=" background-radial-gradient overflow-hidden " style="background-image: linear-gradient(to right, #fe66c4, #8c51ff);">
  <div class="col-8 m-auto px-md-5 text-center text-lg-start my-5">
    <div class="row gx-lg-6 align-items-center">


      <div class="col-lg-7 mb-lg-0 position-relative">
  <div id="radius-shape-3" class="position-absolute shadow-5-strong"></div>
  <div id="radius-shape-1" class="position-absolute rounded-circle shadow-5-strong"></div>
       <!-- <div id="radius-shape-2" class="position-absolute shadow-5-strong"></div>-->
		
		 

        <div class="card bg-glass mt-4" style="background-color: #f2efe8;">
          <div class="card-body px-4 py-5 px-md-5">
              
              
				<h2 class="my-5 fw-bold ls-tight text-center" style="color: #000000;">
				    <img src="https://homeofretailer.com/assets/img/retaillogo.png" height="80px;"/>
				    	</br>
				  Admin Login <br />
		
				</h2>
<?php
if(isset($_POST['lognpro_ot']) && $_POST['lognpro_ot'] == 'Sign In'){
?>
		
            <form action="<?php  $_SERVER['PHP_SELF'] ?>" method="post">
              <!-- 2 column grid layout with text inputs for the first and last names -->
              <div class="row">
     
              <!-- Email input -->
              <div class="form-outline mb-4">
                <input type="email" id="form3Example3" name="usrids" class="form-control is-invalid" autocomplete="off" value="<?php echo $_POST['usrids']; ?>"/>
                <label class="form-label" for="form3Example3">Email address</label>
              </div>

              <!-- Password input -->
              <div class="form-outline mb-4">
                <input type="password" name="upsscrtwrd" id="form3Example4" class="form-control is-invalid" autocomplete="off" value="<?php echo $_POST['upsscrtwrd']; ?>"/>
                <label class="form-label" for="form3Example4">Password</label>
              </div>

       

              <!-- Submit button -->
              <input type="submit" class="btn btn-primary btn-block mb-4" style="background-color: #8b52fe; border:1px solid #8b52fe;" value="Sign In" />
                
            

              <!-- Register buttons -->
                     <!-- Checkbox -->
              <div class="form-check d-flex justify-content-center mb-4">
                 <label class="form-label" for="form3Example4">
				 <a href="" >Forgot Password</a>
                </label>
				 </div>
				
				 
            </form>
		
		
			<?php
	
			//if(isset($_POST['upsscrtwrd']) && $_POST['upsscrtwrd'] != '' && isset($_POST['usrids']) && $_POST['usrids'] != '') {
			if($isValid->validate($_POST['usrids'], "str") && $isValid->validate($_POST['upsscrtwrd'], "str")) {
			$us_ri_dnxt_acs = mysqli_real_escape_string($conf->_conni(), $_POST['usrids']);
			$usps_rds_crtid = mysqli_real_escape_string($conf->_conni(), $_POST['upsscrtwrd']);
			
			//$sl = mysql_query("SELECT admnnm, scrwrdz FROM cpn_admstrx where '".$us_ri_dnxt_acs."' = admnnm AND '".$usps_rds_crtid."' = scrwrdz limit 0,1");
			
			if($auth->_auth($us_ri_dnxt_acs, $usps_rds_crtid) == true) {
				if($auth->_memberSelect($us_ri_dnxt_acs, $usps_rds_crtid) == true) {
				
				$err->logHandler("Admin Login Confirm By '".$us_ri_dnxt_acs."' IP: '".$_SERVER['REMOTE_ADDR']."' on ".date("d-m-Y")." ".date("H:i:s",time())." {Page: Login}  ) <--> ( ", "alib/cerr.php");	
				//$us_ps_scr_twacs = $_POST['upsscrtwrd'];
				$_SESSION['logner_bot'] = $us_ri_dnxt_acs;
				$_SESSION['lgnids'] = 0;
		
				header("Location: alib/dashboard_xic.php?mdwrt=fetchdashboard");
				exit();
				}else{
						$err->logHandler("User Login Confirm By '".$us_ri_dnxt_acs."' IP: '".$_SERVER['REMOTE_ADDR']."' on ".date("d-m-Y")." ".date("H:i:s",time())." {Page: Login}  ) <--> ( ", "alib/cerr.php");	
				//$us_ps_scr_twacs = $_POST['upsscrtwrd'];
				$_SESSION['logner_bot'] = $us_ri_dnxt_acs;
				$_SESSION['lgnids'] = 1;
		
				header("Location: alib/dashboard_xic.php?mdwrt=fetchdashboard");
				exit();
			
				} // end inner auth if
			}else{
			$err->logHandler("Login By IP: '".$_SERVER['REMOTE_ADDR']."' on ".date("d-m-Y")." ".date("H:i:s",time())." {Page: Login}  ) <--> ( ", "alib/cerr.php");
			echo "<div class='alert alert-danger' style='background-color: #793aa3; border:1px solid #793aa3;'><i class='bi bi-file-excel'></i> Invalid ID or Password</div>";
			}
		}else{
		echo "<div class='alert alert-warning'><i class='bi bi-file-excel'></i> Enter Valid Access</div>";
		}

}else{
?>
		
            <form action="<?php  $_SERVER['PHP_SELF'] ?>" method="post">
              <!-- 2 column grid layout with text inputs for the first and last names -->
              <div class="row">
     
              <!-- Email input -->
              <div class="form-outline mb-4">
                <input type="email" id="form3Example3" name="usrids" class="form-control" autocomplete="off"/>
                <label class="form-label" for="form3Example3">Email address</label>
              </div>

              <!-- Password input -->
              <div class="form-outline mb-4">
                <input type="password" name="upsscrtwrd" id="form3Example4" class="form-control" autocomplete="off"/>
                <label class="form-label" for="form3Example4">Password</label>
              </div>

       

              <!-- Submit button -->
              <input type="submit" class="btn btn-primary btn-block mb-4" value="Sign In" name="lognpro_ot" />
                
            

              <!-- Register buttons -->
                     <!-- Checkbox -->
              <div class="form-check d-flex justify-content-center mb-4">
                 <label class="form-label" for="form3Example4">
				 <a href="" >Forgot Password</a>
                </label>
				 </div>
				 <p class="">
				 <style>
				 .clientsSlider{
				 height: 40px;
				 background-image:url(sliderlogo.png) ;
				 background-repeat:repeat;
				 
				 }
				 </style>
				     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <div id="clientsSlider" class="clientsSlider"></div>
    <script>    
      (function slide(){
  $('#clientsSlider').animate({backgroundPosition : '-=2px'}, 20, 'linear', slide);
})();
        </script>
				 </p> 
				 
            </form>
<?php
} // end f
?>			
			
			
			
          </div>
        </div>
      </div>
    </div>
	<!--  <div class="col-lg-6 mx-2 mb-lg-0" style="background:#ffcc00;z-index: 10"> </div> -->
  </div>
</section>
<!-- Section -->
</body>

</html>