<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <div class="col-sm-12">
                <?php if ($this->session->flashdata('flash_msg')) { ?>
                    <?php $alert = $this->session->flashdata('flash_msg'); ?>
                    <div class="alert alert-<?= $alert['type']; ?>" role="alert">
                        <?= $alert['msg']; ?>
                    </div>
                <?php } ?>

                <section class="panel">
                    <header class="panel-heading">
                        Contacts
                        <span class="tools pull-right">
                            <a href="javascript:;" class="fa fa-chevron-down"></a>
                        </span>
                    </header>
                    <div class="panel-body">
                        <div class="row">

                            <table class="table table-hover">

                                <thead>
                                <th>#</th>
                                <th>Nom</th>
                                <th>Email</th>
                                <th>Phone</th>
                                <th>Actions</th>
                                </thead>
                                <tbody>
                                    <?php foreach ($contacts as $contact) { ?>
                                        <tr>
                                            <td>
                                                <?= $contact['id']; ?>
                                            </td>
                                            <td>
                                                <?= $contact['name']; ?>
                                            </td>

                                            <td>
                                                <?= $contact['email']; ?>

                                            </td>
                                            <td>
                                                <?= $contact['phone']; ?>
                                            </td>
                                            <td>
                                                <button id="<?= $contact['id']; ?>" title="<?= $contact['name']; ?>" class="btn btn-default btn-sm btn-preview">
                                                    <i class="fa fa-search"></i>
                                                </button>
                                                <button<?= ((!empty($contact['message']) || !empty($contact['quote'])) ? '' : ' id="' . $contact['id'] . '"'); ?> title="<?= $contact['name']; ?>" class="btn btn-default btn-sm btn-delete">
                                                    <i class="fa fa-trash-o"></i>
                                                </button>
                                            </td>
                                        </tr> 

                                    <?php } ?>
                                    <tr></tr>
                                </tbody>
                            </table>




                        </div>
                    </div>

                </section>
            </div>
        </div>
    </section>
</section>