<!-- Author  Artūrs Mūrnieks
Created 19.02.2024
Editor Raivis
Modified 14.03.2024 -->
<?php require_once "./ctrluserctrl.php"; ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&family=Ojuju:wght@200..800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="../css/login.css">
</head>
<body>
    <div class="container mt-5">
        <div class="row justify-content-center">
            <div class="col-md-5">
                <div class="card">
                    <div class="card-header text-white loginhead"> <!-- Fixed class name -->
                        <strong>Login</strong>
                    </div>
                    <div class="card-body">
                        <form action="login.php" method="POST" autocomplete="" class="formins">
                            <?php
                                if(count($errors) > 0){
                                    ?>
                                    <div class="alert alert-danger text-center">
                                        <?php
                                        foreach($errors as $showerror){
                                            echo $showerror;
                                        }
                                        ?>
                                    </div>
                                    <?php
                                }
                            ?>
                            <div class="mb-3">
                                <label for="username" class="form-label"><strong>Username</strong></label>
                                <input type="text" class="form-control" id="username" name="username" required value="<?php echo isset($username) ? $username : '' ?>">
                            </div>
                            <div class="mb-3">
                                <label for="password" class="form-label"><strong>Password</strong></label>
                                <input type="password" class="form-control" id="password" name="password" required>
                            </div>
                            <div class="d-grid gap-2 mb-1">
                                <input type="submit" class="btn btn-primary" id="loginpoga" value="Login" name="login"><strong></strong></input>
                            </div>
                            <div class="d-grid gap-2">
                            <a href="http://localhost/HolzeN/php/signup.php" class="btn btn-primary" id="Register"><strong>Register</strong></a> 
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
