<?php
session_start();
include "control/activity.php";
$dd = new activity();
$table = "admin_calculation";
$condition = null;
$getAdminDetails = $dd->single($table,$condition);
$teligram = $getAdminDetails['telegram'];
$loginImg = $getAdminDetails['login_img'];
$fevicon = $getAdminDetails['favicon'];
?>
<!DOCTYPE html>
<html lang="en" translate="no">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/svg+xml" href="temp_img/<?= $fevicon; ?>">
    <meta name="google" content="notranslate">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title><?= $getAdminDetails['title']; ?></title>
    <link rel="stylesheet" href="css/slick.css" />
    <link rel="stylesheet" href="css/modules.css" />
    <link rel="stylesheet" href="css/style.css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/slick.min.js" type="text/javascript"></script>
    <script src="js/main.js" type="text/javascript"></script>
</head>
<body>
    <div id="app">
        <div class="login__container">
            <div class="navbar">
                <div class="navbar-fixed" style="background: linear-gradient(90deg, rgb(206, 2, 4) 0%, rgb(242, 64, 58) 100%);">
                    <div class="navbar__content">
                        <div data-v-905dfe8c="" class="navbar__content-left"><div data-v-905dfe8c="" class="backIcon"></div></div> 
                        <div data-v-905dfe8c="" class="navbar__content-center">
                            <div data-v-905dfe8c="" class="headLogo" style="background-image: url(&quot;temp_img/<?= $loginImg; ?>&quot;);"></div>
                            <div data-v-905dfe8c="" class="navbar__content-title">
                        </div>
                        <div data-v-905dfe8c="" class="navbar__content-right"><div data-v-4eb25d27="" data-v-ee3ddeea=""><!----></div></div>
                    </div>
                    </div>
                </div>
            </div>

            <div class="login__container-heading">
                <h1 data-v-ee3ddeea="" class="login__container-heading__title">Log in</h1>
                <div class="login__container-heading__subTitle">
                    <div data-v-ee3ddeea="">Please log in with your phone number or email</div>
                    <div data-v-ee3ddeea="">If you forget your password, please contact customer service</div>
                </div>
            </div>

            <div class="login_container-tab tabs">
                <div class="tab tablinks tab-link active" data-tab="tab-1">
                    <div data-v-ee3ddeea="" class="phonebg"></div>
                    <div data-v-ee3ddeea="" class="font30">Log in with phone</div>
                </div>
                <div class="tab tablinks tab-link" data-tab="tab-2">
                    <div data-v-ee3ddeea="" class="emialbg"></div>
                    <div data-v-ee3ddeea="" class="font30">Email Login</div>
                </div>
            </div>
            <div class="login__container-form">
                <div class="tabcontent active tab-content activecontent" id="tab-1" >

                    <form class="tab-form" method="post">
                        <div class="signIn__container">
                            <div class="field phoneInput__container">
                                <div class="input-label phoneInput__container-label">
                                    <img data-v-3c9391fd="" src="images/phone-mob-icon.png" class="phoneInput__container-label__icon" alt="Mobile">
                                    <span data-v-3c9391fd="">Phone number</span>
                                </div>
                                <div class="input_wrapper phoneInput__container-input">
                                    <div class="dropdown">
                                        <div class="dropdown__value"><span data-v-ec99c797="">+91</span></div>
                                    </div>
                                    <input required name="username" data-v-3c9391fd="" type="text" name="userNumber" placeholder="Please enter the phone number">
                                </div>
                            </div>
                            <div class="field passwordInput__container">
                                <div class="input-label passwordInput__container-label">
                                    <img data-v-b0ac9d23="" class="passwordInput__container-label__icon" data-origin="images/password.png" src="images/password.png">
                                    <span data-v-b0ac9d23="">Password</span>
                                </div>
                                <div class="input_wrapper passwordInput__container-input">
                                    <input id="input-password" required name="password" data-v-b0ac9d23="" type="password" placeholder="Please enterPassword" maxlength="32" autocomplete="new-password">
                                    <span toggle="#input-password" class="fa fa-fw fa-eye field-icon input-password">
                                        <img data-v-b0ac9d23="" src="images/view-icon.png" class="eye hid_pass">
                                        <img data-v-b0ac9d23="" src="images/eyeVisible-09720f5f.png" class="eye show_pass">
                                    </span>
                                </div>
                            </div>
                            <div data-v-c16e655a>
                                <label data-v-c16e655a class="van-checkbox" role="checkbox" tabindex="0" aria-checked="false">
                                    <span class="van-checkbox__label">Remember password</span>
                                    <input type="checkbox">
                                    <span class="checkmark"></span>
                                </label>
                            </div>
                            <div class="signIn__container-button">
                                <button data-v-c16e655a="" name="loginNow" class="active">Log in</button>
                                <button data-v-c16e655a="" onclick="goRegister()" class="register">Register</button>
                            </div>
                            <div class="signIn_footer">
                                <div class="forgetcon" onclick="gettoForgetPassword()">
                                    <div data-v-c16e655a="" class="forgetbg"></div>
                                    <div data-v-c16e655a="" class="font24">Forgot password</div>
                                </div>
                                <div class="customcon"  onclick="custemerSupport()">
                                    <div data-v-c16e655a="" class="custombg"></div>
                                    <div data-v-c16e655a="" class="font24">Customer Service</div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

<script>
    function gettoForgetPassword()
    {
        window.open('forgetPassword.php','_self');
    }
</script>

<script>
   $(".toggle-password").click(function() {

$(this).toggleClass("fa-eye fa-eye-slash");
var input = $($(this).attr("toggle"));
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});
$(".email-toggle-password").click(function() {

$(this).toggleClass("fa-eye fa-eye-slash");
var input = $($(this).attr("toggle"));
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});

    </script>

<?php
 if(isset($_POST['loginNow']))
 {
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];

     $table = "userdetails";
     $condition = " where password='$password' AND mobile='$username' AND user_status='open'";
     $checkLogin = $dd->check($table,$condition);
     if($checkLogin['status'] == "success")
     {
        $_SESSION['loginKey']=$checkLogin['data']['userKey'];
        echo "<script>window.open('index.php','_self')</script>"; 
     }
     else{
        echo "<script>alert('Login Details Not match..!!')</script>";
     }

 }


?>



                <div class="tabcontent tab-content" id="tab-2">
                    <form class="tab-form" method="post">
                        <div class="signIn__container">
                            <div class="field emailinput__container">
                                <div data-v-9ea79214="" class="input-label emailinput__container-label">
                                    <img data-v-9ea79214="" src="./images/emailnumber-c30433b2.png" class="emailinput__container-label__icon"><span data-v-9ea79214="">Mail</span>
                                </div>
                                <div class="input_wrapper emailinput__container-input">
                                    <input required data-v-9ea79214="" type="email" name="userEmail" maxlength="250" placeholder="please input your email">
                                </div>
                            </div>
                            <div class="field passwordInput__container">
                                <div class="input-label passwordInput__container-label">
                                    <img data-v-b0ac9d23="" class="passwordInput__container-label__icon" data-origin="images/password.png" src="images/password.png">
                                    <span data-v-b0ac9d23="">Password</span>
                                </div>
                                <div class="input_wrapper passwordInput__container-input">
                                    <input id="email-input-password" required data-v-b0ac9d23="" name="password" type="password" placeholder="Please enterPassword" maxlength="32" autocomplete="new-password">
                                    <span toggle="#email-input-password" class="fa fa-fw fa-eye field-icon email-input-password">
                                        <img data-v-b0ac9d23="" src="images/view-icon.png" class="eye hid_pass">
                                        <img data-v-b0ac9d23="" src="images/eyeVisible-09720f5f.png" class="eye show_pass">
                                    </span>
                                </div>
                            </div>
                            <div data-v-c16e655a>
                                <label data-v-c16e655a class="van-checkbox" role="checkbox" tabindex="0" aria-checked="false">
                                    <span class="van-checkbox__label">Remember password</span>
                                    <input type="checkbox" >
                                    <span class="checkmark"></span>
                                </label>
                            </div>
                            <div class="signIn__container-button">
                                <button data-v-c16e655a="" name="emailLogin" class="active">Log in</button>
                                <button data-v-c16e655a="" class="register" onclick="goRegister()">Register</button>
                            </div>
                            <div class="signIn_footer">
                                <div class="forgetcon">
                                    <div data-v-c16e655a="" class="forgetbg"></div>
                                    <div data-v-c16e655a="" class="font24">Forgot password</div>
                                </div>
                                <div class="customcon"  onclick="custemerSupport()">
                                    <div data-v-c16e655a="" class="custombg"></div>
                                    <div data-v-c16e655a="" class="font24">Customer Service</div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            
            <!--Login Popup--> 
            <div class="login_popup_wrpapper">
                <div class="van-overlay" data-v-a7a14dc2="" style="z-index: 100;display:none;"></div>
                    <div class="login_success" style="z-index: 120;display:none">
                        <div class="model_iner">
                            <div class="msg"><img src="https://cms-assets.tutsplus.com/cdn-cgi/image/width=360/uploads/users/523/posts/32694/final_image/tutorial-preview-large.png">
                            <h4>Login Success</h4>
                        </div>
                    </div>
                </div>
            </div>
            <!--Login Popup-->
        </div>
    </div>
</body>

</html>

<script>
  function goRegister()
  {
      window.open('register.php','_self');
  }


  function custemerSupport()
   {
       window.open('<?= $teligram; ?>','_self');
   }
  
   $(".input-password").click(function() {

        $(this).toggleClass("fa-eye fa-eye-slash");
        var input = $($(this).attr("toggle"));
        if (input.attr("type") == "password") {
        input.attr("type", "text");
        } else {
        input.attr("type", "password");
        }
    });

    $(".email-input-password").click(function() {

        $(this).toggleClass("fa-eye fa-eye-slash");
        var input = $($(this).attr("toggle"));
        if (input.attr("type") == "password") {
        input.attr("type", "text");
        } else {
        input.attr("type", "password");
        }
    });

    
</script>    

<style>
.navbar__content-center .headLogo {
    width: 5.08667rem;
    height: 1.12rem;
    background-repeat: no-repeat;
    background-size: 4.98667rem 1.12rem;
    background-position: center;
}
</style>



<?php
 if(isset($_POST['emailLogin']))
 {
     $username = $_REQUEST['userEmail'];
     $password = $_REQUEST['password'];

     $table = "userdetails";
     $condition = " where password='$password' AND email='$username'";
     $checkLogin = $dd->check($table,$condition);
     if($checkLogin['status'] == "success")
     {
        $_SESSION['loginKey']=$checkLogin['data']['userKey'];
        

        
        echo "<script>window.open('index.php','_self')</script>";
         //echo "<script>alert('Login Successfull..!!'),window.open('index.php','_self')</script>";
     }
     else{
         
        echo "<script>alert('Login Details Not match..!!')</script>";
     }

 }


?>
