<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start(); 
?>
<!DOCTYPE html>
<html dir="ltr">

<head>
  <title>BTCOVER | Admin Dashboard</title><meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
    <!-- Custom CSS -->
    <link href="dist/css/style.min.css" rel="stylesheet">

</head>

<body>
    <div class="main-wrapper">
        <div class="preloader">
            <div class="lds-ripple">
                <div class="lds-pos"></div>
                <div class="lds-pos"></div>
            </div>
        </div>
		<?php
			$ver=base64_decode($_GET['logid']);
		?>
        <div class="auth-wrapper d-flex no-block justify-content-center align-items-center bg-dark">
            <div class="auth-box bg-dark border-top border-secondary">
                <div id="loginform">
                    <div class="text-center p-t-20 p-b-20">
                        <span class="db"><img src="assets/images/logo.png" alt="logo" /></span>
                    </div>
                    <!-- Form -->
                  <form class="form-horizontal m-t-20" id="loginform" method="post" action="">
                        <div class="text-center">
							<span class="text-white" style="color:#F44336!important; font-size:16px;">You were already logged in. Please confirm to continue with this login. Your previous session will be destroyed!!</span><br><br>
						</div>
                        <div class="row border-top border-secondary">
                            <div class="col-12">
                                <div class="form-group">
                                    <div class="p-t-20">
                                        <button class="btn btn-info" id="to-recover" name="subCancel" type="submit"> Cancel</button>
                                        <button class="btn btn-success float-right" name="subContinue" type="submit">Continue</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
					 <div class="text-center" style="margin-top:15%;">

                        <span class="text-white">©2019 BTCOVER All Rights Reserved.<br> Developed By  &nbsp;&nbsp;<a href="https://www.belltechnology.in/" target='_blank'> Bell Technology </a> &nbsp; | &nbsp;<a href="http://www.btcover.appexperts.net/privacy_policy.html"> Privacy Policy </a></span>

                    </div>
                </div>
              
            </div>
        </div>
      <?php
		#Get value from  login form
		if(isset($_POST['subCancel'])){
			header("location:http://www.btcover.appexperts.net/");
		}
		if(isset($_POST['subContinue']))
		{
			$r_temp=session_id();
			$temp_time=time();
			$res_search = mysqli_query($con,"select * from tbl_manager where manager_id='$ver'");
			$a21=mysqli_fetch_array($res_search);
						
			$uq1=mysqli_query($con,"UPDATE tbl_manager SET login_datetime='$temp_time',session_id='$r_temp',activity_time='$temp_time' where manager_id='$ver'");
			#store all fetch data in session.
			$_SESSION['admin_id']=$a21['admin_id'];
			$_SESSION['manager_id']=$ver;
			$_SESSION['user_type']=$a21['manage_type'];
			$_SESSION['user_session']=$r_temp;
			header("location:dashboard.php");
		}
		?>           
    </div>
    <!-- ============================================================== -->
    <!-- All Required js -->
    <!-- ============================================================== -->
    <script src="assets/libs/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/libs/popper.js/dist/umd/popper.min.js"></script>
    <script src="assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- ============================================================== -->
    <!-- This page plugin js -->
    <!-- ============================================================== -->
    <script>

    $('[data-toggle="tooltip"]').tooltip();
    $(".preloader").fadeOut();
    // ============================================================== 
    // Login and Recover Password 
    // ============================================================== 
    $('#to-recover').on("click", function() {
        $("#loginform").slideUp();
        $("#recoverform").fadeIn();
    });
    $('#to-login').click(function(){
        
        $("#recoverform").hide();
        $("#loginform").fadeIn();
    });
    </script>

</body>

</html>