<?php $__env->startSection('title', 'Pacientes - Listar'); ?>

<?php $__env->startSection('main'); ?>
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Pacientes
                <small>Listar</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Pacientes</a></li>
                <li class="active">Listar</li>
            </ol>
        </section>

        <section class="content">
            <div class="row">
                <div class="col-xs-12 col-md-12">
                    <div class="box">
                        <table class="table table-bordered table-hover dataTable">
                            <thead>
                            <tr>
                                <th>Nome</th>
                                <th>Email</th>
                                <th>Mãe</th>
                                <th>Pai</th>
                                <th>Sexo</th>
                                <th>Ações</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $pacientes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $paciente): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>

                                <?php
                                $sexo = 'Masculino';
                                if ($paciente->sexo == 1) {
                                    $sexo = 'Feminino';
                                } else if ($paciente->sexo == 2) {
                                    $sexo = 'Outro';
                                }
                                ?>

                                <tr>
                                    <td><?php echo e($paciente->nome); ?></td>
                                    <td><?php echo e($paciente->email); ?></td>
                                    <td><?php echo e($paciente->nome_mae); ?></td>
                                    <td><?php echo e($paciente->nome_pai); ?></td>
                                    <td><?php echo e($sexo); ?></td>
                                    <td>
                                        <a href="<?php echo e(base_url()); ?>index.php/paciente/deletar/<?php echo e($paciente->id_paciente); ?>">
                                            <button class="btn btn-danger">Deletar</button>
                                        </a>
                                        <button class="btn btn-info">Alterar</button>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </section>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('index', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>