@extends('layouts.admin.e-commerce.app')

@section('title', 'Settings')




@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6 offse">
                <h1>Setting - <small>Shop</small></h1>
            </div>
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="{{routeHelper('dashboard')}}">Home</a></li>
                    <li class="breadcrumb-item active">My Profile</li>
                </ol>
            </div>
        </div>
    </div><!-- /.container-fluid -->
</section>

<!-- Main content -->
<section class="content">
    <div class="card">
        <div class="card-header">
            <h3 class="card-title">Application Layout</h3>
        </div>
        <div class="card-body">
            <div class="row">

                <div class="col-sm-8 offset-md-2">
                    <!-- Default box -->
                    <div class="card card-success">
                        <div class="card-header">
                            <h3 class="card-title">Setting - Shop</h3>
                        </div>
                        <!-- /.card-header -->
                        <!-- form start -->
                        <form id="shopSettingsForm" action="{{routeHelper('setting')}}" method="POST">
                            @csrf
                            @method('PUT')
                            <input type="hidden" name="type" value="10">
                            <div class="card-body">

                                <ul class="form-row">
                                    <li class="bg-light p-2 mb-1 col-12"><b>Admin Settings</b></li>
                                    <li class="col-12 col-md-12 form-group">
                                        <label for="ADMIN_BAR" class="text-capitalize">Admin Bar</label>
                                        <select class="form-control w-25" name="ADMIN_BAR" id="ADMIN_BAR">
                                            <option @if (empty(setting('ADMIN_BAR')) OR setting('ADMIN_BAR') == "1") selected class="bg-success" @endif value="1">On</option>
                                            <option @if (setting('ADMIN_BAR') == "0") selected class="bg-success" @endif value="0">Off</option>
                                        </select>
                                    </li>
                                    <li class="col-12 col-md-6 form-group">
                                        <label for="ALL_PRODUCTS_LOAD_SINGLE_DB_REQ" class="text-capitalize"><a href="/admin/product">All products loading single request DB - (Dashboard Product Section)</a></label>
                                        <select class="form-control w-25" name="ALL_PRODUCTS_LOAD_SINGLE_DB_REQ" id="ALL_PRODUCTS_LOAD_SINGLE_DB_REQ">
                                            <option @if (setting('ALL_PRODUCTS_LOAD_SINGLE_DB_REQ') == "1") selected class="bg-success" @endif value="1">On</option>
                                            <option @if (empty(setting('ALL_PRODUCTS_LOAD_SINGLE_DB_REQ')) OR setting('ALL_PRODUCTS_LOAD_SINGLE_DB_REQ') == "0") selected class="bg-success" @endif value="0">Off</option>
                                        </select>
                                    </li>
                                    <li class="col-12 col-md-6 form-group">
                                        <label for="ALL_PRODUCTS_PER_PAGE" class="text-capitalize"><a href="/admin/product">Per page - (Dashboard Product Section)</a></label>
                                        <input class="form-control" type="number" id="ALL_PRODUCTS_PER_PAGE" name="ALL_PRODUCTS_PER_PAGE" value="{{ setting('ALL_PRODUCTS_PER_PAGE') ?? 10 }}">
                                    </li>
                                </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Checkout</b></li>
                                        <li class="col-12 col-md-3 form-group">
                                            <label for="GUEST_CHECKOUT" class="text-capitalize">Gust Checkout</label>
                                            <select class="form-control" name="GUEST_CHECKOUT" id="GUEST_CHECKOUT">
                                                <option class="bg-info" value="{{ $GUEST_CHECKOUT->value }}">{{ ($GUEST_CHECKOUT->value == 1 ? "On"  : "Off" ) }}</option>
                                                <option value="1">On</option>
                                                <option value="0">Off</option>
                                            </select>
                                        </li>

                                        <li class="col-12 col-md-3 form-group">
                                            <label for="CHECKOUT_TYPE" class="text-capitalize">Checkout Type</label>
                                            <select class="form-control" name="CHECKOUT_TYPE" id="CHECKOUT_TYPE">
                                                <option class="bg-info" value="{{ setting('CHECKOUT_TYPE') ?? 0 }}">{{ (setting('CHECKOUT_TYPE')== 1 ? "Complex"  : "Minimal" ) }}</option>
                                                <option value="1">Complex</option>
                                                <option value="0">Minimal</option>
                                            </select>
                                        </li>
                                        <li class="col-12 col-md-3 form-group">
                                            <label for="phone_min_dgt" class="text-capitalize">Phone Number Minimum Digit</label>
                                            <input class="form-control" type="number" id="phone_min_dgt" name="phone_min_dgt" value="{{ setting('phone_min_dgt') ?? 11 }}">
                                        </li>

                                        <li class="col-12 col-md-3 form-group">
                                            <label for="phone_max_dgt" class="text-capitalize">Phone Number Maximum Digit</label>
                                            <input class="form-control" type="number" id="phone_max_dgt" name="phone_max_dgt" value="{{ setting('phone_max_dgt') ?? 11 }}">
                                        </li>
                                        <li class="col-6 col-md-3 form-group">
                                            <label for="EMAIL_VISIBLE_WHILE_CHECKOUT" class="text-capitalize">Visibility email in checkout form: </label>
                                            <select class="form-control" name="EMAIL_VISIBLE_WHILE_CHECKOUT" id="EMAIL_VISIBLE_WHILE_CHECKOUT">
                                                <option @if (setting('EMAIL_VISIBLE_WHILE_CHECKOUT') == 1 || setting('EMAIL_VISIBLE_WHILE_CHECKOUT') == NULL) selected class="bg-success" @endif value="1">Yes</option>
                                                <option @if (setting('EMAIL_VISIBLE_WHILE_CHECKOUT') == "0") selected class="bg-success" @endif value="0">No</option>
                                            </select>
                                        </li>

                                        <li class="col-6 col-md-3 form-group">
                                            <label for="REQUIRED_EMAIL_ADDRESS_WHILE_CHECKOUT" class="text-capitalize">Required Email Address While Checkout: </label>
                                            <select class="form-control" name="REQUIRED_EMAIL_ADDRESS_WHILE_CHECKOUT" id="REQUIRED_EMAIL_ADDRESS_WHILE_CHECKOUT">
                                                <option @if (setting('REQUIRED_EMAIL_ADDRESS_WHILE_CHECKOUT') == 1) selected class="bg-success" @endif value="1">Yes</option>
                                                <option @if (setting('REQUIRED_EMAIL_ADDRESS_WHILE_CHECKOUT') == "0" || setting('REQUIRED_EMAIL_ADDRESS_WHILE_CHECKOUT') == NULL) selected class="bg-success" @endif value="0">No</option>
                                            </select>
                                        </li>

                                    </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Withdrawn</b></li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="min_rec" class="text-capitalize">Minimum Recharge</label>
                                            <input class="form-control" name="min_rec" id="min_rec" class="border border-info p-1" type="text" value="{{ setting('min_rec') ?? 50 }}">
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="min_with" class="text-capitalize">Minimum Withdraw</label>
                                            <input class="form-control" name="min_with" id="min_with" class="border border-info p-1" type="text" value="{{ setting('min_with') ?? 500 }}">
                                        </li>
                                    </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Shipping</b></li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="COUNTRY_SERVE" class="text-capitalize">Country of Serve <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="COUNTRY_SERVE" id="COUNTRY_SERVE" placeholder="Bangladesh" value="{{ setting('COUNTRY_SERVE') ?? 'Bangladesh' }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="shipping_range_inside" class="text-capitalize">Text - Shipping in Range <span class="text-red">*</span></label>
                                            <input class="form-control" name="shipping_range_inside" id="shipping_range_inside" class="border border-info p-1" type="text" value="{{ setting('shipping_range_inside') ?? "Dhaka" }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="CURRENCY_CODE" class="text-capitalize">Currency Code <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="CURRENCY_CODE" id="CURRENCY_CODE" placeholder="Currency code" value="{{ setting('CURRENCY_CODE') ?? 'BDT' }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="CURRENCY_CODE_MIN" class="text-capitalize">Currency Code Small <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="CURRENCY_CODE_MIN" id="CURRENCY_CODE_MIN" placeholder="Currency code" value="{{ setting('CURRENCY_CODE_MIN') ?? 'Tk' }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="CURRENCY_ICON" class="text-capitalize">Currency Icon <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="CURRENCY_ICON" id="CURRENCY_ICON" placeholder="Currency icon" value="{{ setting('CURRENCY_ICON') ?? '৳' }}" required>
                                        </li>
                                    </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Text change</b></li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="default_return_text" class="text-capitalize">Default return text</label>
                                            <input class="form-control" type="text" name="default_return_text" id="default_return_text" placeholder="7 days happy return" value="{{ setting('default_return_text') ?? '7 days happy return' }}">
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="default_warranty_text" class="text-capitalize">Default warranty text</label>
                                            <input class="form-control" type="text" name="default_warranty_text" id="default_warranty_text" placeholder="5 days of warranty" value="{{ setting('default_warranty_text') ?? '5 days of warranty' }}">
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="default_shipping_duration_text" class="text-capitalize">Default shipping duration text</label>
                                            <input class="form-control" type="text" name="default_shipping_duration_text" id="default_shipping_duration_text" placeholder="Home delivery <small>est. 1/2 days</small>" value="{{ setting('default_shipping_duration_text') ?? 'Home delivery <small>est. 1/2 days</small>' }}">
                                        </li>
                                    </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Calculation</b></li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="shop_commission" class="text-capitalize">Vendor Commission <span class="text-red">*</span></label>
                                            <input class="form-control" type="number" name="shop_commission" id="shop_commission" placeholder="Bangladesh" value="{{ setting('shop_commission') ?? 0 }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="is_point" class="text-capitalize">Point System Status <span class="text-red">*</span></label>
                                            <select class="form-control" name="is_point" id="is_point">
                                                <option class="bg-info" value="{{ setting('is_point') ?? 0 }}">{{ (setting('is_point')== 1 ? "Active"  : "Deactive" ) }}</option>
                                                <option value="1">Active</option>
                                                <option value="0">Deactive</option>
                                            </select>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="Default_Point" class="text-capitalize">Default Point <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="Default_Point" id="Default_Point" placeholder="Bangladesh" value="{{ setting('Default_Point') ?? 0 }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="Point_rate" class="text-capitalize">Point Rate <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="Point_rate" id="Point_rate" placeholder="Bangladesh" value="{{ setting('Point_rate') ?? 0 }}" required>
                                        </li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="minimum_wallet" class="text-capitalize">Minimum Wallet Balance in stock for user <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="minimum_wallet" id="minimum_wallet" placeholder="Bangladesh" value="{{ setting('minimum_wallet') ?? 0 }}" required>
                                        </li>

                                        <li class="col-12 col-md-6 form-group">
                                            <label for="default_advertisement_fee" class="text-capitalize">Default Advertisement Fee <span class="text-red">*</span><small>If you want to dynamic fee, then set 0, else all will be fixed fee</small></label>
                                            <input class="form-control" type="text" name="default_advertisement_fee" id="default_advertisement_fee" placeholder="Bangladesh" value="{{ setting('default_advertisement_fee') ?? 0 }}" required>
                                        </li>
                                    </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Order</b></li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="order_success_messege" class="text-capitalize">Order Success Messege <span class="text-red">*</span></label>
                                            <input class="form-control" type="text" name="order_success_messege" id="order_success_messege" placeholder="Order placed messege" value="{{ setting('order_success_messege') ?? 'Your order have been completed successfully' }}" required>
                                        </li>
                                    </ul>
                                    <ul class="form-row">
                                        <li class="bg-light p-2 mb-1 col-12"><b>Vat & Tax</b></li>
                                        <li class="col-12 col-md-6 form-group">
                                            <label for="VAT" class="text-capitalize">Vat Amount %<span class="text-red">*</span></label>
                                            <input class="form-control" type="number" name="VAT" id="VAT" placeholder="Vat Amount %" value="{{ setting('VAT') ?? 0 }}" required>
                                        </li>
                                    </ul>
                                <hr>
                            </div>
                            <!-- /.card-body -->
                            <div class="card-footer sticky_btn position-sticky fixed-bottom float-right" style="width:fit-content;">
                                <button type="submit" class="btn btn-success">
                                    <i class="fas fa-arrow-circle-up"></i>
                                    Update
                                </button>
                            </div>
                            <!-- /.card-footer -->
                        </form>
                    </div>
                    <!-- /.card -->
                </div>
            </div>
        </div>
    </div>



</section>
<!-- /.content -->
@endsection
