<?php 
    error_reporting(E_ALL);
    ini_set('error_reporting', E_ALL);

    include 'assets/php/connect.php';
    include 'assets/php/reg.php';
?>

<!DOCTYPE html>
<html lang="ru">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
        <link rel="stylesheet" href="assets/css/style.css">
    <script src="assets/js/bootstrap.min.js"></script>
    <link rel="icon" href="assets/img/favicon.ico">
    <title>Водить.РФ</title>
</head>

<body>
    <?php include "assets/includes/header.php" ?>
    <form method="post">
        <div class="mb-3">
            <label for="exampleInputEmail1" class="form-label">ФИО</label>
            <input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="fullname" required>
        </div>
        <div class="mb-3">
            <label for="exampleInputEmail1" class="form-label">Дата рождения</label>
            <input type="date" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="birthdate" required>
        </div>
        <div class="mb-3">
            <label for="exampleInputEmail1" class="form-label">Телефон</label>
            <input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="phone" required>
        </div>
        <div class="mb-3">
            <label for="exampleInputEmail1" class="form-label">Эл. почта</label>
            <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="email" required>
        </div>
        <div class="mb-3">
            <label for="exampleInputEmail1" class="form-label">Логин</label>
            <input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="login" required>
        </div>
        <div class="mb-3">
            <label for="exampleInputPassword1" class="form-label">Пароль</label>
            <input type="password" class="form-control" id="exampleInputPassword1" name="password_hash" required>
        </div>
                <a href="login.php">Уже зарегистрированы? Вход</a><br><br>
        <?php if(!empty($error)){ ?>
            <div class="alert alert-danger" role="alert">
                <?php echo $error ?>
            </div>
        <?php } ?>
        <button type="submit" class="btn btn-primary" name="reg" value="reg">Войти</button>

    </form>
    <?php include "assets/includes/footer.php" ?>
</body>

</html>