<section id="main-content">
    <section class="wrapper">
        <div class="msg">
            <?php if ($this->session->flashdata('flash_msg')) { ?>
                <?php $alert = $this->session->flashdata('flash_msg'); ?>
                <div class="alert alert-<?= $alert['type']; ?> alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <?= $alert['msg']; ?>
                </div>
            <?php } ?>
        </div>
        <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('services/add'); ?>" class="btn btn-success btn-sm">Ajouter un service</a>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel">
                    <header class="panel-heading">
                        Services
                        <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 style="text-align: center;">Position</th>
                                <th style="">Nom</th>
                                <th style="">Icon</th>
                                <th style="">Description</th>
                                <th style="text-align: center;">Action</th>
                                </thead>
                                <tbody>
                                    <?php foreach ($services as $service) { ?>
                                        <tr id="<?= $service['id']; ?>" >
                                            <td style="text-align: center">
                                                <?= $service['pos']; ?>
                                            </td>
                                            <td>
                                                  <?= $service['title']; ?>
                                            </td> 
                                            <td>
                                                  <?= $service['class']; ?>
                                            </td> 
                                            <td>
                                                <?= $service['description']; ?>
                                            </td> 
                                            <td style="text-align: center">
                                                <a href="<?= site_url('services/' . $service['id'].'/edit'); ?>" title="Modifier" class="btn btn-default btn-xs">
                                                    <i class="fa fa-edit"></i>
                                                </a>
                                                <button id="<?= $service['id']; ?>" title="<?= $service['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>