<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">

    <title><?php echo e(config('app.name', 'Laravel')); ?></title>

    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">
    <link rel="stylesheet" href="<?php echo e(asset('css/app.css')); ?>">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/tiny-slider.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">

    <script src="https://kit.fontawesome.com/b5101eab7c.js" crossorigin="anonymous"></script>
    <script src="<?php echo e(asset('js/app.js')); ?>" defer></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
</head>

<body id="dashboard" onload="alertDashboard('<?php echo e($alert ?? ''); ?>')">
    <div id="page">

        <section>
            <?php if(!empty($B2L)): ?>
                <span style="font-size: 44px"><?php echo e($bee2link_not_sent ?? 0); ?> (B2L)&ensp;
                    <i class="fa-solid fa-triangle-exclamation" style="color: orange"></i>
                </span><br>
            <?php endif; ?>
            <?php if(empty($PVO)): ?>
                <span style="font-size: 44px"><?php echo e($pvo_not_sent ?? 0); ?> (PVO)&ensp;
                    <i class="fa-solid fa-triangle-exclamation" style="color: orange"></i>
                </span><br>
            <?php endif; ?>
            <br><br>

            <span style="font-size: 21px">
                Véhicules non remontés depuis le <?php echo e(isset($date_prise_en_compte) ? date('d-m-Y - H:i:s', strtotime($date_prise_en_compte)) : 'Aucune donnée'); ?>

            </span>
            <br>

            <span id="info-vehicle" style="display: none">
                <i class="fa-solid fa-triangle-exclamation" id="warning-pvo" style="color: orange; font-size: 22px"></i>&ensp;
                Dernier véhicule non remonté chez PVO :
                <strong>
                    <?php echo e(!empty($lastVehicleNotSendToPvo) ? $lastVehicleNotSendToPvo->name : 'Aucun véhicule'); ?>

                </strong>
            </span>
            <br>

            <table id="dashboard-vehicules" class="searchlist">
                <tr class="header">
                    <th>Origine</th>
                    <th>Immatriculation</th>
                    <th>Entreprise</th>
                    <th>Concession</th>
                    <th>Date de mise à jour</th>
                    <th>Date de création</th>
                    <th>Opérateur Contacté</th>
                </tr>

                <?php $__currentLoopData = $vehicles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vehicle): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><img class="flag" src="<?php echo e(asset('assets/images/flags/Flag_of_Europe.svg.png')); ?>"></td>

                        <td>
                            <a href="https://bo.carlab.fr/clients/<?php echo e($vehicle->client_id); ?>/vehicule/<?php echo e($vehicle->id); ?>" target="_blank">
                                <?php echo e($vehicle->name ?? 'Inconnu'); ?>

                            </a>
                        </td>

                        <td>
                            <?php
                                $entreprise = 'Inconnu';
                                foreach ($users as $user) {
                                    if ($user->id === $vehicle->manager_id) {
                                        $entreprise = $user->entreprise ?? $user->name ?? 'Inconnu';
                                        break;
                                    }
                                }
                            ?>
                            <?php echo e($entreprise); ?>

                        </td>

                        <td>
                            <?php
                                $concession = 'Inconnu';
                                foreach ($users as $user) {
                                    if ($user->id === $vehicle->client_id) {
                                        $concession = $user->name ?? 'No Name';
                                        break;
                                    }
                                }
                            ?>
                            <?php echo e($concession); ?>

                        </td>

                        <td><?php echo e(date('d-m-Y H:i:s', strtotime($vehicle->updated_at ?? 'now'))); ?></td>
                        <td><?php echo e(date('d-m-Y H:i:s', strtotime($vehicle->created_at ?? 'now'))); ?></td>

                        <td>
                            <?php
                                $email = null;
                                $tel = null;
                                foreach ($users as $user) {
                                    if ($user->id === $vehicle->operator_id) {
                                        $email = $user->email ?? null;
                                        $tel = $user->tel1 ?? null;
                                        break;
                                    }
                                }
                            ?>

                            <?php if($email && $tel): ?>
                                <td onclick="modalOperator('<?php echo e($email); ?>', '<?php echo e($tel); ?>')">
                                    <i class="fa-solid fa-eye"></i>
                                </td>
                            <?php else: ?>
                                <td>Email Non renseigné</td>
                            <?php endif; ?>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </table>
        </section>

        <div>
            <?php echo e($vehicles->links('vendor.pagination.custom')); ?>

        </div>

        <?php
            header('Refresh:60');
        ?>
    </div>
</body>

</html>
<?php /**PATH /var/www/html/dashboard-vehicules-bodemer/dashboard-vehicules/resources/views/dashboardVehicles.blade.php ENDPATH**/ ?>