   <!--**********************************Table Allreading Start_reading***********************************-->
   <div class="tab-pane fade show active" id="Allreading" role="tabpanel" aria-labelledby="Allreading-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>
                    <th>العمليات</th>
                </tr>
            </thead>

            <tbody>

                <?php if(isset($readings)): ?>
                    <?php $__currentLoopData = $readings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reading): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr class="odd" role="row">
                            <td>
                                <?php if(isset($reading->id)): ?>
                                    <?php echo e($reading->id); ?>

                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->pump->id)): ?>
                                    <?php echo e($reading->pump->id); ?>

                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->pump->tank->type)): ?>
                                    <?php if($reading->pump->tank->type == 0): ?>
                                        بترول
                                    <?php else: ?>
                                        ديزل
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->employee->name)): ?>
                                    <?php echo e($reading->employee->name); ?>

                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->created_at)): ?>
                                    <?php echo e(explode(' ', $reading->created_at)[0]); ?>

                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->start_of_day_read)): ?>
                                    <?php echo e($reading->start_of_day_read); ?>

                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->end_of_day_read)): ?>
                                    <?php echo e($reading->end_of_day_read); ?>

                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($reading->end_of_day_read)): ?>
                                    <?php if($reading->end_of_day_read!=0): ?>
                                            
                                            
                                            <?php if($reading->pump->type==-1 && $reading->pump->status==0): ?>
                                                <span class="text-danger">عجز</span>
                                            
                                            <?php elseif($reading->pump->type== 1 &&  $reading->pump->status==0): ?>
                                                <span class="text-success">فائض</span>

                                                    <?php else: ?>
                                                    -
                                                    <?php endif; ?>
                                        
                                    <?php else: ?>
                                    <?php if($reading->pump->status==-1 ||$reading->pump->status==1): ?>
                                         تحتاج معالجة
                                        <?php else: ?>
                                        <?php if(isset($reading->employee->name)): ?>
                                         جاهزة لإضافة قراءة المساء
                                         <?php else: ?>
                                         جاهزة  لإستلام عامل جديد
                                         <?php endif; ?>
                                         <?php endif; ?>
                                    <?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($reading->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($reading->end_of_day_read>0): ?>
                                        <button type="button" value="" data-id="<?php echo e($reading->id); ?>"
                                            data-confirm_type="1" data-title="طباعة سند تسليم طرمبة"
                                            data-route='<?php echo e(route('ReadingPrint',2)); ?>' 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($reading->id); ?>"
                                            data-end_of_day_read="<?php echo e($reading->end_of_day_read); ?>"
                                            data-start_of_day_read="<?php echo e($reading->start_of_day_read); ?>"
                                            
                                            class="editend dropdown-item"
                                            href="edit transaction-details.html"><i
                                                class="bi bi-pencil-square text-success ms-3"></i>
                                                تعديل قراءةالمساء
                                        </button>
                                        <?php elseif(($reading->pump->status==1 || $reading->pump->status==-1)&&$reading->end_of_day_read==0 ): ?>
                                        <span class="p-3 text-center dropdown-item">يجب معالجة الغجز أو الفائض من المدير</span>
                                        <?php elseif($reading->end_of_day_read===null): ?>
                                            <?php if($reading->pump->is_set_employee == 1): ?>
                                                <button type="button" value="" data-id="<?php echo e($reading->id); ?>"
                                                    data-confirm_type="1" data-title="طباعة سند استلام طرمبة"
                                                    data-route='<?php echo e(route('ReadingPrint',1)); ?>' 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($reading->id); ?>"
                                                    data-start_of_day_read="<?php echo e($reading->start_of_day_read); ?>"
                                                    class="reading dropdown-item" href="edit transaction-details.html">
                                                    <i class="mdi mdi-plus-circle  text-success ms-3"></i>
                                                        اضافة قراءة المساء
                                                </button> 
                                            <?php endif; ?>
                                            <button type="button" value="" data-id="<?php echo e($reading->id); ?>"
                                            data-start_of_day_read="<?php echo e($reading->start_of_day_read); ?>"
                                            data-pump_id="<?php echo e($reading->pump->id); ?>"
                                            data-employ_name="<?php if(isset($reading->employee->name)): ?><?php echo e($reading->employee->name); ?><?php endif; ?>"
                                            class="edit dropdown-item" href="edit transaction-details.html"><i
                                                class="bi bi-pencil-square text-success ms-3"></i>
                                                تعديل قراءةالصباح</button>
                                    <?php elseif($reading->end_of_day_read==0 || $reading->start_of_day_read==0): ?>
                                        <?php if(isset($reading->employee->name)): ?>
                                        <button type="button" value="" data-id="<?php echo e($reading->id); ?>"
                                            data-start_of_day_read="<?php echo e($reading->start_of_day_read); ?>"
                                            class="reading dropdown-item" href="edit transaction-details.html">
                                            <i class="mdi mdi-plus-circle  text-success ms-3"></i>
                                                اضافة قراءة المساء
                                        </button>
                                        <?php else: ?>
                                        <button type="button" value="" data-id="<?php echo e($reading->id); ?>"
                                            data-start_of_day_read="<?php echo e($reading->start_of_day_read); ?>"
                                            class="reading dropdown-item" href="edit transaction-details.html">
                                            <i class="mdi mdi-plus-circle  text-success ms-3"></i>تسليم الطرمبة</button>
                                        <?php endif; ?>
                                        <?php endif; ?>

                                    </div>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
<!--**********************************Table Allreading End***********************************-->
<?php /**PATH C:\Users\Nasser\Desktop\petrol_store\resources\views/readings/tables/all.blade.php ENDPATH**/ ?>