

<?php $__env->startSection('content'); ?>
<div class="container">
    
    <div class="card shadow">
        <div class="card-header  text-white" style="background-color:#2C4E71">
            <div class="row">
                <div class="col-md-6">
                    <h4 class="mb-0"> اشعارات الخصم</h4>
                </div>
                <div class="col-md-6 text-right">
                    <a  href='<?php echo e(url("discount/index")); ?>'  class="btn btn-light">
                        <i class="fas fa-plus"></i> إضافة خصم
                    </a>
                </div>
            </div>
        </div>
        
        <div class="card-body">
            <div class="table-responsive">
                <table id="example1"  class="table table-hover table-bordered">
                    <thead class="thead-light">
                        <tr>
                            
                            <th> #</th>
                            <th>تاريخ الخصم</th>
                            <th>حالة الخصم</th>
                            <th>المبلغ الخصم</th>
                            <th>العميل</th>
                            <th>سبب الخصم</th>
                            <th>الإجراءات</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($discounts as $dis): ?>
                        <tr>
                             <td><?php echo e($dis->id); ?> </td>
                            <td><?php echo e($dis->created_at); ?></td>
                            <td>
                                <span class="badge 
                                    <?php if($dis->status == 'Approved'): ?> badge-success
                                    <?php elseif($dis->status == 'Rejected'): ?> badge-danger
                                    <?php else: ?> badge-warning
                                    <?php endif; ?>">
                                    <?php echo e($dis->status); ?>

                                </span>
                            </td>
                            <td><?php echo e(number_format($dis->value, 2)); ?> جنيه</td>
                            <td><?php echo e($dis->client->name); ?> </td>


                            <td><?php echo e($dis->reason); ?></td>
                            <td>
                                 
                                <a  class="btn btn-sm btn-info viewid"   href='<?php echo e(url("discount/details/{$dis->id}")); ?>'> <i class="fas fa-list"></i>  تفاصيل</a>
                                
                                <?php if($dis->status == 'Waiting'): ?>
                                <a  
                                   class="btn btn-sm btn-success">
                                    <i class="fas fa-check"></i> اعتماد
                                </a>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
            
            
        </div>
    </div>
</div>
 


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.masterHome2', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>