

<?php $__env->startSection('title', 'إدارة أجور التطبيق'); ?>
<?php $__env->startSection('page-title', 'إدارة أجور التطبيق'); ?>
<?php $__env->startSection('page-icon', 'fas fa-money-bill-wave'); ?>

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

<div class="row g-3 mb-4">
    <div class="col-6 col-lg-3">
        <div class="stat-card">
            <div class="stat-icon gold"><i class="fas fa-dollar-sign"></i></div>
            <div class="stat-value"><?php echo e(number_format($totalFees, 0)); ?></div>
            <div class="stat-label">إجمالي الأجور (دينار)</div>
        </div>
    </div>
    <div class="col-6 col-lg-3">
        <div class="stat-card">
            <div class="stat-icon green"><i class="fas fa-calendar-day"></i></div>
            <div class="stat-value"><?php echo e(number_format($dailyFees, 0)); ?></div>
            <div class="stat-label">أجور اليوم</div>
        </div>
    </div>
    <div class="col-6 col-lg-3">
        <div class="stat-card">
            <div class="stat-icon blue"><i class="fas fa-calendar-alt"></i></div>
            <div class="stat-value"><?php echo e(number_format($monthlyFees, 0)); ?></div>
            <div class="stat-label">أجور الشهر</div>
        </div>
    </div>
    <div class="col-6 col-lg-3">
        <div class="stat-card">
            <div class="stat-icon orange"><i class="fas fa-calendar"></i></div>
            <div class="stat-value"><?php echo e(number_format($yearlyFees, 0)); ?></div>
            <div class="stat-label">أجور السنة</div>
        </div>
    </div>
</div>


<div class="row g-3 mb-4">
    <div class="col-12">
        <div class="card">
            <div class="card-header"><i class="fas fa-filter"></i> البحث والفلترة</div>
                <div class="card-body">
                    <form method="GET" action="<?php echo e(route('admin.platform-fees.index')); ?>" class="row g-3">
                        <div class="col-md-4">
                            <label class="form-label" style="color: var(--text-light);">نوع مقدم الخدمة</label>
                            <select name="type" class="form-select" onchange="this.form.submit()">
                                <option value="all" <?php echo e($type == 'all' ? 'selected' : ''); ?>>الكل</option>
                                <option value="restaurants" <?php echo e($type == 'restaurants' ? 'selected' : ''); ?>>المطاعم</option>
                                <option value="gas_offices" <?php echo e($type == 'gas_offices' ? 'selected' : ''); ?>>مكاتب الغاز</option>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" style="color: var(--text-light);">البحث</label>
                            <input type="text" name="search" class="form-control" placeholder="ابحث باسم مقدم الخدمة" value="<?php echo e(request('search')); ?>">
                        </div>
                        <div class="col-md-2">
                            <label class="form-label d-block" style="color: var(--text-light);">&nbsp;</label>
                            <button type="submit" class="btn btn-primary w-100">
                                <i class="fas fa-search"></i> بحث
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- قائمة المطاعم -->
    <?php if($type == 'all' || $type == 'restaurants'): ?>
    <div class="row mb-4">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h6 class="mb-0" style="color: var(--text-light); font-weight: 600;">
                        <i class="fas fa-utensils" style="color: var(--primary-yellow); margin-left: 8px;"></i>
                        المطاعم
                    </h6>
                </div>
                <div class="card-body">
                    <?php if($restaurants->count() > 0): ?>
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">الاسم</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">الهاتف</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">عدد الطلبيات</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">أجور اليوم</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">أجور الشهر</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">أجور السنة</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">إجمالي الأجور</th>
                                        <th style="color: var(--primary-yellow); font-weight: 600;">الإجراءات</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $restaurants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $restaurant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr style="background: var(--card-bg) !important;">
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e($restaurant->name); ?></strong>
                                            </td>
                                            <td style="color: rgba(245, 245, 245, 0.7) !important; background: var(--card-bg) !important;"><?php echo e($restaurant->phone ?? 'غير متوفر'); ?></td>
                                            <td style="background: var(--card-bg) !important;">
                                                <span class="badge badge-info" style="background-color: var(--primary-yellow); color: var(--dark-bg);">
                                                    <?php echo e($restaurant->orders_count ?? 0); ?>

                                                </span>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e(number_format($restaurant->daily_fees ?? 0, 2)); ?> دينار</strong>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e(number_format($restaurant->monthly_fees ?? 0, 2)); ?> دينار</strong>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e(number_format($restaurant->yearly_fees ?? 0, 2)); ?> دينار</strong>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <span class="font-weight-bold" style="color: var(--success-green);">
                                                    <?php echo e(number_format($restaurant->total_fees ?? 0, 2)); ?> دينار
                                                </span>
                                            </td>
                                            <td style="background: var(--card-bg) !important;">
                                                <a href="<?php echo e(route('admin.platform-fees.show', ['type' => 'restaurant', 'id' => $restaurant->id])); ?>" class="btn btn-sm btn-primary">
                                                    <i class="fas fa-eye"></i> التفاصيل
                                                </a>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                        <?php if($type == 'restaurants'): ?>
                            <div class="mt-3">
                                <?php echo e($restaurants->links()); ?>

                            </div>
                        <?php endif; ?>
                    <?php else: ?>
                        <div class="text-center py-5" style="color: rgba(245, 245, 245, 0.7);">
                            <i class="fas fa-utensils fa-3x mb-3" style="color: var(--primary-yellow);"></i>
                            <p style="color: var(--text-light);">لا توجد مطاعم</p>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <!-- قائمة مكاتب الغاز -->
    <?php if($type == 'all' || $type == 'gas_offices'): ?>
    <div class="row mb-4">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h6 class="mb-0" style="color: var(--text-light); font-weight: 600;">
                        <i class="fas fa-building" style="color: var(--primary-yellow); margin-left: 8px;"></i>
                        مكاتب الغاز
                    </h6>
                </div>
                <div class="card-body">
                    <?php if($gasOffices->count() > 0): ?>
                        <div class="table-responsive">
                            <table class="table table-hover" style="background: var(--card-bg) !important; color: var(--text-light) !important;">
                                <thead>
                                    <tr>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">الاسم</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">الهاتف</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">عدد الطلبيات</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">أجور اليوم</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">أجور الشهر</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">أجور السنة</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">إجمالي الأجور</th>
                                        <th style="color: var(--primary-yellow) !important; font-weight: 600; background: transparent !important;">الإجراءات</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $gasOffices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $office): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr style="background: var(--card-bg) !important;">
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e($office->name); ?></strong>
                                            </td>
                                            <td style="color: rgba(245, 245, 245, 0.7) !important; background: var(--card-bg) !important;"><?php echo e($office->phone ?? 'غير متوفر'); ?></td>
                                            <td style="background: var(--card-bg) !important;">
                                                <span class="badge badge-info" style="background-color: var(--primary-yellow); color: var(--dark-bg);">
                                                    <?php echo e($office->orders_count ?? 0); ?>

                                                </span>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e(number_format($office->daily_fees ?? 0, 2)); ?> دينار</strong>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e(number_format($office->monthly_fees ?? 0, 2)); ?> دينار</strong>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <strong><?php echo e(number_format($office->yearly_fees ?? 0, 2)); ?> دينار</strong>
                                            </td>
                                            <td style="color: var(--text-light) !important; background: var(--card-bg) !important;">
                                                <span class="font-weight-bold" style="color: var(--success-green);">
                                                    <?php echo e(number_format($office->total_fees ?? 0, 2)); ?> دينار
                                                </span>
                                            </td>
                                            <td style="background: var(--card-bg) !important;">
                                                <a href="<?php echo e(route('admin.platform-fees.show', ['type' => 'gas_office', 'id' => $office->id])); ?>" class="btn btn-sm btn-primary">
                                                    <i class="fas fa-eye"></i> التفاصيل
                                                </a>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                        <?php if($type == 'gas_offices'): ?>
                            <div class="mt-3">
                                <?php echo e($gasOffices->links()); ?>

                            </div>
                        <?php endif; ?>
                    <?php else: ?>
                        <div class="text-center py-5" style="color: rgba(245, 245, 245, 0.7);">
                            <i class="fas fa-building fa-3x mb-3" style="color: var(--primary-yellow);"></i>
                            <p style="color: var(--text-light);">لا توجد مكاتب غاز</p>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wamp64\www\taxi_app\resources\views/admin/platform_fees/index.blade.php ENDPATH**/ ?>