<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
    <title>Sign In</title>

    <!-- Favicon -->
    <link rel="shortcut icon" href="to/assets/images/logo/favicon.png">

    <!-- plugins css -->
    <link rel="stylesheet" href="to/assets/vendors/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="to/assets/vendors/PACE/themes/blue/pace-theme-minimal.css" />
    <link rel="stylesheet" href="to/assets/vendors/perfect-scrollbar/css/perfect-scrollbar.min.css" />

    <!-- core css -->
    <link href="to/assets/css/ei-icon.css" rel="stylesheet">
    <link href="to/assets/css/themify-icons.css" rel="stylesheet">
    <link href="to/assets/css/font-awesome.min.css" rel="stylesheet">
    <link href="to/assets/css/animate.min.css" rel="stylesheet">
    <link href="to/assets/css/app.css" rel="stylesheet">


    <link rel="stylesheet" href="to/assets/custom/the-sweetalert-js/sweetalert.css">
</head>

<body>
    <div class="app">
        <div class="authentication">
            <div class="sign-in-2">
                <div class="container-fluid no-pdd-horizon bg" style="background-image: url('to/assets/images/others/img-30.jpg')">
                    <div class="row">
                        <div class="col-md-10 mr-auto ml-auto">
                            <div class="row">
                                <div class="mr-auto ml-auto full-height height-100 d-flex align-items-center">
                                    <div class="vertical-align full-height">
                                        <div class="table-cell">
                                            <div class="card">
                                                <div class="card-body">
                                                    <div class="pdd-horizon-30 pdd-vertical-30">
                                                        <div class="mrg-btm-30">
                                                            <!-- <img class="img-responsive inline-block" src="to/assets/images/logo/logo.png" alt=""> -->
                                                            <!-- <h2 class="inline-block pull-right no-mrg-vertical pdd-top-15">Login</h2> -->
                                                        </div>
                                                        <p class="mrg-btm-15 font-size-13">Please enter your user name and password to login</p>
                                                        <form class="sign_in_form">
                                                            <div class="form-group">
                                                                <input type="email" name="sign_in_email" class="form-control" placeholder="Enter your email">
                                                            </div>
                                                            <div class="form-group">
                                                                <input type="password" name="password" class="form-control" placeholder="Enter password">
                                                            </div>
                                                            <!-- <div class="checkbox font-size-13 inline-block no-mrg-vertical no-pdd-vertical">
                                                                <input id="agreement" name="agreement" type="checkbox">
                                                                <label for="agreement">Keep Me Signed In</label>
                                                            </div> -->
                                                            <!-- <div class="pull-right">
                                                                <a href="#">Forgot Password?</a>
                                                            </div> -->
                                                            <div class="mrg-top-20 text-left">
                                                                <button class="btn btn-info sign_in_btn">Sign In</button>
                                                            </div>
                                                        </form>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="to/assets/js/vendor.js"></script>

    <script src="to/assets/js/app.min.js"></script>
    <!-- page js -->

    <!-- custom js script -->
    <script src="to/assets/custom/Basic-function.js"></script>
    <script src="to/assets/custom/the-sweetalert-js/sweetalert.min.js"></script>

    <script>
        $('.sign_in_btn').click( async function (e) { 
            e.preventDefault();
            
            let sign_in_form = $('.sign_in_form').serializeArray();
            let form_data = set_form_data(sign_in_form);
            let returned = await ajaxRequest('to/ajax.php',form_data);
            // console.log(returned);return;
            // throwSweetalert(returned,'to/overview',1);
			if(returned.error == 1){
				swal('Sorry',returned.msg,'error');
			}else if(returned.error == 0){
				swal('Congratulations',returned.msg+returned.first_name,'success');
				setTimeout(() => {
					window.location.href = 'to/overview';
				}, 2000);
			}
            
        });
    </script>

</body>
</html>