<?php
include_once 'header.php'; //includes header file / ievieto galvenes failu 
?>

<h2>Sign up</h2>
<?php
if (isset($_GET["error"])) {  //just tells the user that something is not correct / paziņo lietotājam ka kaut kas ir nepareizi ievadīts
    if ($_GET["error"] == "emptyInput") {
        echo "<p>Not all fields are filled!</p>";
    } else if ($_GET["error"] == "invalidUsername") {
        echo "<p>Invalid username!</p>";
    } else if ($_GET["error"] == "invalidEmail") {
        echo "<p>Invalid Email address!</p>";
    } else if ($_GET["error"] == "passwordsDontMatch") {
        echo "<p>Passwords don`t match!</p>";
    } else if ($_GET["error"] == "stmtFailed") {
        echo "<p>Something failed try again!</p>";
    } else if ($_GET["error"] == "usernameTaken") {
        echo "<p>This username is already taken!</p>";
    } else if ($_GET["error"] == "none") {
        echo "<p>You have singed up!</p>";
    }
}
?>
<form action="includes/signup.inc.php" method="POST">
    <ul class="list-group-singup">
        <li class="list-group-item border-0"><input type="text" name="name" placeholder="Name..."></li>
        <li class="list-group-item border-0"><input type="text" name="email" placeholder="Email..."></li>
        <li class="list-group-item border-0"><input type="text" name="uid" placeholder="Username..."></li>
        <li class="list-group-item border-0"><input type="password" name="pwd" placeholder="Password..."></li>
        <li class="list-group-item border-0"><input type="password" name="pwdrepeat" placeholder="Repeat password..."></li>
        <li class="list-group-item border-0"><button type="submit" class="btn btn-primary" name="submit">Sign up</button></li>
    </ul>
</form>

<?php
include_once 'footer.php'; //includes footer file / ievieto kājenes failu
?>

