<?php
session_start();

include "../../html.class.php";
include "../../functions.class.php";
include "../../classes/db.class.php";
$html = new html();
$functions = new functions();
// echo $data;

$users_res = $db->query("users", "SELECT * FROM users WHERE company_id = {$_SESSION['company_id']} ORDER BY record_id DESC");
?>
<div class="tank_item_container">
    <h1>USERS</h1>
    <input type="submit" class="app_buttons_small" value="ADD" onclick="window.location.href='add_user.php'">
</div>
<div class="tank_item_container">

    <div class="table-responsive">
        <table>
            <tr>
                <th>
                    USERNAME
                </th>
            </tr>

            <?php

            while ($users = $users_res->fetch_assoc()) {
                ?>

                <tr>
                    <td>
                        <input type='text' value='<?php echo $users['username']; ?>' readonly onclick="window.location.href='edit_user.php?record_id=<?php echo $users['record_id']; ?>'" class="inputs">
                    </td>

                </tr>
                <?php
            }
            ?>

        </table>
    </div>
</div>
