<?php require_once "controllerUserData.php"; ?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Signup Form</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div class="container">
        <div class="row">
            <div class="col-md-4 offset-md-4 form">
                <form action="signup-user.php" method="POST" autocomplete="">
                    <h2 class="text-center">Signup Form</h2>
                    <p class="text-center">It's quick and easy.</p>
                    <?php
                    if (count($errors) == 1) {
                    ?>
                        <div class="alert alert-danger text-center">
                            <?php
                            foreach ($errors as $showerror) {
                                echo $showerror;
                            }
                            ?>
                        </div>
                    <?php
                    } elseif (count($errors) > 1) {
                    ?>
                        <div class="alert alert-danger">
                            <?php
                            foreach ($errors as $showerror) {
                            ?>
                                <li><?php echo $showerror; ?></li>
                            <?php
                            }
                            ?>
                        </div>
                    <?php
                    }
                    ?>
                    <div class="form-group">
                        <input class="form-control" type="text"  name="name" placeholder="Full Name" onkeypress="return (event.charCode > 64 && event.charCode < 91) || (event.charCode > 96 && event.charCode < 123) || (event.charCode==32)" required value="<?php echo $user_name ?>">
                    </div>

                    <div class="form-group">
                        <input class="form-control" type="email" name="email" placeholder="Email Address" required value="<?php echo $user_email ?>">
                    </div>
                    <div class="form-group">
                        <input class="form-control" type="password"  name="password" placeholder="Password" required>
                    </div>
                    <div class="form-group">
                        <input class="form-control" type="password" name="cpassword" placeholder="Confirm password" required>
                    </div>
                    <div class="form-group">
                        <label for="comment">Address:</label>
                        <textarea class="form-control" rows="5" id="comment" name="address" required></textarea>
                    </div>

                    <div class="form-group "
                    >
                        <input class="form-control" type="number" pattern="[7-9]{1}[0-9]{9}"   name="number"  placeholder="Contact Number"  required>
                    </div>

                    <div class="form-group">
                        <label for="sel1">security question </label>
                        <select class="form-control" id="sel1" name="SecQuestion">
                            <option>In what city were you born?</option>
                            <option>What is the name of your favorite pet?</option>
                            <option>What is the name of your high school ?</option>
                            <option>What is the name of your high school ?</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <input class="form-control" type="text" name="SecAnswer" placeholder="Answer" required value="">
                    </div>

                    <div class="form-group">
                        <input class="form-control button" type="submit" name="signup" value="Signup">
                    </div>
                    <div class="link login-link text-center">Already a member? <a href="login-user.php">Login here</a></div>
                </form>
            </div>
        </div>
    </div>

</body>

</html>


<script>



</script>