<?php $__env->startSection('css'); ?>
    <?php echo toastr_css(); ?>
    <link href="<?php echo e(URL::asset('assets/plugins/fileuploads/css/fileupload.css')); ?>" rel="stylesheet" type="text/css" />
    <!---Internal Fancy uploader css-->
    <link href="<?php echo e(URL::asset('assets/plugins/fancyuploder/fancy_fileupload.css')); ?>" rel="stylesheet" />
<?php $__env->startSection('title'); ?>
    Idea - Payments
<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-header'); ?>
<!-- breadcrumb -->
<?php $__env->startSection('PageTitle'); ?>
    Payments
<?php $__env->stopSection(); ?>
<!-- breadcrumb -->
<div class="page-title">
    <div class="row">
        <div class="col-sm-6">
            <h4 class="mb-0"> Payments</h4>
        </div>
        <div class="col-sm-6">
            <ol class="breadcrumb pt-0 pr-0 float-left float-sm-right ">
                <li class="breadcrumb-item"><a href="#"
                        class="default-color"><?php echo e(trans('main_trans.Dashboard')); ?></a></li>
                <li class="breadcrumb-item active"> Add Payments</li>
            </ol>
        </div>
    </div>
</div>
<!-- breadcrumb -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<!-- row -->
<div class="row">
    <div class="col-md-12 mb-30">
        <a href="<?php echo e(route('payments.index')); ?>">
            <button type="button" class="btn btn-primary l-t-20">
                <?php echo e(trans('main_trans.back')); ?>

            </button>
        </a>
        <br><br>
        <div class="card card-statistics h-100">
            <div class="card-body">
                <div class="card-body">
                    <div class="tab nav-border">
                        <ul class="nav nav-tabs" role="tablist">
                            <li class="nav-item">
                                <a class="nav-link active show" id="home-02-tab" data-toggle="tab" href="#home-02"
                                    role="tab" aria-controls="home-02" aria-selected="true">2025 Contract
                                </a>
                            </li>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?>
                                <li class="nav-item">
                                    <a class="nav-link" id="profile-02-tab" data-toggle="tab" href="#profile-02"
                                        role="tab" aria-controls="profile-02" aria-selected="false">2026 Contract</a>
                                </li>
                            <?php endif; ?>
                        </ul>
                        <div class="tab-content">
                            <?php if($errors->any()): ?>
                                <div class="alert alert-danger">
                                    <ul>
                                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <li><?php echo e($error); ?></li>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </ul>
                                </div>
                            <?php endif; ?>
                            
                            <div class="tab-pane fade active show" id="home-02" role="tabpanel"
                                aria-labelledby="home-02-tab">

                                <?php echo Form::open(['route' => 'payments.store', 'autocomplete' => 'off', 'files' => 'ture']); ?>


                                <?php echo csrf_field(); ?>

                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>Item name : <span class="text-danger">*</span></label>
                                            <select name="lab" id="lab" class="custom-select"
                                                class="custom-select" aria-label="Default select example">
                                                <option selected disabled><?php echo e(trans('main_trans.Choose')); ?></option>
                                                <?php $__currentLoopData = $labs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($key); ?>"><?php echo e($value); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <label>Code name : <span class="text-danger">*</span></label>
                                            <select name="code" id="code" class="custom-select"
                                                class="custom-select" aria-label="Default select example">
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <label>Amount : <span class="text-danger">*</span></label>
                                            <input class="form-control" name="amount" type="number"
                                                value="<?php echo e(old('amount')); ?>">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <label>Quantity : <span class="text-danger">*</span></label>
                                            <input class="form-control" name="qty" type="number"
                                                value="<?php echo e(old('qty')); ?>">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <label for="note">Note</label>
                                            <textarea name="note" class="form-control" rows="4"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <p class="text-danger">* File PDF </p>
                                <div class="row">

                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <label for="file">File : <span class="text-danger">*</span></label>
                                            <input type="file" name="file" class="dropify" accept="pdf/*"
                                                data-height="70" />
                                        </div>
                                    </div>
                                </div><br>
                                <div class="d-flex justify-content-center">
                                    <button type="submit" class="btn btn-primary btn-lg"> Add Payment</button>
                                </div>
                                <?php echo Form::close(); ?>


                            </div>
                            
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?>
                                <div class="tab-pane fade" id="profile-02" role="tabpanel"
                                    aria-labelledby="profile-02-tab">
                                    <?php echo Form::open(['route' => 'payments.store', 'autocomplete' => 'off', 'files' => 'ture']); ?>


                                    <?php echo csrf_field(); ?>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label>Item name : <span class="text-danger">*</span></label>
                                                <select name="lab" id="lab" class="custom-select"
                                                    class="custom-select" aria-label="Default select example">
                                                    <option selected disabled><?php echo e(trans('main_trans.Choose')); ?></option>
                                                    <?php $__currentLoopData = $labs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($key); ?>"><?php echo e($value); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-8">
                                            <div class="form-group">
                                                <label>Code name : <span class="text-danger">*</span></label>
                                                <select name="code" id="code" class="custom-select"
                                                    class="custom-select" aria-label="Default select example">
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-8">
                                            <div class="form-group">
                                                <label>Amount : <span class="text-danger">*</span></label>
                                                <input class="form-control" name="amount" type="number"
                                                    value="<?php echo e(old('amount')); ?>">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-8">
                                            <div class="form-group">
                                                <label>Quantity : <span class="text-danger">*</span></label>
                                                <input class="form-control" name="qty" type="number"
                                                    value="<?php echo e(old('qty')); ?>">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-8">
                                            <div class="form-group">
                                                <label for="note">Note</label>
                                                <textarea name="note" class="form-control" rows="4"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <p class="text-danger">* File PDF </p>
                                    <div class="row">

                                        <div class="col-md-8">
                                            <div class="form-group">
                                                <label for="file">File : <span class="text-danger">*</span></label>
                                                <input type="file" name="file" class="dropify" accept="pdf/*"
                                                    data-height="70" />
                                            </div>
                                        </div>
                                    </div><br>
                                    <div class="d-flex justify-content-center">
                                        <button type="submit" class="btn btn-primary btn-lg"> Add Payment</button>
                                    </div>
                                    <?php echo Form::close(); ?>


                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- row closed -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<?php echo toastr_js(); ?>
<?php echo app('toastr')->render(); ?>
<script src="<?php echo e(URL::asset('assets/plugins/fileuploads/js/fileupload.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/fileuploads/js/file-upload.js')); ?>"></script>
<!--Internal Fancy uploader js-->
<script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.ui.widget.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.fileupload.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.iframe-transport.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.fancy-fileupload.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/fancy-uploader.js')); ?>"></script>

<script>
    $(document).ready(function() {

        $('select[name="lab"]').on('change', function() {

            var lab = $(this).val();

            if (lab) {

                $.ajax({
                    url: '/getcodes/' + lab,
                    type: 'GET',
                    dataType: 'json',
                    success: function(data) {
                        console.log(data);
                        $('select[name="code"]').empty();
                        $.each(data, function(key, value) {
                            $('select[name="code"]')
                                .append('<option value="' + key + '">' + value +
                                    '</option>');
                        });
                    }

                });

            } else {
                $('select[name="code"]').empty();
            }

        });
    });
</script>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Mustafa\Certificates\resources\views/pages/Payments/create.blade.php ENDPATH**/ ?>