

<?php $__env->startSection('panel'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body p-0">
                    <div class="table-responsive--md table-responsive">
                        <table class="table--light style--two table">
                            <thead>
                                <tr>
                                    <th><?php echo app('translator')->get('Name'); ?></th>
                                    <th><?php echo app('translator')->get('Minimum Price'); ?></th>
                                    <th><?php echo app('translator')->get('Maximum Price'); ?></th>
                                    <th><?php echo app('translator')->get('Referral Commission'); ?></th>
                                    <th><?php echo app('translator')->get('Yield'); ?></th>
                                    <th><?php echo app('translator')->get('Status'); ?></th>
                                    <th><?php echo app('translator')->get('Action'); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td><?php echo e(__($plan->name)); ?></td>
                                        <td><?php echo e(showAmount($plan->minimum_amount)); ?> <?php echo e(__($general->cur_text)); ?></td>
                                        <td><?php echo e(showAmount($plan->maximum_amount)); ?> <?php echo e(__($general->cur_text)); ?></td>
                                        
                                        <td> <?php echo e(showAmount($plan->ref_com)); ?> %</td>

                                        <td>
                                            <?php echo e(showAmount($plan->profit)); ?> %
                                        </td>
                                        <td>
                                            <?php echo $plan->statusBadge ?>
                                        </td>

                                        <td>
                                            <button class="btn btn-sm btn-outline--primary edit" data-toggle="tooltip" data-id="<?php echo e($plan->id); ?>" data-name="<?php echo e($plan->name); ?>" data-bv="<?php echo e($plan->bv); ?>" data-minimum_amount="<?php echo e(getAmount($plan->minimum_amount)); ?>" data-maximum_amount="<?php echo e(getAmount($plan->maximum_amount)); ?>" data-ref_com="<?php echo e(getAmount($plan->ref_com)); ?>" data-profit="<?php echo e(getAmount($plan->profit)); ?>" data-original-title="<?php echo app('translator')->get('Edit'); ?>" type="button">
                                                <i class="la la-pencil"></i> <?php echo app('translator')->get('Edit'); ?>
                                            </button>

                                            <?php if($plan->status == Status::DISABLE): ?>
                                                <button class="btn btn-sm btn-outline--success ms-1 confirmationBtn" data-question="<?php echo app('translator')->get('Are you sure to enable this plan?'); ?>" data-action="<?php echo e(route('admin.plan.status', $plan->id)); ?>">
                                                    <i class="la la-eye"></i> <?php echo app('translator')->get('Enable'); ?>
                                                </button>
                                            <?php else: ?>
                                                <button class="btn btn-sm btn-outline--danger ms-1 confirmationBtn" data-question="<?php echo app('translator')->get('Are you sure to disable this plan?'); ?>" data-action="<?php echo e(route('admin.plan.status', $plan->id)); ?>">
                                                    <i class="la la-eye-slash"></i> <?php echo app('translator')->get('Disable'); ?>
                                                </button>
                                            <?php endif; ?>

                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td class="text-muted text-center" colspan="100%"><?php echo e(__($emptyMessage)); ?></td>
                                    </tr>
                                <?php endif; ?>

                            </tbody>
                        </table><!-- table end -->
                    </div>
                </div>
                <?php if($plans->hasPages()): ?>
                    <div class="card-footer py-4">
                        <?php echo paginateLinks($plans) ?>
                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>

    
    <div class="modal fade" id="edit-plan" role="dialog" tabindex="-1">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><?php echo app('translator')->get('Edit Plan'); ?></h5>
                    <button class="close" data-bs-dismiss="modal" type="button" aria-label="Close">
                        <i class="las la-times"></i>
                    </button>
                </div>
                <form method="post" action="<?php echo e(route('admin.plan.save')); ?>">
                    <?php echo csrf_field(); ?>
                    <div class="modal-body">
                        <input class="form-control plan_id" name="id" type="hidden">
                        <div class="row">
                            <div class="form-group col-md-12">
                                <label><?php echo app('translator')->get('Name'); ?></label>
                                <input class="form-control name" name="name" type="text" required>
                            </div>
                            
                        </div>
                         <div class="row">
                            <div class="form-group col-md-6">
                                <label> <?php echo app('translator')->get('Min Price'); ?> </label>
                                <div class="input-group">
                                    <span class="input-group-text"><?php echo e($general->cur_sym); ?></span>
                                    <input class="form-control minimum_amount" name="minamount" type="number" step="any" required>
                                </div>
                            </div>
                            <div class="form-group col-md-6">
                                <label> <?php echo app('translator')->get('Max Price'); ?> </label>
                                <div class="input-group">
                                    <span class="input-group-text"><?php echo e($general->cur_sym); ?></span>
                                    <input class="form-control maximum_amount" name="mixamount" type="number" step="any" required>
                                </div>
                            </div>
                            </div>
                    

                       <!-- <div class="form-group">
                            <label><?php echo app('translator')->get('Business Volume (BV)'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('When someone buys this plan, all of his ancestors will get this value which will be used for a matching bonus.'); ?>"></i>
                            <input class="form-control bv" name="bv" type="number" required>
                        </div> -->

                        <div class="form-group">
                            <label><?php echo app('translator')->get('Referral Commission'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('If a user who subscribed to this plan, refers someone and if the referred user buys a plan, then he will get this amount.'); ?>"></i>
                            <div class="input-group">
                                <span class="input-group-text"><?php echo e($general->cur_sym); ?></span>
                                <input class="form-control ref_com" name="ref_com" type="number" step="any" required>
                            </div>
                        </div>

                       <div class="form-group">
                            <label><?php echo app('translator')->get('ROI'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('When someone buys this plan, all of his ancestors will get this amount.'); ?>"></i>
                            <div class="input-group">
                                <span class="input-group-text">%</span>
                                <input class="form-control profit" name="profit" type="number" step="any" required>
                            </div>
                        </div> 
                        <div class="form-group">
                            <label><?php echo app('translator')->get('Date And Time'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('When someone buys this plan, all of his ancestors will get this amount.'); ?>"></i>
                            <input type="datetime-local" id="crontime" name="crontime">
                        </div> 
                         <div class="form-group col-xl-3 col-md- col-12">
                                <label><?php echo app('translator')->get('Cron'); ?> </label>
                                <input name="cron" data-width="100%" data-height="50" data-onstyle="-success" data-offstyle="-danger" data-bs-toggle="toggle" data-on="<?php echo app('translator')->get('On'); ?>" data-off="<?php echo app('translator')->get('OFF'); ?>" type="checkbox" <?php if($cron->cron == 1): ?> checked <?php endif; ?>>
                            </div>

                    </div>
                    <div class="modal-footer">
                        <button class="btn btn--primary w-100 h-45" type="submit"><?php echo app('translator')->get('Submit'); ?></button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="add-plan" role="dialog" tabindex="-1">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><?php echo app('translator')->get('Add New plan'); ?></h5>
                    <button class="close" data-bs-dismiss="modal" type="button" aria-label="Close">
                        <i class="las la-times"></i>
                    </button>
                </div>
                <form method="post" action="<?php echo e(route('admin.plan.save')); ?>">
                    <?php echo csrf_field(); ?>
                    <div class="modal-body">

                        <input class="form-control plan_id" name="id" type="hidden">
                        <div class="row">
                            <div class="form-group col-md-6">
                                <label><?php echo app('translator')->get('Name'); ?></label>
                                <input class="form-control" name="name" type="text" required>
                            </div>
                            <div class="form-group col-md-6">
                                <label><?php echo app('translator')->get('Price'); ?> </label>
                                <div class="input-group">
                                    <span class="input-group-text"><?php echo e($general->cur_sym); ?></span>
                                    <input class="form-control" name="price" type="number" step="any" required>
                                </div>
                            </div>
                        </div>
                        
                        
                    
                    
                    
                        <div class="form-group">
                            <label> <?php echo app('translator')->get('Business Volume (BV)'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('When someone buys this plan, all of his ancestors will get this value which will be used for a matching bonus.'); ?>"></i>
                            <input class="form-control" name="bv" type="number" type="number" required>
                        </div>
                        <div class="form-group">
                            <label> <?php echo app('translator')->get('Referral Commission'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('If a user who subscribed to this plan, refers someone and if the referred user buys a plan, then he will get this amount.'); ?>"></i>
                            <div class="input-group">
                                <span class="input-group-text"><?php echo e($general->cur_sym); ?></span>
                                <input class="form-control" name="ref_com" type="number" step="any" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label> <?php echo app('translator')->get('Tree Commission'); ?></label> <i class="fas fa-question-circle text--gray" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('When someone buys this plan, all of his ancestors will get this amount.'); ?>"></i>
                            <div class="input-group">
                                <span class="input-group-text"><?php echo e($general->cur_sym); ?></span>
                                <input class="form-control" name="tree_com" type="number" step="any" required>
                            </div>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <button class="btn btn--primary w-100 h-45" type="submit"><?php echo app('translator')->get('Submit'); ?></button>
                    </div>
                </form>

            </div>
        </div>
    </div>

    <?php if (isset($component)) { $__componentOriginalc51724be1d1b72c3a09523edef6afdd790effb8b = $component; } ?>
<?php $component = App\View\Components\ConfirmationModal::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('confirmation-modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\ConfirmationModal::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc51724be1d1b72c3a09523edef6afdd790effb8b)): ?>
<?php $component = $__componentOriginalc51724be1d1b72c3a09523edef6afdd790effb8b; ?>
<?php unset($__componentOriginalc51724be1d1b72c3a09523edef6afdd790effb8b); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('breadcrumb-plugins'); ?>
   <!-- <button class="btn btn-sm btn-outline--primary add-plan" type="button">
        <i class="la la-plus"></i><?php echo app('translator')->get('Add New'); ?>
    </button> -->
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script>
        "use strict";
        (function($) {
            $('.edit').on('click', function() {
                var modal = $('#edit-plan');
                modal.find('.name').val($(this).data('name'));
                modal.find('.minimum_amount').val($(this).data('minimum_amount'));
                modal.find('.maximum_amount').val($(this).data('maximum_amount'));
                modal.find('.bv').val($(this).data('bv'));
                modal.find('.ref_com').val($(this).data('ref_com'));
                modal.find('.profit').val($(this).data('profit'));
                modal.find('input[name=id]').val($(this).data('id'));
                modal.modal('show');
            });

            $('.add-plan').on('click', function() {
                var modal = $('#add-plan');
                modal.modal('show');
            });
        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/mez5ba60cfao/public_html/Files/core/resources/views/admin/plan/index.blade.php ENDPATH**/ ?>