<?php
include('../Config/config.php');

session_start();
$months = array();
$currentMonth = (int) date('m');
$checkQueryAdmin = mysqli_query(get_db(), "SELECT * FROM admin WHERE admin_id = 1");
//echo "SELECT * FROM admin WHERE username = '".$_POST['username']."'  AND password = '".$_POST['Password']."' ".mysqli_error();

$fetchAdmin = mysqli_fetch_array($checkQueryAdmin);

for ($x = $currentMonth; $x < $currentMonth + 10; $x++) {
    $months[] = date('m-Y', mktime(0, 0, 0, $x, 1));
}

$userEmailExist = mysqli_query(get_db(), "SELECT * FROM member_details ORDER BY member_id DESC ");

$fetchhh = mysqli_fetch_array($userEmailExist);


	if(isset($_POST['submitLogin']))
	{
		 $checkQuery = mysqli_query(get_db(), "SELECT * FROM member_details WHERE (memberID = '".$_POST['username']."' OR phone = '".$_POST['username']."')  AND password = '".$_POST['Password']."'");
		 //echo "SELECT * FROM member_details WHERE (memberID = '".$_POST['username']."' OR phone = '".$_POST['username']."')  AND password = '".$_POST['Password']."' ";
		 //exit;
		 //echo "SELECT * FROM admin WHERE username = '".$_POST['username']."'  AND password = '".$_POST['Password']."' ".mysqli_ error();
		
	     $fetch222 = mysqli_fetch_array($checkQuery);
		 //echo 'YES'.$fetch222['status'];
		if(mysqli_num_rows($checkQuery) > 0 && $fetch222['blocking'] == 0){
     
		  session_start();
		  // Set session variables
		$_SESSION["memberID"] = $fetch222['memberID'];
		$_SESSION["username"] = $fetch222['name'];
		$_SESSION["wallet_balance"] = $fetch222['wallet_balance'];

	
		$_SESSION["logintime"] = date('H:m:i');

		    //header('Location: Application/index.php');
		    
		   //echo'<script>alert("We are Working on it...");</script>';
		    ?>
		   
		     <script>
    window.location = '../user/index.php';
</script>
		    <?php
		    

	 }else{
	     //echo 'YES'.$fetch222['status'];
	     //print_r($fetch222);
	     //exit;
	 	// blocked 
	 	 echo'<script>alert("Sorry.. Account is BLocked, Please Contact Admin");</script>';
	        }   
	
			
	}
?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Mirrored from CryptoCash.work/auth by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 26 Jun 2025 09:00:41 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><?php echo $fetchAdmin['website_title']; ?> || Login</title>
  <link rel="icon" type="image/png" href="assets/images/favicon.html" sizes="16x16">
  <!-- bootstrap 4  -->
    <link href="LoginCss/bootstrap.min.css" rel="stylesheet" />
    <link href="LoginCss/all.min.css" rel="stylesheet" />
    <link href="LoginCss/line-awesome.min.css" rel="stylesheet" />
    <link href="LoginCss/animate.min.css" rel="stylesheet" />
    <link href="LoginCss/slick.css" rel="stylesheet" />
    <link href="LoginCss/dots.css" rel="stylesheet" />
    <link href="LoginCss/main.css" rel="stylesheet" />
   <!-- fontawesome 5  -->
   
 </head>
  <body>
    <div class="preloader">
      <div class="preloader-container">
        <span class="animated-preloader"></span>
      </div>
    </div>
  
    <!-- scroll-to-top start -->
    <div class="scroll-to-top">
      <span class="scroll-icon">
        <i class="fa fa-rocket" aria-hidden="true"></i>
      </span>
    </div>
    <!-- scroll-to-top end -->

  <div class="full-wh">
    <!-- STAR ANIMATION -->
    <div class="bg-animation">
      <div id='stars'></div>
      <div id='stars2'></div>
      <div id='stars3'></div>
      <div id='stars4'></div>
    </div><!-- / STAR ANIMATION -->
  </div>
       
  <div class="page-wrapper">
     <!-- account section start -->
    <div class="account-section bg_img" data-background="LoginCss/Images/bg-5.jpg">
      <div class="container">
        <div class="row justify-content-center">
          <div class="col-xl-5 col-lg-7">
            <div class="account-card">
    <div class="account-card__header bg_img overlay--one" data-background="LoginCss/Images/bg-6.jpg" style="text-align: center;">
    <a href="Home.html">
        <img src="<?php echo $fetchAdmin['web_logo']; ?>" style="display: block; margin-left: auto; margin-right: auto; width: 250px; height: auto;" />
    </a>
    <h2 style="font-size: 36px;" class="section-title">Welcome to <span class="base--color"><?php echo $fetchAdmin['website_title']; ?></span></h2>
</div>

              <div class="account-card__body">
                <h3 class="text-center">Login</h3>
                <form method="post" action="" id="ctl00" class="mt-4">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="6WReyOHtS6wEDY3hIH7Aj2lAqhjaWXn9u4wo5jPQmMkn/roX4AP5m71c9QE0gi+vsrQw2Twtu/SyEntLrYj4DySkW24FIza2MbtB4JQptsA=" />
</div>

<div class="aspNetHidden">

	<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C2EE9ABB" />
</div>
                  <div class="form-group">
                    <label>Member ID</label>
                    <input name="username" type="text" id="username" class="form-control" Placeholder="Enter Member ID" />
                  </div>
                  <div class="form-group">
                    <label>Password</label>
                    <input name="Password" type="password" id="Password" class="form-control" Placeholder="Enter password" />
                  </div>
                  <div class="form-row">
                    <div class="col-sm-6">
                      <div class="form-group form-check">
                        <input type="checkbox" class="form-check-input" id="exampleCheck1">
                        <label class="form-check-label" for="exampleCheck1">Remember me</label>
                      </div>
                    </div>
                    <div class="col-sm-6 text-sm-right">
                      <p class="f-size-14">Haven't an account? <a href="register.php" class="base--color">Sign Up</a></p>
                      <p class="f-size-14"><a href="Forgotpass.php" class="base--color">Forgot Password?</a></p>
                    </div>
                  </div>
                  <div class="mt-3">
                    <input type="submit" name="submitLogin" value="Login Now" id="submit" class="cmn-btn" />
                  </div>
                  <span id="lblerror" style="color:#F00E0E;"></span>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- account section end -->

  </div> <!-- page-wrapper end -->
    <!-- jQuery library -->
      <script src="LoginCss/Js/jquery-3.5.1.min.js"></script>
      <script src="LoginCss/Js/bootstrap.bundle.min.js"></script>
      <script src="LoginCss/Js/slick.min.js"></script>
      <script src="LoginCss/Js/wow.min.js"></script>
      <script src="LoginCss/Js/contact.js"></script>
      <script src="LoginCss/Js/app.js"></script>
   <!-- bootstrap js -->
  
   </body>

<!-- Mirrored from CryptoCash.work/auth by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 26 Jun 2025 09:01:06 GMT -->
</html>