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

<div class="continer">

    <ul class="list_user">

        <?php foreach ($user_list as $user) { ?>

            <li id="<?php echo $user['name'] ?>">

                <p> <?php echo $user['name'] ?> ( <?php echo $user['rola'] ?>)</p>

                <div class="button_continer">

                    <div class="hidden">

                        <form id="changeuser.<?php echo $user['name'] ?>" method="post">
                            <input type="hidden" name="username" value="<?php echo $user['name'] ?>">
                        </form>

                        <form id="viewuser.<?php echo $user['name'] ?>" method="post" action="../../views/manipulation/postviewsman.php?name=<?php echo $user['name'] ?>">
                            <input type="hidden" name="username" value="<?php echo $user['name'] ?>">
                        </form>

                        <form id="delluser.<?php echo $user['name'] ?>" method="post">
                            <input type="hidden" name="username" value="<?php echo $user['name'] ?>">
                        </form>

                        <form id="restartpass.<?php echo $user['name'] ?>" method="post">
                            <input type="hidden" name="username" value="<?php echo $user['name'] ?>">
                        </form>

                    </div>

                    <button form="restartpass.<?php echo $user['name'] ?>" name="restartpass" class="yellow">restart hasła</button>
                    <button form="changeuser.<?php echo $user['name'] ?>" name="changuser" class="yellow">zmień role</button>
                    <button form="viewuser.<?php echo $user['name'] ?>" class="green">zobacz posty</button>
                    <button form="delluser.<?php echo $user['name'] ?>" name="delluser" class="red">usuń</button>

                </div>

            </li>

        <?php } ?>

    </ul>

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

</div>

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