<body class="login-page bg-orange fBTitrBold">
<div class="login-box">
    <div class="logo">
        <a href="javascript:void(0);"><b><?php echo (new CoreSystem())->TitleSite(); ?></b></a>
        <small><span> DigiHelp.net </span>طراحی توسعه</small>
    </div>
    <div class="card">
        <div class="body">
            <form id="sign_in" method="POST" autocomplete="off">
                <div class="msg">برای شروع کار وارد شوید</div>
                <div class="input-group">
                        <span class="input-group-addon">
                            <i class="material-icons">person</i>
                        </span>
                    <div class="form-line">
                        <input value="" autocomplete="new-password" type="text" class="form-control username"
                               name="username"
                               placeholder="نام کاربری"
                               required
                               autofocus>
                    </div>
                </div>
                <div class="input-group">
                        <span class="input-group-addon">
                            <i class="material-icons">lock</i>
                        </span>
                    <div class="form-line autocomplete-content">
                        <input value="" autocomplete="new-password" type="password" class="form-control password"
                               name="password"
                               placeholder="رمز عبور"
                               required>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <button class="btn btn-block bg-pink waves-effect" type="submit">ورود</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    (function ($) {
        $(document).ready(function () {
            $('form').submit(function (event) {
                event.preventDefault();

                let form = $(this);
                LoadData({
                    request: 'proxy', action: 'SessionController', object: {
                        username: form.find('input.username').val(),
                        password: form.find('input.password').val()
                    },
                    'header-type': 'login'
                }, null, false, function (data) {
                    if (data === "1") {
                        location.reload();
                    } else {
                        console.log(data);
                    }
                });

            });
        });
    }(jQuery));
</script>


<?php

//session_destroy();
/*echo '<pre>';
print_r($_SESSION);
print_r($_COOKIE);
echo '</pre>';*/

//$a = $_SESSION[$_COOKIE['user']]['uniqid'];
//echo '<pre>';
//var_dump($_SESSION[$_COOKIE['user']][$a]);
//echo '</pre>';