@extends('back-end.master.app')
@section('title', 'New Info')

@section('body')
    <main class="app-content">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-9">
                        <h5>Website Info</h5>
                    </div>
                    <div class="col-md-3">
                        <a href="{{ route('info.index') }}" style="float: right;" class="btn btn-primary btn-sm btn-rounded">List</a>
                    </div>
                </div>
                <div class="row mt-5">
                    <form method="POST" action="{{ route('info.store') }}" enctype="multipart/form-data">
                        @csrf
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-outline">
                                    <input type="test" id="title" name="website_title" required
                                        value="{{ old('title') }}" class="form-control" />
                                    <label class="form-label" for="title">title</label>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <select id="language_id" type="text"
                                    class="form-control select2 @error('language_id') is-invalid @enderror" required
                                    name="language_id">
                                    <option value="">Choose Language</option>
                                    @foreach ($languages as $row)
                                        <option value="{{ $row->id }}">{{ $row->title_en }}</option>
                                    @endforeach
                                </select>
                                @error('cat_id')
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $message }}</strong>
                                    </span>
                                @enderror
                            </div>
                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="test" id="phone1" name="phone1" required value="{{ old('phone1') }}"
                                        class="form-control" />
                                    <label class="form-label" for="phone1">First Phone</label>
                                </div>
                            </div>
                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="test" id="phone2" name="phone2" required value="{{ old('phone2') }}"
                                        class="form-control" />
                                    <label class="form-label" for="phone1">Second Phone</label>
                                </div>
                            </div>
                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="email" id="email" name="email" required value="{{ old('email') }}"
                                        class="form-control" />
                                    <label class="form-label" for="email">Email</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="facebook_url" name="facebook_url" required
                                        value="{{ old('facebook_url') }}" class="form-control" />
                                    <label class="form-label" for="facebook_url">facebook_url</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="twitter_url" name="twitter_url" required
                                        value="{{ old('twitter_url') }}" class="form-control" />
                                    <label class="form-label" for="twitter_url">twitter_url</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="youtube_url" name="youtube_url" required
                                        value="{{ old('youtube_url') }}" class="form-control" />
                                    <label class="form-label" for="youtube_url">youtube_url</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="instegram_url" name="youtube_url" required
                                        value="{{ old('instegram_url') }}" class="form-control" />
                                    <label class="form-label" for="instegram_url">instegram_url</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="tiktok_url" name="tiktok_url" required
                                        value="{{ old('tiktok_url') }}" class="form-control" />
                                    <label class="form-label" for="tiktok_url">tiktok_url</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="lingding_url" name="lingding_url" required
                                        value="{{ old('lingding_url') }}" class="form-control" />
                                    <label class="form-label" for="lingding_url">lingding_url</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="whats_app_number" name="whats_app_number" required
                                        value="{{ old('whats_app_number') }}" class="form-control" />
                                    <label class="form-label" for="whats_app_number">whats_app_number</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="text" id="address" name="address" required
                                        value="{{ old('address') }}" class="form-control" />
                                    <label class="form-label" for="address">address</label>
                                </div>
                            </div>

                            <div class="col-md-4 mt-3">
                                <div class="form-outline">
                                    <input type="file" id="image" name="image" required
                                        value="{{ old('image') }}" class="form-control" />
                                    <label class="form-label" for="image">Logo</label>
                                </div>
                            </div>

                            <div class="col-md-12 mt-3">
                                <div class="form-outline">
                                    <textarea cols="30" rows="3" id="about" name="about" required value=""
                                        class="form-control">{{ old('about') }}</textarea>
                                    <label class="form-label" for="about">About</label>
                                </div>
                            </div>

                            <div class="col-md-12 mt-3">
                                <div class="form-outline">
                                    <textarea cols="30" rows="3" id="mission" name="mission" required value=""
                                        class="form-control">{{ old('about') }}</textarea>
                                    <label class="form-label" for="mission">mission</label>
                                </div>
                            </div>

                            <div class="col-md-12 mt-3">
                                <div class="form-outline">
                                    <textarea cols="30" rows="3" id="vission" name="vission" required value=""
                                        class="form-control">{{ old('about') }}</textarea>
                                    <label class="form-label" for="vission">vission</label>
                                </div>
                            </div>

                            {{-- <div class="col-md-12 mt-3">
                                <div class="form-outline">
                                    <textarea cols="30" rows="3" id="career" name="career" required value=""
                                        class="form-control">{{ old('career') }}</textarea>
                                    <label class="form-label" for="career">career</label>
                                </div>
                            </div> --}}
                        </div>
                        <div class="form-group row mt-3">
                            <div class="col-md-6 ">
                                <button type="submit" class="btn btn-primary">
                                    {{ __('Save') }}
                                </button>
                            </div>
                    </form>
                </div>
            </div>
        </div>
    </main>

@endsection


@section('pageJs')
    <script type="text/javascript">
        $(".app-menu").removeClass("active");
        $("#nav_setting").addClass("active");
        $("#nav_settingi").addClass("is-expanded");
        $("#nav_sub_info").addClass("active");
        <?php
if (session()->has("msg")) {
    ?>

        $.notify({
            title: "Notice: ",
            message: "<?= session()->get('msg') ?>",
            icon: "fa fa-check"
        }, {
            type: "success"
        });
        <?php
}
?>
    </script>
@endsection
