<?php $__env->startSection('title', trans('front.settings')); ?>
<?php $__env->startSection('content'); ?>
    <section class="content">
        <div class="box box-primary">
            <form class="form-inputs" id="setting-form" action="<?php echo e(route('setting.edit')); ?>" method="post"
                enctype="multipart/form-data">
                <div class="box-body">
                    <div class="row">
                        <div class="col-md-12">
                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                            <div class="form-group">
                                <?php $__currentLoopData = $setting; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $set): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="form-group <?php echo e($set->key == 'InvoiceNotes' ? 'col-md-12' : 'col-md-6'); ?>">
                                        <label><?php echo e(trans('app.' . $set->key)); ?> :</label>
                                        <?php if($set->key == 'show_cost_price'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'productCost'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 'avg' ? 'selected=""' : ''); ?> value="avg">
                                                    <?php echo app('translator')->getFromJson('app.avg'); ?></option>
                                                <option <?php echo e($set->value == 'lastcost' ? 'selected=""' : ''); ?>

                                                    value="lastcost">
                                                    <?php echo app('translator')->getFromJson('app.lastcost'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'default_payment'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 'cash' ? 'selected=""' : ''); ?> value="cash">
                                                    <?php echo app('translator')->getFromJson('front.cash'); ?></option>
                                                <option <?php echo e($set->value == 'delayed' ? 'selected=""' : ''); ?>

                                                    value="delayed">
                                                    <?php echo app('translator')->getFromJson('front.Postpaid'); ?></option>
                                                <option <?php echo e($set->value == 'visa' ? 'selected=""' : ''); ?> value="visa">
                                                    <?php echo app('translator')->getFromJson('front.visa'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'canChangePrice'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'ShowCustomerPrice'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'rounding_up'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'subtract_expenses_profit'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'subtract_payment_from_invoice'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option value="2">تم إلغائها من ناحية المبرمج</option>
                                            </select>
                                        <?php elseif($set->key == 'show_profit_button'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'showImage'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'can_order_unavilable_qty'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'use_two_shipping_cost'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'sales_marketer'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'industrial'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.Commercial activity'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.Industrial activity'); ?></option>
                                                <option <?php echo e($set->value == 3 ? 'selected=""' : ''); ?> value="3">نشاط طبي
                                                </option>
                                            </select>
                                        <?php elseif($set->key == 'show_category_in_invoice'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'show_stores_in_invoices'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'enable_empty_invoice'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'enable_edit_date'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'use_sales'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'use_bounse'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'logo'): ?>
                                            <input type="file" class="form-control" name="logo">
                                            <?php if($set->value): ?>
                                                <div class="pull-left">
                                                    <img style="width: 150px;"
                                                        src="<?php echo e(\Illuminate\Support\Facades\Storage::url($set->value)); ?>">
                                                    <a class="btn btn-danger" href="<?php echo e(route('deleteLogo')); ?>"><i
                                                            class="fa fa-trash"></i></a>
                                                </div>
                                            <?php endif; ?>
                                        <?php elseif($set->key == 'signture'): ?>
                                            <input type="file" class="form-control" name="signture">
                                            <?php if($set->value): ?>
                                                <div class="pull-left">
                                                    <img style="width: 150px;"
                                                        src="<?php echo e(\Illuminate\Support\Facades\Storage::url($set->value)); ?>">
                                                </div>
                                            <?php endif; ?>
                                        <?php elseif($set->key == 'size'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 12 ? 'selected=""' : ''); ?> value="12">12
                                                </option>
                                                <option <?php echo e($set->value == 13 ? 'selected=""' : ''); ?> value="13">13
                                                </option>
                                                <option <?php echo e($set->value == 14 ? 'selected=""' : ''); ?> value="14">14
                                                </option>
                                                <option <?php echo e($set->value == 15 ? 'selected=""' : ''); ?> value="15">15
                                                </option>
                                                <option <?php echo e($set->value == 16 ? 'selected=""' : ''); ?> value="16">16
                                                </option>
                                                <option <?php echo e($set->value == 18 ? 'selected=""' : ''); ?> value="18">18
                                                </option>
                                                <option <?php echo e($set->value == 20 ? 'selected=""' : ''); ?> value="20">20
                                                </option>
                                            </select>
                                        <?php elseif($set->key == 'PrintSize'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 8 ? 'selected=""' : ''); ?> value="8">8
                                                </option>
                                                <option <?php echo e($set->value == 10 ? 'selected=""' : ''); ?> value="10">10
                                                </option>
                                                <option <?php echo e($set->value == 12 ? 'selected=""' : ''); ?> value="12">12
                                                </option>
                                                <option <?php echo e($set->value == 13 ? 'selected=""' : ''); ?> value="13">13
                                                </option>
                                                <option <?php echo e($set->value == 14 ? 'selected=""' : ''); ?> value="14">14
                                                </option>
                                                <option <?php echo e($set->value == 15 ? 'selected=""' : ''); ?> value="15">15
                                                </option>
                                                <option <?php echo e($set->value == 16 ? 'selected=""' : ''); ?> value="16">16
                                                </option>
                                                <option <?php echo e($set->value == 18 ? 'selected=""' : ''); ?> value="18">18
                                                </option>
                                                <option <?php echo e($set->value == 20 ? 'selected=""' : ''); ?> value="20">20
                                                </option>
                                            </select>
                                        <?php elseif($set->key == 'use_barcode'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'show_profit'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'can_sell_loss'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 2 ? 'selected=""' : ''); ?> value="2">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'show_shipment_company'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'show_all_products_returns'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'use_color_size_qty'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 1 ? 'selected=""' : ''); ?> value="1">
                                                    <?php echo app('translator')->getFromJson('app.yes'); ?></option>
                                                <option <?php echo e($set->value == 0 ? 'selected=""' : ''); ?> value="0">
                                                    <?php echo app('translator')->getFromJson('app.no'); ?></option>
                                            </select>
                                        <?php elseif($set->key == 'printerType'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 'A4' ? 'selected=""' : ''); ?> value="A4">A4
                                                </option>
                                                <option <?php echo e($set->value == 'A5' ? 'selected=""' : ''); ?> value="A5">A5
                                                </option>
                                                <option <?php echo e($set->value == 'receipt' ? 'selected=""' : ''); ?>

                                                    value="receipt">
                                                    Small Receipt</option>
                                            </select>
                                        <?php elseif($set->key == 'PriceIncludesTax'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 'yes' ? 'selected=""' : ''); ?> value="yes">
                                                    Yes
                                                </option>
                                                <option <?php echo e($set->value == 'no' ? 'selected=""' : ''); ?> value="no">No
                                                </option>
                                            </select>
                                        <?php elseif($set->key == 'POSprinterType'): ?>
                                            <select class="form-control" name="<?php echo e($set->key); ?>">
                                                <option <?php echo e($set->value == 'A4' ? 'selected=""' : ''); ?> value="A4">A4
                                                </option>
                                                <option <?php echo e($set->value == 'A5' ? 'selected=""' : ''); ?> value="A5">A5
                                                </option>
                                                <option <?php echo e($set->value == 'receipt' ? 'selected=""' : ''); ?>

                                                    value="receipt">
                                                    Small Receipt</option>
                                            </select>
                                        <?php elseif($set->key != 'InvoiceNotes'): ?>
                                            <input class="form-control" type="text" name="<?php echo e($set->key); ?>"
                                                value="<?php echo e(old($set->key, $set->value)); ?>">
                                        <?php else: ?>
                                            <textarea id="editor" class="form-control editor" name="<?php echo e($set->key); ?>"><?php echo e(old($set->key, $set->value)); ?></textarea>
                                        <?php endif; ?>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box-footer">
                    <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('front.save'); ?></button>
                </div>
            </form>
        </div>
    </section>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('js'); ?>
    <script src="<?php echo e(asset('ckeditor/ckeditor.js')); ?>"></script>
    <script>
        CKEDITOR.replace('editor');
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>