<?php
session_start();
require_once '../config.php';
require_once '../lynchstore/auth/auth-regis.php';
require_once '../layouts/header.php';
?>
	    <div class="row justify-content-center mb-5">
            <div class="col-12 col-md-5">
                <div class="card bg-dark shadow">
                    <div class="card-body">
                        <div class="header-title text-center">
                            <h2><img src="<?= opt_get('aWNvbi13ZWI=') ?>" height="50">
                        <?= config('web','title_web');?></h2>
                        </div>
                        
                        <hr>
                                <form method="POST" class="form form-vertical">
                                    <div class="mb-2">
                                        <div class="input-group">
                                            <span class="input-group-text"><i class="far fa-user"></i></span>
                                            <input type="text" name="name" id="name" class="form-control" placeholder="Name">
                                        </div>
                                    </div>
                                    <div class="mb-2">
                                        <div class="input-group">
                                            <span class="input-group-text"><i class="far fa-user-circle"></i></span>
                                            <input type="text" class="form-control" placeholder="Username"  name="user">
                                        </div>
                                    </div>
                                    <div class="mb-2">
                                        <div class="input-group">
                                            <span class="input-group-text"><i class="far fa-envelope"></i></span>
                                            <input type="email" class="form-control" placeholder="cs@wcode.id" name="email">
                                        </div>
                                    </div>
                                    <div class="mb-2">
                                        <div class="input-group">
                                            <span class="input-group-text"><i class="fab fa-whatsapp"></i></span>
                                            <input type="number" name="phone" id="phone" class="form-control" placeholder="Whatsapp number [628xxxxxxx]">
                                        </div>
                                    </div>
                                <div class="mb-2">
                                    <div class="input-group">
                                        <span class="input-group-text"><i class="fas fa-lock"></i></span>
                                        <input type="text" name="pass" id="password" placeholder="Password" class="form-control">
                                        <span class="input-group-text">
                                        <i class="far fa-eye" id="togglePassword" style="cursor: pointer" onclick="pwEye(this);"></i>
                                        </span>
                                    </div>
                                </div>
                                                Sudah Mempunyai Akun? <a href="/auth/login"> Klik Disini</a>
                                                <br>
                                                <br>
                                                <button style="background-color:#0D47A1;color:white;" type="submit" name="register" class="btn btn-block btn-inline">Daftar</button>
                                    </div>
                                    <div class="login-footer">
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
<?php require '../layouts/footer.php';?>
<script>
$(document).ready(function(){
        $('#phone').on('input', function() {
                if (this.value.startsWith('08')) {
                    this.value = "628";
                }
                this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');
            });
    });
</script>