@extends('admin.master')
@section('title') সেটিংস | SHOP @endsection
@section('setting')
active
@endsection
@section('setting')
active
@endsection
@section('styles')
@endsection
@section('admin_content')

<div class="app-content content">
    <div class="content-overlay"></div>
    <div class="header-navbar-shadow"></div>
    <div class="content-wrapper container-xxl p-0">
        <div class="content-header row">
            <div class="content-header-left col-md-9 col-12">
                <div class="row breadcrumbs-top">
                    <div class="col-12">
                        <h2 class="content-header-title float-start mb-0">সাধারণ সেটিংস</h2>
                    </div>
                </div>
            </div>
        </div>

        <div class="content-body mt-2">
            <div class="row">
                <div class="col-12">

                    <!-- profile -->
                    <div class="card">
                        <div class="card-header border-bottom">
                            <h4 class="card-title">Dynamic Logo</h4>
                        </div>
                        <div class="card-body py-2 my-25">
                            <!-- header section -->
                            <div class="d-flex">

                                <a href="#" class="me-25">
                                    @if(isset($logo) && $logo->logo_image != null)
                                    <img src="{{ asset('logo_img/'.$logo->logo_image ?? '') }}"
                                        class="uploadedAvatar rounded me-50" alt="Logo" height="100" width="200" />
                                    @else
                                    <img src="{{ asset('logo_img/default/logo.png') }}" height="100" width="200" alt="">
                                    @endif

                                </a>

                                <!-- upload and reset button -->
                                <div class="align-items-end ms-1 custom-logo-input-file">
                                    @if(isset($logo) && $logo->logo_image != null)
                                        <form method="POST" action="{{route('logo.update', $logo->id)}}" enctype="multipart/form-data">
                                        @csrf
                                    @else
                                        <form method="POST" action="{{route('logo.store')}}" enctype="multipart/form-data">
                                        @csrf
                                    @endif

                                        <input type="file" name="logo_image" id="account-upload" accept="image/*" />

                                        @error('logo_image')
                                        <span class=text-danger>{{$message}}</span>
                                        @enderror

                                        <button type="submit" id="account-reset"
                                            class="btn btn-sm btn-primary mb-75">Update Logo</button>
                                    </form>

                                </div>
                                <!--/ upload and reset button -->

                            </div>
                            <!--/ header section -->

                        </div>
                    </div>


                    <div class="card">
                        <div class="card-header border-bottom">
                            <h4 class="card-title">Footer Text</h4>
                        </div>
                        <div class="card-body py-2 my-25">

                            <form action="{{route('footer-text-submit',$footerText->id)}}" method="post">
                                @csrf
                                <div class="row">

                                    <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mt-2">
                                        <div class="form-group">
                                            <label for="text">লেখা  <span class=" text-danger">(required)</span> </label>
                                            <textarea class="form-control" name="text" id="text" cols="2" rows="2"
                                                placeholder=" লেখা">
                                                    @if(isset($footerText->text) && $footerText->text != null)
                                                    {{$footerText->text}}
                                                    @else
                                                    @endif
                                                </textarea>
                                        </div>
                                        @error('text')
                                        <span class=text-danger>{{$message}}</span>
                                        @enderror
                                    </div>


                                    <div class="col-12 col-sm-12 col-md-2 col-lg-2 col-xl-2 d-flex align-items-center"
                                        style="margin-top: 20px;">
                                        <input type="submit" name="submit" id="formSubmit" class="btn btn btn-success" value="Save">
                                    </div>

                                </div>
                            </form>

                        </div>
                    </div>

                </div>
            </div>

        </div>
    </div>
</div>
<!-- END: Content-->

@endsection