<?php
    $type = $bank->type?:$type;
?>
<section class="content">
    <div class="box box-primary">
            <div class="box-body">
                <?php if($type==1): ?>
                <div class="row">
                    <div class="col-md-4">
                        <input name="type" type="hidden" value="<?php echo e($bank->type?:$type); ?>">
                        <div class="form-group">
                            <label><?php echo app('translator')->getFromJson('front.bankname'); ?></label>
                            <input value="<?php echo e($bank->name); ?>" required name="name" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label><?php echo app('translator')->getFromJson('front.accountNumber'); ?></label>
                            <input value="<?php echo e($bank->number); ?>" required name="number" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label><?php echo app('translator')->getFromJson('front.currency'); ?></label>
                            <select style="width: 100%" name="currency" class="form-control select2">
                            <?php $__currentLoopData = currency()->getActiveCurrencies(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option  <?php echo e($bank->currency==$currency['code']?'selected':''); ?> value="<?php echo e($currency['code']); ?>"><?php echo e($currency['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label><?php echo app('translator')->getFromJson('front.balance'); ?></label>
                            <input <?php echo e($bank->id?'readonly':''); ?>  value="<?php echo e($bank->balance); ?>" required name="balance" type="number" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label><?php echo app('translator')->getFromJson('front.discountvisa'); ?></label>
                            <div class="input-group">
                                <input value="<?php echo e($bank->percent); ?>" required name="percent" type="number" step="0.01"  class="form-control">
                                <div class="input-group-addon">
                                    <i class="fa fa-percent"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php else: ?>
                    <div class="row">
                        <div class="col-md-12">
                            <input name="type" type="hidden" value="<?php echo e($bank->type?:$type); ?>">
                            <div class="form-group">
                                <label><?php echo app('translator')->getFromJson('front.name'); ?></label>
                                <input value="<?php echo e($bank->name); ?>" required name="name" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label><?php echo app('translator')->getFromJson('front.balance'); ?></label>
                                <input <?php echo e($bank->id?'readonly':''); ?>    value="<?php echo e($bank->balance); ?>" required name="balance" type="number" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label><?php echo app('translator')->getFromJson('front.currency'); ?></label>
                                <select style="width: 100%" name="currency" class="form-control select2">
                                    <?php $__currentLoopData = currency()->getActiveCurrencies(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option  <?php echo e($bank->currency==currency()->getUserCurrency()?'selected':''); ?> value="<?php echo e($currency['code']); ?>"><?php echo e($currency['name']); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
                <!-- /.row -->
            </div>
            <!-- /.box-body -->
            <div class="box-footer">
                <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('front.save'); ?></button>
            </div>
        </div>
</section>
<script>
    $('form').validator();
    $(".select2").select2();
</script>
