@extends('backend.admin.layouts.app')
@section('content')
    <div class="pagetitle">
        <h1>Dashboard</h1>
        <nav>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                <li class="breadcrumb-item">Dashboard</li>
                <li class="breadcrumb-item active">{{ $PageTitle }}</li>
            </ol>
        </nav>
    </div><!-- End Page Title -->

    <section class="section dashboard">
        <div class="row">
            <div class="col-lg-7">

                <div class="card">
                    <div class="card-body mt-3">
                        <form action="{{ route('admin.setting') }}" method="POST" enctype="multipart/form-data">
                            @csrf

                            {{-- Logo --}}
                            <div class="row mt-5 mb-4">
                                <label for="logo" class="col-sm-3 col-form-label">Logo</label>
                                <div class="col-sm-4 mb-25">
                                    <div class="upload-img-box">
                                        <img id="updateImageUrl" src="{{ getimage(getOption('logo')) }}">
                                        <input type="file" name="logo" id="logo" accept="image/*"
                                               onchange="previewFile(this)">
                                        <div class="upload-img-box-icon">
                                            <i class="fa-solid fa-camera"></i>
                                        </div>
                                    </div>
                                    <p class="col-sm-10 mt-2">Size: 180 x 50</p>
                                </div>
                            </div>
                            
                            {{-- Favicon --}}
                            <div class="row mb-4">
                                <label for="favicon" class="col-sm-3 col-form-label">Favicon</label>
                                <div class="col-sm-4 mb-25">
                                    <div class="upload-img-box">
                                        <img src="{{ getimage(getOption('favicon')) }}">
                                        <input type="file"
                                               name="favicon"
                                               id="favicon"
                                               accept="image/*"
                                               onchange="previewFile(this)">
                                        <div class="upload-img-box-icon">
                                            <i class="fa-solid fa-camera"></i>
                                        </div>
                                    </div>
                                    <p class="col-sm-10 mt-2">Recommended: 32×32 / 64×64 PNG</p>
                                </div>
                            </div>

                            {{-- Basic Info --}}
                            <div class="row mb-3">
                                <label for="address" class="col-sm-3 col-form-label">Address</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('address') is-invalid @enderror"
                                           value="{{ getOption('address') }}" name="address" id="address"
                                           placeholder="address">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="email" class="col-sm-3 col-form-label">Email</label>
                                <div class="col-sm-9">
                                    <input type="email"
                                           class="form-control @error('email') is-invalid @enderror"
                                           value="{{ getOption('email') }}" name="email" id="email"
                                           placeholder="email">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="phone" class="col-sm-3 col-form-label">Phone</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('phone') is-invalid @enderror"
                                           value="{{ getOption('phone') }}" name="phone" id="phone"
                                           placeholder="phone">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="Whats_app" class="col-sm-3 col-form-label">Whats App</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('Whats_app') is-invalid @enderror"
                                           value="{{ getOption('Whats_app') }}" name="Whats_app" id="Whats_app"
                                           placeholder="Whats_app">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="servece_center_phone" class="col-sm-3 col-form-label">Service Center Phone</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('servece_center_phone') is-invalid @enderror"
                                           value="{{ getOption('servece_center_phone') }}" name="servece_center_phone" id="servece_center_phone"
                                           placeholder="service center phone">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="copyright_text" class="col-sm-3 col-form-label">Website Copyright Text</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('copyright_text') is-invalid @enderror"
                                           value="{{ getOption('copyright_text') }}" name="copyright_text" id="copyright_text"
                                           placeholder="copyright text">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="start_time" class="col-sm-3 col-form-label">Opening Time</label>
                                <div class="col-sm-9">
                                    <input type="time"
                                           class="form-control @error('start_time') is-invalid @enderror"
                                           value="{{ getOption('start_time') }}"
                                           name="start_time"
                                           id="start_time"
                                           placeholder="Select opening time">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="end_time" class="col-sm-3 col-form-label">Closing Time</label>
                                <div class="col-sm-9">
                                    <input type="time"
                                           class="form-control @error('end_time') is-invalid @enderror"
                                           value="{{ getOption('end_time') }}"
                                           name="end_time"
                                           id="end_time"
                                           placeholder="Select closing time">
                                </div>
                            </div>

                            {{-- ================= Footer Info Text (Dynamic) ================= --}}
                            <h5 class="text-dark mt-5">Footer Info Text</h5>

                            {{-- Block 1 --}}
                            <div class="row mb-3">
                                <label for="footer_block1_title" class="col-sm-3 col-form-label">Block 1 Title</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('footer_block1_title') is-invalid @enderror"
                                           name="footer_block1_title"
                                           id="footer_block1_title"
                                           value="{{ getOption('footer_block1_title') }}"
                                           placeholder="Digital Trade Fair">
                                </div>
                            </div>
                            <div class="row mb-3">
                                <label for="footer_block1_text" class="col-sm-3 col-form-label">Block 1 Text</label>
                                <div class="col-sm-9">
                                    <textarea
                                        class="form-control @error('footer_block1_text') is-invalid @enderror"
                                        name="footer_block1_text"
                                        id="footer_block1_text"
                                        rows="2"
                                        placeholder="এই সাইট থেকে আপনি অনলাইনে নানান ব্র্যান্ডের পণ্য এক জায়গায় দেখে, তুলনা করে, অফার সহকারে অর্ডার করতে পারবেন।"
                                    >{{ getOption('footer_block1_text') }}</textarea>
                                </div>
                            </div>

                            {{-- Block 2 --}}
                            <div class="row mb-3">
                                <label for="footer_block2_title" class="col-sm-3 col-form-label">Block 2 Title</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('footer_block2_title') is-invalid @enderror"
                                           name="footer_block2_title"
                                           id="footer_block2_title"
                                           value="{{ getOption('footer_block2_title') }}"
                                           placeholder="Buyers">
                                </div>
                            </div>
                            <div class="row mb-3">
                                <label for="footer_block2_text" class="col-sm-3 col-form-label">Block 2 Text</label>
                                <div class="col-sm-9">
                                    <textarea
                                        class="form-control @error('footer_block2_text') is-invalid @enderror"
                                        name="footer_block2_text"
                                        id="footer_block2_text"
                                        rows="2"
                                        placeholder="ক্রেতারা এখানে নিরাপদে অর্ডার করতে পারবেন, হটলাইন ও সাপোর্ট টিম থেকে প্রয়োজনীয় সাহায্যও পাবেন।"
                                    >{{ getOption('footer_block2_text') }}</textarea>
                                </div>
                            </div>

                            {{-- Block 3 --}}
                            <div class="row mb-3">
                                <label for="footer_block3_title" class="col-sm-3 col-form-label">Block 3 Title</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('footer_block3_title') is-invalid @enderror"
                                           name="footer_block3_title"
                                           id="footer_block3_title"
                                           value="{{ getOption('footer_block3_title') }}"
                                           placeholder="Sellers">
                                </div>
                            </div>
                            <div class="row mb-3">
                                <label for="footer_block3_text" class="col-sm-3 col-form-label">Block 3 Text</label>
                                <div class="col-sm-9">
                                    <textarea
                                        class="form-control @error('footer_block3_text') is-invalid @enderror"
                                        name="footer_block3_text"
                                        id="footer_block3_text"
                                        rows="2"
                                        placeholder="আপনার পণ্য অনলাইনে বিক্রি করতে চাইলে আমাদের সাথে যোগাযোগ করুন – সহজেই নিজের স্টোর খুলে নিন।"
                                    >{{ getOption('footer_block3_text') }}</textarea>
                                </div>
                            </div>
                            {{-- =============== End Footer Info Text =============== --}}

                            {{-- Social Link --}}
                            <h5 class="text-dark mt-5">Social Link</h5>

                            <div class="row mb-3">
                                <label for="facebook" class="col-sm-3 col-form-label">Facebook</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('facebook') is-invalid @enderror"
                                           value="{{ getOption('facebook') }}" name="facebook" id="facebook"
                                           placeholder="facebook url">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="linkedin" class="col-sm-3 col-form-label">Linkedin</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('linkedin') is-invalid @enderror"
                                           value="{{ getOption('linkedin') }}" name="linkedin" id="linkedin"
                                           placeholder="linkedin url">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="twitter" class="col-sm-3 col-form-label">Twitter</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('twitter') is-invalid @enderror"
                                           value="{{ getOption('twitter') }}" name="twitter" id="twitter"
                                           placeholder="twitter url">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="youtube" class="col-sm-3 col-form-label">Youtube</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('youtube') is-invalid @enderror"
                                           value="{{ getOption('youtube') }}" name="youtube" id="youtube"
                                           placeholder="youtube url">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <label for="instagram" class="col-sm-3 col-form-label">Instagram</label>
                                <div class="col-sm-9">
                                    <input type="text"
                                           class="form-control @error('instagram') is-invalid @enderror"
                                           value="{{ getOption('instagram') }}" name="instagram" id="instagram"
                                           placeholder="instagram url">
                                </div>
                            </div>

                            <div class="row mb-3">
                                <div class="col-sm-10">
                                    <button type="submit" class="btn btn-primary">Save</button>
                                </div>
                            </div>

                        </form><!-- End General Form Elements -->
                    </div>
                </div>

            </div>
        </div>
    </section>
@endsection

@push('style')
    <style>
        .upload-img-box {
            width: 100%;
            height: 200px;
        }
    </style>
@endpush
