<?php 
require "templates/navigation.php";
?>

    <content>
        <div class="container-fluid">

            <h2>Manage Accounts</h2>
            <br>

	        <p>
		        You may add, delete or change passwords for user accounts here.
	        </p>
            <?php 
$connection = connectToDb();
$result = findAllUsers();
?>
            <a href="account_add.php"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;Add Users</a>
            <table id='accounts-table' class='table-striped table-hover'>
                <tr>
                    <th>Username</th>
                    <th>Last Name</th>
                    <th>First Name</th>
                    <th>Type</th>
                    <th>Options</th>
                </tr>

                <?php 
while ($row = mysqli_fetch_assoc($result)) {
    ?>
                <!-- output each row-->
Esempio n. 2
0
<?php

require_once 'init.php';
if (!isset($_SESSION['member_id'])) {
    redirect('login.php');
}
$users = findAllUsers($_SESSION['member_id']);
?>

<?php 
require_once 'head.php';
?>

<table>
    <tr>
        <th>User name</th>
        <th>Play</th>
    </tr>
    <?php 
foreach ($users as $user) {
    ?>
    <tr>
        <td><?php 
    echo $user['user_name'];
    ?>
</td>
        <td><a href="lobby.php?member=<?php 
    echo $user['member_id'];
    ?>
">Play</a></td>
    </tr>