

<div class="card">
    <div class="card-block">
        <h2 class="card-title">Listagem de Serviços</h2>
        <div align="right">
            <a href="#adicionarPecas" class="btn btn-s-md btn-success" data-animation="swell" data-plugin="custommodal"
               data-overlaySpeed="100" data-overlayColor="#36404a"><i class="fa fa-user-plus fa-2x"></i> Adicionar</a>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <label class="form-inline">Show
                    <select id="demo-show-entries" class="form-control input-sm">
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="15">15</option>
                        <option value="20">20</option>
                    </select> entries </label>
            </div>
            <div class="col-sm-6">
                <div class="m-t-40">
                    <div class="d-flex">
                        <div class="ml-auto">
                            <div class="form-group">
                                <input id="demo-input-search1" type="text" placeholder="Procurar" class="form-control"
                                       autocomplete="off">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <table id="demo-foo-pagination" class="table toggle-circle table-hover" data-page-size="6">
            <thead>


            <tr>
                <th data-toggle="true">#</th>
                <th> Descrição</th>
                <th data-hide="phone">Aplicação</th>
                <th data-hide="phone">Garantia</th>
                <th data-hide="phone">Status</th>
                <th></th>
                <th data-hide="all"></th>
                <!--                <th data-hide="all"> Status</th>-->
            </tr>
            </thead>
            <tbody>
            <?php foreach ($servicos as $r) {?>

                <tr>
                    <td><?php echo $r->ID_SERVICO ?></td>
                    <td><?php echo $r->DS_DESCRICAO_SERVICO ?></td>
                    <td><?php echo $r->DS_APLICACAO ?></td>
                    <td><?php echo $r->NU_MESES_GARANTIA." Meses" ?></td>
                    <td><span class="label label-table label-<?php echo $r->DS_GRUPO=='P'?'warning':'success'?>"><?php echo $r->ID_SERVICO=='P'?'Pedente':'Realizada'?></span></td>
                    <td>
                        <a href="<?php echo base_url()?>servicos/editar/<?php echo $r->ID_SERVICO?>" class="btn btn-default waves-effect waves-light" type="button"
                               >
                            <i class="fa fa-pencil-square-o"></i>
                        </a>
<!--                        <button class="btn btn-default waves-effect waves-light" type="button"><i class="fa fa-trash-o"></i>-->
                        </button>
                        <a href="#" class="btn btn-default waves-effect waves-light"
                           servicoItem="<?php echo $r->ID_SERVICO ?>"
                           data-toggle="modal" data-target="#modalExluirItem"
                        > <i
                                    class="fa fa-trash-o text-danger"></i>
                        </a>
                    </td>
                </tr>
            <?php }?>

            </tbody>
            <tfoot>
            <tr>
                <td colspan="5">
                    <div class="text-right">
                        <ul class="pagination pagination-split m-t-30"></ul>
                    </div>
                </td>
            </tr>
            </tfoot>
        </table>
    </div>
</div>



<script type="text/javascript">
    $(document).on('click', 'a', function (event) {
        if ($(this).attr('servicoItem')) {
            $('#idItemExcluir').val($(this).attr('servicoItem'));
            $("#excluirItem").attr("action", "<?php echo base_url() ?>servicos/excluir");
        }
    });

</script>
<?php $this->load->view("sistema/modais/exluirItemGerericosModal"); ?>
<?php $this->load->view("sistema/modais/servicos/adicionarServicoModal"); ?>
