

<?php $__env->startSection('title'); ?>
    صرف للعميل
<?php $__env->stopSection(); ?>

<?php $__env->startSection('first-css'); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('header-content'); ?>
    صرف من الحساب
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-body'); ?>
    <!--**********************************
                        Content body start
                    ***********************************-->
    <!-- row -->
    <?php echo $__env->make('massages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php if(session()->has('success')): ?>
    <div data-success="success" class="alert alert-success alert-dismissible bg-success text-white border-0 fade show"
        role="alert">
        <strong id="successm" ><?php echo e(session()->get('success')); ?></strong>
    </div>

<?php elseif(session()->has('error')): ?>

    <div class="alert alert-danger alert-dismissible bg-danger text-white border-0 fade show"
        role="alert">
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
        <strong id="errorm"><?php echo e(session()->get('error')); ?></strong>
    </div>
<?php endif; ?>
    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <h4 class="card-title">صرف من الحساب </h4>
                        <?php echo $__env->make('massages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </div>
                    <div class="card-body">
                        <div class="form-validation">
                            <form class="needs-validation validation" novalidate="" method="post"
                                action="<?php echo e(route('spentFromAccount')); ?>">
                                <?php echo csrf_field(); ?>
                                <div class="row">
                                    <div class="col-xl-6">
                                        <div class="mb-3 row">
                                            <label class="col-lg-4 col-form-label titleInput" for="validationCustom05">النوع
                                                <span class="text-danger">*</span>
                                            </label>
                                            <div class="col-lg-6">
                                                <select name="type" id="type" onchange="functionSelect()"
                                                    class="form-control form-white form-control-sm inputRead" id="validationCustom05"
                                                    required>
                                                    <option value="" selected="selected" disabled="disabled">الرجاء
                                                        اختيار احدى الأنواع</option>
                                                    <option value="0">بترول</option>
                                                    <option value="1">ديزل</option>

                                                </select>
                                                <div class="invalid-feedback">
                                                    الرجاء اختيار احدى الخيارات الموجودة
                                                </div>

                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-lg-4 col-form-label titleInput" for="validationCustom05">الطرمبة
                                                <span class="text-danger">*</span>
                                            </label>
                                            <div class="col-lg-6">
                                                <select   class="form-control form-white inputRead" data-placeholder="Choose a color..."
                                                    name="pumpId"  id="pumpList" required>
                                                    <option selected disabled value="">اختار رقم الطرمبة</option>
                                                    <?php $__currentLoopData = $pumps; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pump): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($pump->is_active == 1 && $pump->status == 0 && $pump->is_set_reading == 1 && $pump->is_set_employee == 1): ?>
                                                            <option  hidden value="<?php echo e($pump->id); ?>"  data-type_pupm="<?php echo e($pump->tank->type); ?>" class="account_cl">
                                                                الطرمبة رقم.<?php echo e($pump->id); ?>

                                                                <?php if($pump->tank->type == 0): ?>
                                                                    بترول
                                                                <?php else: ?>
                                                                    ديزل
                                                                <?php endif; ?>
                                                            </option>
                                                        <?php elseif($pump->status == 1): ?>
                                                            <option   data-type_pupm="<?php echo e($pump->tank->type); ?>" value="<?php echo e($pump->id); ?>" disabled style="color:red;" class="pupm">

                                                                الطرمبة رقم.<?php echo e($pump->id); ?> عليها فائض
                                                            </option>
                                                        <?php elseif($pump->status == -1): ?>
                                                            <option class="account_cl"   data-type_pupm="<?php echo e($pump->tank->type); ?>" value="<?php echo e($pump->id); ?>" disabled style="color:red;">
                                                                الطرمبة رقم.<?php echo e($pump->id); ?> عليها عجز
                                                            </option>
                                                         <?php elseif($pump->is_set_reading == 0): ?>
                                                            <option   class="account_cl" data-type_pupm="<?php echo e($pump->tank->type); ?>" value="<?php echo e($pump->id); ?>" disabled style="color:red;">
                                                                الطرمبة رقم.<?php echo e($pump->id); ?>  لم يتم ادخال قراءة ابتدائيه لها
                                                            </option>
                                                        <?php elseif($pump->is_set_employee == 0): ?>
                                                            <option  class="account_cl" data-type_pupm="<?php echo e($pump->tank->type); ?>"  value="<?php echo e($pump->id); ?>" disabled style="color:red;">
                                                                الطرمبة رقم.<?php echo e($pump->id); ?>  لم يتم تحديد عامل لها
                                                            </option>

                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                                <div class="invalid-feedback">
                                                    الرجاء اختيار احدى الخيارات الموجودة
                                                </div>
                                            </div>
                                        </div>

                                        <div class="mb-3 row">
                                            <label class="col-lg-4 col-form-label titleInput" for="validationCustom02">ملاحظة لعملية الصرف<span class="text-danger">*</span>
                                            </label>
                                            <div class="col-lg-6">
                                                <input name="notice" value="<?php echo e(old('notice')); ?>" type="text" class="form-control form-control-sm inputRead" id="validationCustom02" placeholder="بتوجيه من ...." required="">
                                                <div class="invalid-feedback">
                                                    الرجاء ادخال  ملاحظة لعملية الصرف
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-xl-6">
                                        <div class="mb-3 row">
                                            <label class="col-lg-4 col-form-label titleInput" for="validationCustom01">اسم العميل<span
                                                    class="text-danger">*</span>
                                            </label>
                                            <div class="col-lg-6">
                                                <select class="form-control form-white inputChecked inputRead"
                                                    data-placeholder="Choose a color..." id="dieselSelectList"
                                                    name="name"
                                                    required>
                                                    <option disabled selected value="">الرجاء اختيار احد العملاء
                                                    </option>
                                                    <?php $__currentLoopData = $clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $client): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        
                                                        <?php if($client->balance>1): ?>
                                                        <option hidden value="<?php echo e($client->name); ?>"
                                                            class="account_clint p-2">
                                                            <?php echo e($account->deleteTypeAccount($client->name)); ?>

                                                            متبقي له <?php echo e($client->balance); ?> لتر </option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                                <div class="invalid-feedback">
                                                    الرجاء ادخال اسم
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-lg-4 col-form-label titleInput" for="validationCustom06">الكمية
                                                <span class="text-danger">*</span>
                                            </label>
                                            <div class="col-lg-6">
                                                <input name="quantity" type="number" class="form-control form-control-sm inputChecked inputRead"
                                                    id="validationCustom06" placeholder="ادخل الكمية" required="">
                                                <div class="invalid-feedback">
                                                    الرجاء ادخل الكمية بشكل صحيح
                                                </div>
                                            <div class="errorMassege" style="color: red;font-size: 0.875em;margin-top: 0.25rem"></div>
                                            </div>
                                        </div>



                                        <div class="mb-3 row">
                                            <div class="col-lg-5 me-auto">
                                                <button type="button" class="btn btn-primary btnValidation showModal"
                                                data-title="هل انت متأكد من صرف هذه الكمية ؟">صرف</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <?php echo $__env->make('print_confirmation.print_confirmation', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>

    </div>

    <!--**********************************
                        Content body end
                    ***********************************-->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="<?php echo e(asset('/js/selected/selectedpump.js')); ?>"></script>
    <script src="<?php echo e(asset('/vendor/datatables/js/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('/js/plugins-init/datatables.init.js')); ?>"></script>
    <script src="<?php echo e(asset('/js/validation.js')); ?>"></script>
    <script src="<?php echo e(asset('/js/validation/validationQuantity.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Nasser\Desktop\petrol_store\resources\views/spentFromAccount.blade.php ENDPATH**/ ?>