<!-- display Diesel exchanges -->
<div class="tab-pane fade show" id="Diesel" role="tabpanel" aria-labelledby="transaction-tab">
    <div class="table-responsive fs-14">
        <table class="table card-table display mb-4 dataTablesCard text-black text-center" id="example4">
            <thead>
                <tr>

                    <th>الرقم</th>
                    <th>العميل</th>
                    <th>نوع البدل</th>
                    <th>كمية البترول</th>
                    <th>كمية الديزل</th>
                    
                    <th>الوقت والتاريخ</th>
                    <th>الحالة</th>
                    <th>العمليات</th>
                </tr>
            </thead>
            <tbody>
                <?php if(isset($exchanges)): ?>
                <?php $__currentLoopData = $exchanges; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $exchange): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if($exchange->exchange_type == 1): ?>
                        <tr>
                            <td><span><?php if(isset($exchange->id)): ?>
                                <?php echo e($exchange->id); ?>

                            <?php endif; ?></span></td>
                            <td><span class="text-nowrap"><?php if(isset($exchange->clint->name)): ?>
                                <?php echo e($exchange->clint->name); ?>

                            <?php endif; ?></span></td>
                            <td><span class="text-nowrap"><?php if(isset($exchange->exchange_type)): ?>
                                <?php if($exchange->exchange_type == 0): ?>
                                    بترول &#11013; ديزل
                                <?php else: ?>
                                    ديزل &#11013; بترول
                                <?php endif; ?>
                            <?php endif; ?></span></td>
                            <td><span><?php if(isset($exchange->petrol_quantity)): ?>
                                <?php echo e($exchange->petrol_quantity); ?>

                            <?php endif; ?></span></td>
                            <td><span><?php if(isset($exchange->diesel_quantity)): ?>
                                <?php echo e($exchange->diesel_quantity); ?>

                            <?php endif; ?></span></td>
                            
                            <td><span><?php if(isset($exchange->created_at)): ?>
                                <?php echo e($exchange->created_at); ?>

                            <?php endif; ?></span></td>
                            <td>
                                <?php if(isset($exchange->is_active)): ?>
                                    <?php if($exchange->is_active == 1): ?>
                                        <span class="badge badge-success light">مفعلة</span>
        
                                        
                                    
                                    <?php else: ?>
                                        <span class="badge badge-danger">ملغية</span>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                            <td>
                                <div class="dropdown dropstart">
                                    <a href="javascript:void(0);" class="btn-link" data-bs-toggle="dropdown" aria-expanded="false">
                                        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                            <path d="M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z" stroke="#575757" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
                                            <path d="M12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z" stroke="#575757" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
                                            <path d="M12 20C12.5523 20 13 19.5523 13 19C13 18.4477 12.5523 18 12 18C11.4477 18 11 18.4477 11 19C11 19.5523 11.4477 20 12 20Z" stroke="#575757" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
                                        </svg>
                                    </a>
                                    <div class="dropdown-menu">
                                        <button type="button"  value=""
                                            <?php $__currentLoopData = $registries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $registry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($exchange->id == $registry->operation_id): ?>
                                                    data-id="<?php echo e($registry->operation_id); ?>"
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            class="registry update dropdown-item"
                                            href="update"><i class="bi bi-pencil-square text-success ms-3"></i>
                                            سجل العمليات
                                        </button>
                                        <?php if($exchange->is_active==1): ?>
                                        <button type="button" value="" data-id="<?php echo e($exchange->id); ?>"
                                            data-confirm_type="1" data-title="طباعة سند الغاء تبديل كمية"
                                            data-route='<?php echo e(route('printExchange')); ?>' class="confirm dropdown-item"
                                            href="confirm"><i class="fa fa-print ms-3 scale2"></i>طباعة سند التبديلة
                                        </button>
                                        <button type="button"  value="" data-id="<?php echo e($exchange->id); ?>"
                                            data-route='<?php echo e(route('updateExchange')); ?>'
                                            data-accounter_id="<?php echo e($exchange->user_id); ?>"
                                            data-sender_name="<?php echo e($exchange->clint->name); ?>"
                                            data-petrolQuantity="<?php echo e($exchange->petrol_quantity); ?>"
                                            data-dieselQuantity="<?php echo e($exchange->diesel_quantity); ?>"
                                            data-type="<?php echo e($exchange->exchange_type); ?>" class=" edit update dropdown-item"
                                            href="update"><i class="bi bi-pencil-square text-success ms-3"></i>
                                            تعديل
                                        </button>
                                            
                                            <button type="button" value="" data-id="<?php echo e($exchange->id); ?>" data-confirm_type="0" data-content="'الغاء السند" data-title ="هذه التوزيعة"  data-route='<?php echo e(route('cancelExchange')); ?>' class="toggle dropdown-item" href="toggle"><i class="fa fa-trash ms-3 text-danger"></i>الغاء</button>         
                                        <?php else: ?>
                                        <button type="button" value="" data-id="<?php echo e($exchange->id); ?>"
                                            data-confirm_type="1" data-title="طباعة سند الغاء تبديل كمية"
                                            data-route='<?php echo e(route('printExchange')); ?>' class="confirm dropdown-item"
                                            href="confirm"><i class="fa fa-print ms-3 scale2"></i>طباعة سند الغاء التبديلة</button>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </td>

                </tr>

                <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>

            </tbody>
        </table>
    </div>
</div>
<?php /**PATH C:\Users\Nasser\Desktop\petrol_store\resources\views/exchange/tables/diesel.blade.php ENDPATH**/ ?>