<?php $__env->startSection('title', $data['title'] ?? 'Report'); ?>
<?php $__env->startSection('page_title', $data['title'] ?? 'Risultato Report'); ?>

<?php $__env->startSection('content'); ?>

<div class="card">
    <div class="card-header">
        <h3 class="card-title"><i class="fas fa-chart-bar mr-2"></i><?php echo e($data['title'] ?? 'Report'); ?></h3>
        <div class="card-tools">
            <a href="<?php echo e(route('report.index')); ?>" class="btn btn-sm btn-secondary mr-2">
                <i class="fas fa-arrow-left mr-1"></i> Torna ai Report
            </a>
            <a href="<?php echo e(route('report.print-preview', ['report' => $reportType, 'custom_id' => $customReport->id ?? null])); ?>" class="btn btn-sm btn-info mr-2" target="_blank">
                <i class="fas fa-print mr-1"></i> Stampa Report
            </a>
            <a href="<?php echo e(route('report.export', ['report' => $reportType])); ?>" class="btn btn-sm btn-success">
                <i class="fas fa-file-csv mr-1"></i> Esporta CSV
            </a>
        </div>
    </div>
    <div class="card-body">
        <?php if(!empty($data['summary'])): ?>
        <div class="alert alert-info">
            <i class="fas fa-info-circle mr-2"></i>
            <strong><?php echo e($data['summary']); ?></strong>
        </div>
        <?php endif; ?>

        <?php if(!empty($data['headers']) && !empty($data['rows'])): ?>
        <div class="table-responsive">
            <table class="table table-bordered table-striped table-hover">
                <thead class="thead-light">
                    <tr>
                        <?php $__currentLoopData = $data['headers']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $header): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <th><?php echo e($header); ?></th>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $data['rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <?php $__currentLoopData = $row; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cell): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <td><?php echo e(is_array($cell) ? json_encode($cell) : $cell); ?></td>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
        <?php else: ?>
        <div class="text-center text-muted py-5">
            <i class="fas fa-inbox fa-3x mb-3"></i>
            <p>Nessun dato disponibile per questo report.</p>
        </div>
        <?php endif; ?>
    </div>
    <div class="card-footer">
        <div class="row">
            <div class="col-md-6">
                <a href="<?php echo e(route('report.index')); ?>" class="btn btn-secondary">
                    <i class="fas fa-arrow-left mr-1"></i> Torna ai Report
                </a>
            </div>
            <div class="col-md-6 text-right">
                <small class="text-muted">Generato il <?php echo e(now()->format('d/m/Y H:i:s')); ?></small>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/report/result.blade.php ENDPATH**/ ?>