<table>
    <thead>
        <tr>
            <th>#</th>
            <th width="40">Mascota</th>
            <th width="25">Especie</th>
            <th width="40">Veterinario</th>
            <th width="25">Fecha de la cita</th>
            <th width="25">Estado de la cita</th>
            <th width="25">Estado de pago</th>
            <th width="40">Horario</th>
        </tr>
    </thead>
    <tbody>

        <?php $__currentLoopData = $appointments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$appointment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e($key+1); ?></td>
                <td> <?php echo e($appointment->pet->name); ?> </td>
                <td> <?php echo e($appointment->pet->specie); ?> </td>
                <td> <?php echo e($appointment->veterinarie->name.' '.$appointment->veterinarie->surname); ?> </td>
                <td> <?php echo e(Carbon\Carbon::parse($appointment->date_appointment)->format("Y/m/d")); ?> </td>
                    <?php
                        $state_appointment = "";
                        switch ($appointment->state) {
                            case 1:
                                $state_appointment = "Pendiente";
                                break;
                            case 2:
                                $state_appointment = "Cancelado";
                                break;
                            case 3:
                                $state_appointment = "Atendido";
                                break;
                            default:
                                # code...
                                break;
                        }
                    ?>
                <?php if($appointment->state == 1): ?>
                <td style="background: #fdf5b1">
                    <?php echo e($state_appointment); ?>

                </td>
                <?php endif; ?>
                <?php if($appointment->state == 2): ?>
                <td style="background: #ffb6b6">
                    <?php echo e($state_appointment); ?>

                </td>
                <?php endif; ?>
                <?php if($appointment->state == 3): ?>
                <td style="background: #d9ffb6">
                    <?php echo e($state_appointment); ?>

                </td>
                <?php endif; ?>
                    <?php
                        $state_payment = "";
                        switch ($appointment->state_pay) {
                            case 1:
                                $state_payment = "Pendiente";
                                break;
                            case 2:
                                $state_payment = "Parcial";
                                break;
                            case 3:
                                $state_payment = "Completo";
                                break;
                            default:
                                # code...
                                break;
                        }
                    ?>
                <?php if($appointment->state_pay == 1): ?>
                <td style="background: #f7a6a6">
                    <?php echo e($state_payment); ?>

                </td>
                <?php endif; ?>
                <?php if($appointment->state_pay == 2): ?>
                <td style="background: #b6c8ff">
                    <?php echo e($state_payment); ?>

                </td>
                <?php endif; ?>
                <?php if($appointment->state_pay == 3): ?>
                <td style="background: #e9b6ff">
                    <?php echo e($state_payment); ?>

                </td>
                <?php endif; ?>

                <td>
                    <ul>
                        <?php $__currentLoopData = $appointment->schedules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $schedule): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li>
                                <?php echo e(Carbon\Carbon::parse(date("Y-m-d").' '.$schedule->schedule_hour->hour_start)->format("h:i A") .' '.Carbon\Carbon::parse(date("Y-m-d").' '.$schedule->schedule_hour->hour_end)->format("h:i A")); ?>

                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                </td>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

    </tbody>
</table><?php /**PATH C:\Users\PC\Desktop\CURSOS_UDEMY\Citas-Veterinaria-Vue\api-veterinary\resources\views/appointments/download_excel.blade.php ENDPATH**/ ?>