<?php include("../elemetns_web/header.php") ?>
<?php include("../../assets/script/login/login_check.php") ?>
<?php include("../../assets/script/admin/manipulationuser.php"); ?>

<section class="panel_user">
    <article class="main_panel_user">


        <h1>Witaj <?php echo $name ?> </h1>
        <h2>twoja rola to <?php echo ucwords($user_data["rola"]) ?></h2>

        <dl class="list_option_user">

            <dt>Zarządzanie artykułami</dt>

            <dd>

                <form action="../manipulation/manipulationpost.php">
                    <button class="green">Dodaj artykuł</button>
                </form>

                <form action="../manipulation/postviewsman.php">
                    <button class="green">Zobacz artykuły</button>
                </form>

            </dd>

            <?php if ($user_data["rola"] == "admin") { ?>

                <dt>Funkcje Administratora</dt>

                <dd>

                    <form action="../admin/usermenager.php">
                        <button class="red">Zarządzaj Użytkownikami</button>
                    </form>

                    <form action="../file/dirfile.php">
                        <button class="green">Zarządzaj Folderami</button>
                    </form>


                </dd>

            <?php } ?>

            <dt>Zarządzanie kontem</dt>
            <dd>

                <form method="post" class="restart_pass">
                    <input type="password" name="nowpassword">
                    <button class="yellow" name="changepassword">Zmień Hasło</button>
                </form>

                <?php if ($user_data["id"] != 1) { ?>

                    <form method="post">
                        <input type="hidden" name="username" value="<?php echo $user_data["name"] ?>" />
                        <button class="red" name="delluser">Usuń Konto</button>
                    </form>

                <?php  } ?>

            </dd>

        </dl>

    </article>

    <?php include("../elemetns_web/aside.php") ?>

</section>

<?php include("../elemetns_web/footer.php") ?>