<?php $__env->startSection('panel'); ?>


    <div class="row">

        <div class="col-md-12">
            <div class="card">


                <div class="card-body">

                    <form method="post" class="form-horizontal" action="<?php echo e(route('admin.plan-update', $plan->id)); ?>">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('put'); ?>

                        <div class="form-body">

                            <div class="form-row">

                                <div class="form-group col-md-3">
                                    <strong>Plan Name</strong>
                                    <input type="text" class="form-control" name="name" value="<?php echo e($plan->name); ?>" required>
                                </div>


                                <div class="form-group col-md-3">
                                    <strong>Amount Type</strong>
                                    <input data-toggle="toggle" id="amount" class="amount" data-onstyle="success"
                                           data-offstyle="info" data-on="Fixed" data-off="Range" data-width="100%" type="checkbox" <?php echo e($plan->fixed_amount != 0 ? 'checked': ''); ?> name="amount_type">
                                </div>

                                <div class="form-group offman col-md-3">
                                    <strong>Minimum Amount</strong>
                                    <div class="input-group">
                                        <input type="text" class="form-control" value="<?php echo e($plan->minimum); ?>" name="minimum">
                                        <div class="input-group-append">
                                            <div class="input-group-text"><?php echo e($general->cur_sym); ?></div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group offman col-md-3" >
                                    <strong>Maximum Amount</strong>
                                    <div class="input-group">
                                        <input type="text" class="form-control" value="<?php echo e($plan->maximum); ?>" name="maximum">
                                        <div class="input-group-append">
                                            <div class="input-group-text"><?php echo e($general->cur_sym); ?></div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group onman col-md-3" style="display: none">
                                    <strong> Amount</strong>
                                    <div class="input-group">
                                        <input type="text" class="form-control" value="<?php echo e($plan->fixed_amount); ?>" name="amount">
                                        <div class="input-group-prepend">
                                            <div class="input-group-text"><?php echo e($general->cur_sym); ?></div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group  col-md-3" >
                                    <strong> Coins</strong>
                                    <div class="input-group">
                                        <input type="text" class="form-control" value="<?php echo e($plan->coins); ?>" name="coins">
                                    </div>
                                </div>

                                <div class="form-group  col-md-3" >
                                    <strong>Tokens</strong>
                                    <div class="input-group">
                                        <input type="text" class="form-control" value="<?php echo e($plan->tokens); ?>" name="tokens">
                                    </div>
                                </div>

                                <div class="form-group col-md-3">
                                    <strong>Return /Interest</strong>
                                    <div class="input-group">
                                        <input type="text" class="form-control"  name="interest"  value="<?php echo e($plan->interest); ?>" required>
                                        <div class="input-group-append" style="height: 45px">
                                            <div class="input-group-text">
                                                <select name="interest_status" class="form-control" style="height: 35px !important;">
                                                    <option <?php echo e($plan->interest_status == '1'? 'selected': ''); ?> value="%">%</option>
                                                    <option <?php echo e($plan->interest_status == '0'? 'selected': ''); ?> value="<?php echo e($general->cur_sym); ?>"><?php echo e($general->cur_sym); ?></option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group col-md-3">
                                    <strong>Every</strong>
                                    <select class="form-control" name="times">
                                        <?php $__currentLoopData = $time; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option <?php echo e($plan->times == $data->time? 'selected': ''); ?> value="<?php echo e($data->time); ?>"><?php echo e($data->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>



                                <div class="form-group col-md-3">
                                    <strong>Return For</strong>
                                    <input data-toggle="toggle" id="lifetime" class="lifetime" data-onstyle="success" data-offstyle="danger"
                                           data-on="Period" data-off="Lifetime" data-width="100%" type="checkbox" <?php echo e($plan->lifetime_status == 0? 'checked':''); ?> name="lifetime_status" >
                                </div>


                                <div class="form-group return col-md-3" style="display: none">
                                    <div class="form-group">
                                        <strong>How Many Times</strong>
                                        <input type="text" class="form-control" value="<?php echo e($plan->repeat_time); ?>" name="repeat_time">
                                    </div>
                                </div>

                                <div class="form-group col-md-3" id="capitalBack">
                                    <strong>Capital Back</strong>
                                    <input data-toggle="toggle" data-onstyle="success" <?php echo e($plan->capital_back_status == 1? 'checked':''); ?> data-offstyle="danger"
                                           data-on="Yes" data-off="No" data-width="100%" type="checkbox" name="capital_back_status" >
                                </div>

                                <div class="form-group col-md-3" >
                                    <strong>Status</strong>
                                    <input data-toggle="toggle" data-onstyle="success" <?php echo e($plan->status == 1? 'checked':''); ?> data-offstyle="danger"
                                           data-on="Active" data-off="Disable" data-width="100%" type="checkbox" name="status" >
                                </div>

                                <div class="form-group col-md-3" >
                                    <strong>Featured</strong>
                                    <input data-toggle="toggle" data-onstyle="success" <?php echo e($plan->featured == 1? 'checked':''); ?> data-offstyle="danger"
                                           data-on="Yes" data-off="No" data-width="100%" type="checkbox" name="featured" >
                                </div>



                            </div>

                        </div>

                        <div class="col-md-12">

                            <button type="submit" class="btn btn-primary btn-block">Update</button>

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

    </div>


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

<?php $__env->startPush('breadcrumb-plugins'); ?>
    <a href="<?php echo e(route('admin.plan-setting')); ?>"  class="btn btn-success"><i class="fa fa-fw fa-eye"></i>Plan List</a>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script>
        $(document).ready(function () {


            if ($('#amount').prop('checked') == false){
                $('.offman').css('display', 'block');
                $('.onman').css('display', 'none');
            }else {
                $('.offman').css('display', 'none');
                $('.onman').css('display', 'block');
            }

            if ($('#lifetime').prop('checked') == true){
                $('.return').css('display', 'block');
            }else {
                $('.return').css('display', 'none');
            }


            $('#amount').on('change', function () {
                var isCheck = $(this).prop('checked');
                if (isCheck == false)
                {
                    $('.offman').css('display', 'block');
                    $('.onman').css('display', 'none');
                }else {
                    $('.offman').css('display', 'none');
                    $('.onman').css('display', 'block');
                }
            });

            $('#lifetime').on('change', function () {
                var isCheck = $(this).prop('checked');
                if (isCheck == true)
                {
                    $('.return').css('display', 'block');

                }else {

                    $('.return').css('display', 'none');

                }
            });




        })
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\market\resources\views/admin/plan/edit.blade.php ENDPATH**/ ?>