<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Fiche de Commande - <?php echo e($hotelorder->hotel_name); ?></title>
    <style>
        body {
            font-family: 'DejaVu Sans', sans-serif;
            font-size: 12px;
            color: #333;
            margin: 0;
            padding: 20px;
        }
        .header {
            text-align: center;
            margin-bottom: 20px;
            border-bottom: 2px solid #020548;
            padding-bottom: 10px;
        }
        .header-content {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
        }
        .logo {
            height: 60px;
            margin-right: 15px;
        }
        .header-text {
            text-align: center;
        }
        .header h1 {
            color: #020548;
            margin: 0;
            font-size: 24px;
        }
        .header p {
            margin: 5px 0 0 0;
            color: #666;
        }
        .section {
            margin-bottom: 15px;
        }
        .section-title {
            background-color: #020548;
            color: white;
            padding: 5px 10px;
            font-weight: bold;
            margin-bottom: 10px;
            border-radius: 3px;
        }
        .info-grid {
            display: table;
            width: 100%;
            margin-bottom: 10px;
        }
        .info-row {
            display: table-row;
        }
        .info-label {
            display: table-cell;
            font-weight: bold;
            padding: 5px;
            width: 30%;
            vertical-align: top;
        }
        .info-value {
            display: table-cell;
            padding: 5px;
            vertical-align: top;
        }
        .image-container {
            text-align: center;
            margin: 15px 0;
        }
        .hotel-image {
            max-width: 300px;
            max-height: 200px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
        .price-box {
            border: 1px solid #020548;
            border-radius: 5px;
            padding: 10px;
            margin: 10px 0;
            background-color: #f8f9fa;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            font-size: 10px;
            color: #666;
            border-top: 1px solid #ddd;
            padding-top: 10px;
        }
        .badge {
            background-color: #28a745;
            color: white;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 10px;
        }
        .service-badge {
            display: inline-block;
            background-color: #020548;
            color: white;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 10px;
            margin: 2px;
        }
        @page {
            margin: 20px;
        }
        /* Style de secours si l'image ne charge pas */
        .logo-fallback {
            display: inline-block;
            width: 60px;
            height: 60px;
            background-color: #020548;
            color: white;
            text-align: center;
            line-height: 60px;
            font-weight: bold;
            margin-right: 15px;
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="header-content">
            <!-- Correction de l'attribut alt et ajout d'un contenu de secours -->
            <img src="<?php echo e(asset('assets/images/voyagedif.jpeg')); ?>" class="logo" alt="VoyageDifiant Logo" onerror="this.style.display='none'; document.getElementById('logo-fallback').style.display='block';">
            <div id="logo-fallback" class="logo-fallback" style="display: none;">VD</div>
            <div class="header-text">
                <h1>Facture de la commande d'hôtel</h1>
                <p>Date de génération : <?php echo e(now()->format('d/m/Y H:i')); ?></p>
            </div>
        </div>
    </div>

    <!-- Image principale -->
    <?php if($imagePath): ?>
    <div class="image-container">
        <img src="<?php echo e($imagePath); ?>" class="hotel-image" alt="<?php echo e($hotelorder->hotel_name); ?>">
    </div>
    <?php endif; ?>

    <!-- Informations de la commande -->
    <div class="section">
        <div class="section-title">Informations de l'Hôtel</div>
        <div class="info-grid">
            <div class="info-row">
                <div class="info-label">Nom de l'hôtel:</div>
                <div class="info-value"><?php echo e($hotelorder->hotel_name); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Ville:</div>
                <div class="info-value"><?php echo e($hotelorder->city); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Classe:</div>
                <div class="info-value"><?php echo e($hotelorder->classe); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Période de réservation:</div>
                <div class="info-value"><?php echo e($hotelorder->reservation_period); ?></div>
            </div>
            <?php if($hotelorder->driver_name): ?>
            <div class="info-row">
                <div class="info-label">Chauffeur:</div>
                <div class="info-value"><?php echo e($hotelorder->driver_name); ?></div>
            </div>
            <?php endif; ?>
        </div>
    </div>

    <!-- Informations financières -->
    <div class="section">
        <div class="section-title">Informations Financières</div>
        <div class="info-grid">
            <div class="info-row">
                <div class="info-label">Prix:</div>
                <div class="info-value"><?php echo e(number_format($hotelorder->price, 0, ',', ' ')); ?> FCFA</div>
            </div>
            <div class="info-row">
                <div class="info-label">Prix Total:</div>
                <div class="info-value"><?php echo e(number_format($hotelorder->total_price, 0, ',', ' ')); ?> FCFA</div>
            </div>
            <div class="info-row">
                <div class="info-label">Montant Payé:</div>
                <div class="info-value"><?php echo e(number_format($hotelorder->amount_paid, 0, ',', ' ')); ?> FCFA</div>
            </div>
            <div class="info-row">
                <div class="info-label">Numéro de Facture:</div>
                <div class="info-value"><?php echo e($hotelorder->invoice_number); ?></div>
            </div>
        </div>
    </div>

    <!-- Informations client -->
    <div class="section">
        <div class="section-title">Informations Client</div>
        <div class="info-grid">
            <div class="info-row">
                <div class="info-label">Nom du client:</div>
                <div class="info-value"><?php echo e($hotelorder->username); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Téléphone:</div>
                <div class="info-value"><?php echo e($hotelorder->phone); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">ID Utilisateur:</div>
                <div class="info-value"><?php echo e($hotelorder->user_id); ?></div>
            </div>
        </div>
    </div>

    <!-- Informations supplémentaires -->
    <div class="section">
        <div class="section-title">Détails Techniques</div>
        <div class="info-grid">
            <div class="info-row">
                <div class="info-label">ID de la commande:</div>
                <div class="info-value"><?php echo e($hotelorder->id); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Date de création:</div>
                <div class="info-value"><?php echo e($hotelorder->created_at->format('d/m/Y H:i')); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Statut de visualisation:</div>
                <div class="info-value">
                    <span class="badge">
                        <?php echo e($hotelorder->is_viewed ? 'VU' : 'NON VU'); ?>

                    </span>
                </div>
            </div>
            <div class="info-row">
                <div class="info-label">Image disponible:</div>
                <div class="info-value">
                    <?php echo e($hotelorder->hotel_image ? 'OUI' : 'NON'); ?>

                </div>
            </div>
        </div>
    </div>

    <div class="footer">
        <p>© <?php echo e(date('Y')); ?> VoyageDifiant - Tous droits réservés</p>
        <p>Document généré automatiquement - Ne pas utiliser à des fins commerciales</p>
    </div>
</body>
</html>
<?php /**PATH C:\Users\LENOVO\Documents\voyagedifiantDashboard\resources\views/pdf/hotelorder.blade.php ENDPATH**/ ?>