<?php

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


$tanks_res = $db->query("email_notifications", "SELECT * FROM email_notifications WHERE company_id = {$_SESSION['company_id']} ORDER BY record_id DESC");



?>

<div class="tank_item_container">
    <h1>EMAIL NOTIFICATIONS</h1>
    <input type="submit" class="app_buttons_small" value="ADD" onclick="window.location.href='add.php'">
</div>
<div class="tank_item_container">
    <div class="table-responsive">
        <table>
            <tr>
                <th>
                    NAME
                </th>
                <th>
                    EMAIL
                </th>
            </tr>

            <?php

            while ($tanks = $tanks_res->fetch_assoc()) {
                ?>

                <tr onclick="window.location.href='edit.php?record_id=<?php echo $tanks['record_id']; ?>'">
                    <td>
                        <input type='text' value='<?php echo $tanks['name']; ?>' readonly class="table_input">
                    </td>
                    <td>
                        <input type='text' value='<?php echo $tanks['email']; ?>' readonly class="table_input">
                    </td>
                </tr>
                <?php
            }
            ?>
        </table>
    </div>
</div>