<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('sliders/add'); ?>" class="btn btn-success btn-sm">Ajouter un slider</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 ($sliders as $slider) { ?>
                                        <tr>
                                            <td style="">
                                                <?= $slider['position']; ?>
                                            </td>
                                            <td style="">
                                                <embed src="<?= site_url() . 'assets/uploads/' . $slider['resource']['name']; ?>" width="130" height="60"/>
                                            </td>
                                            <td style="">
                                                <?= $slider['title']; ?>
                                            </td>
                                            <td>
                                                <?php if ($slider['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('sliders/' . $slider['id'] . '/edit'); ?>" title="Modifier" class="btn btn-default btn-sm">
                                                    <i class="fa fa-edit"></i>
                                                </a>
                                                <button id="<?= $slider['id']; ?>" title="<?= $slider['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>