@extends('layouts.admin')
@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ asset('assets/admin/css/vendors/flatpickr/flatpickr.min.css') }}">
@endsection
@section('app')
    <div class="container-fluid">
        <div class="list-product-header">
            <div>
                <a class="btn btn-dark" href="{{ route('master.barbershop') }}">Kembali</a>
            </div>
        </div>
        <div class="card">
            <div class="card-body">
                <form class="row g-3 custom-input" action="{{ route('master.barbershop.store') }}" method="post"
                    enctype="multipart/form-data">
                    @csrf
                    <div class="col-lg-6 position-relative">
                        <label class="form-label" for="name">Nama</label>
                        <input name="name" class="form-control @error('name') is-invalid @enderror" id="name"
                            type="text" placeholder="Masukan Nama" value="{{ old('name') }}">
                        @error('name')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-6 position-relative">
                        <label class="form-label" for="contact_number">Kontak
                            <span class="form-span"><i>(format : 08xxxxxxxx)</i></span>
                        </label>
                        <input name="contact_number" class="form-control @error('contact_number') is-invalid @enderror"
                            id="contact_number" type="number" placeholder="Masukan Kontak"
                            value="{{ old('contact_number') }}">
                        @error('contact_number')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-6 position-relative">
                        <label class="form-label" for="landmark">Patokan</label>
                        <input name="landmark" class="form-control @error('landmark') is-invalid @enderror" id="landmark"
                            type="text" placeholder="Masukan Patokan" value="{{ old('landmark') }}">
                        @error('landmark')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-6 position-relative">
                        <label class="form-label" for="opened">Tanggal Buka</label>
                        <div class="input-group flatpicker-calender">
                            <input name="opened" class="form-control @error('opened') is-invalid @enderror human-friendly"
                                id="opened" type="date" placeholder="Masukan Tanggal Buka"
                                value="{{ old('opened') }}">
                        </div>
                        @error('opened')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-12 position-relative">
                        <label class="form-label" for="address">Alamat</label>
                        <textarea name="address" class="form-control @error('address') is-invalid @enderror" id="address" rows="3"
                            placeholder="Masukan Alamat">{{ old('address') }}</textarea>
                        @error('address')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-4 position-relative">
                        <label class="form-label" for="cash">Kas</label>
                        <input name="cash" class="form-control rupiah-format @error('cash') is-invalid @enderror"
                            id="cash" type="text" placeholder="Masukan Kas" value="{{ old('cash') }}"
                            inputmode="numeric">
                        @error('cash')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-4 position-relative">
                        <label class="form-label" for="closed">Tanggal Tutup
                            <span class="form-span"><i>(Opsional)</i></span>
                        </label>
                        <div class="input-group flatpicker-calender">
                            <input name="closed" class="form-control @error('closed') is-invalid @enderror human-friendly"
                                id="closed" type="date" placeholder="Masukan Tanggal Tutup"
                                value="{{ old('closed') }}">
                        </div>
                        @error('closed')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-4 position-relative">
                        <label class="form-label" for="image">Gambar
                            <span class="form-span"><i>(.jpeg,.png,.jpg,.gif,.svg)</i></span>
                        </label>
                        <input name="image" class="form-control @error('image') is-invalid @enderror" id="image"
                            type="file" value="{{ old('image') }}"
                            accept="image/jpeg,image/png,image/jpg,image/gif,image/svg">
                        @error('image')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-12">
                        <button class="btn btn-primary button-disable" type="submit">Simpan</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
@section('beforeScripts')
    <script src="{{ asset('assets/admin/js/flat-pickr/flatpickr.js?ver=1.0.0') }}"></script>
    <script src="{{ asset('assets/admin/js/flat-pickr/custom-flatpickr.js?ver=1.0.0') }}"></script>
@endsection
@section('afterScripts')
    <script src="{{ asset('assets/js/forms/button-disable.js?ver=1.0.0') }}"></script>
    <script src="{{ asset('assets/js/forms/rupiah-format.js?ver=1.0.0') }}"></script>
@endsection
