<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <div class="col-sm-12">

                <section class="panel panel-tools">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-leftt">
                                <a href="<?= site_url('projects/add'); ?>" class="btn btn-success btn-sm">Ajouter un projet</a>
                            </div>
                        </div>
                    </div>
                </section>
                <?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">
                        <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>Position</th>
                                <th>Slider</th>
                                <th>Titre</th>
                                <th>Active</th>
                                <th>Actions</th>
                                </thead>
                                <tbody>
                                    <?php foreach ($projects as $project) { ?>
                                        <tr>
                                            <td style="">
                                                <?= $project['position']; ?>
                                            </td>
                                            <td style="">
                                                <embed src="<?= site_url() . 'assets/uploads/' . $project['resource']['name']; ?>" width="130" height="60"/>
                                            </td>
                                            <td style="">
                                                <?= $project['title']; ?>
                                            </td>
                                            <td>
                                                <?php if ($project['active'] == 'true') { ?><img src="<?= site_url(); ?>assets/admin/images/yes.png" alt=""><?php } else { ?> <img src="<?= site_url(); ?>assets/admin/images/no.png" alt=""> <?php } ?>
                                            </td>
                                            <td style="">
                                                <a href="<?= site_url('projects/' . $project['id'] . '/edit'); ?>" title="Modifier" class="btn btn-default btn-sm">
                                                    <i class="fa fa-edit"></i>
                                                </a>
                                                <button id="<?= $project['id']; ?>" title="<?= $project['title']; ?>" class="btn btn-default btn-sm btn-delete">
                                                    <i class="fa fa-trash-o"></i>
                                                </button>
                                            </td>
                                        </tr> 
                                    <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </section>
</section>