@extends('server-side.layouts.server-app')
@section('pageTitle', 'Registrasi Pengguna | KlinikSapi.Go')
@section('mainContent')
    <div class="content d-flex flex-column flex-column-fluid" id="kt_content">
        <div class="toolbar" id="kt_toolbar">
            <div id="kt_toolbar_container" class="container-fluid d-flex flex-stack">
                <div data-kt-swapper="true" data-kt-swapper-mode="prepend"
                    data-kt-swapper-parent="{default: '#kt_content_container', 'lg': '#kt_toolbar_container'}"
                    class="page-title d-flex align-items-center flex-wrap me-3 mb-5 mb-lg-0">
                    <h1 class="d-flex align-items-center text-dark fw-bolder fs-3 my-1">Manajemen Pengguna
                        <span class="h-20px border-gray-200 border-start ms-3 mx-2"></span>
                        <small class="text-muted fs-7 fw-bold my-1 ms-1">Registrasi Pengguna</small>
                    </h1>
                </div>
            </div>
        </div>
        <div class="post d-flex flex-column-fluid" id="kt_post">
            <div id="kt_content_container" class="container-xxl">
                <div class="card mb-5 mb-xl-8 px-10 px-lg-15 py-15">
                    <form action="{{ route('registrasi.store') }}" method="POST" class="form" autocomplete="off">
                        @csrf
                        <div class="mb-10">
                            <h1 class="mb-3">Registrasi Pengguna</h1>
                            <div class="text-muted fw-bold fs-5">Silahkan lengkapi formulir <strong>Registrasi Pengguna</strong> di bawah ini!</div>
                        </div>
                        <div class="row g-9 mb-8">
                            <div class="col-md-12 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Nama Lengkap</span>
                                </label>
                                <input type="text" class="form-control form-control-solid" name="name" value="{{ old('name') }}" />
                                @if ($errors->has('name'))
                                    <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                            class="font-medium">Oops!</span> {{ $errors->first('name') }}</p>
                                @endif
                            </div>
                            <div class="col-md-6 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Email</span>
                                </label>
                                <input type="email" class="form-control form-control-solid" name="email" value="{{ old('email') }}" />
                                @if ($errors->has('email'))
                                    <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                            class="font-medium">Oops!</span> {{ $errors->first('email') }}</p>
                                @endif
                            </div>
                            <div class="col-md-6 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Nomor Telepon</span>
                                </label>
                                <input type="number" class="form-control form-control-solid" name="nope" value="{{ old('nope') }}" />
                                @if ($errors->has('nope'))
                                    <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                            class="font-medium">Oops!</span> {{ $errors->first('nope') }}</p>
                                @endif
                            </div>
                        </div>
                        <div class="row g-9 mb-8">
                            <div class="col-md-6 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Kata Sandi</span>
                                </label>
                                <input type="password" class="form-control form-control-solid" name="password" />
                                @if ($errors->has('password'))
                                    <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                            class="font-medium">Oops!</span> {{ $errors->first('password') }}</p>
                                @endif
                            </div>
                            <div class="col-md-6 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Masukkan Ulang Kata Sandi</span>
                                </label>
                                <input type="password" class="form-control form-control-solid" name="password_confirmation" />
                            </div>
                        </div>
                        <div class="d-flex flex-column mb-10">
                            <label class="fs-6 fw-bold mb-3 required">Pilih Role User</label>
                            <div class="row g-9" data-kt-buttons="true" data-kt-buttons-target="[data-kt-button]">
                                <div class="col-sm-12 col-md-6 col-lg-6 col-xxl-6">
                                    <label class="btn btn-outline btn-outline-dashed btn-outline-default d-flex text-start p-4" data-kt-button="true">
                                        <span
                                            class="form-check form-check-custom form-check-solid form-check-sm align-items-start mt-1">
                                            <input class="form-check-input" type="radio" name="role"
                                                value="administrator" />
                                        </span>
                                        <span class="ms-5">
                                            <span class="mt-1 d-block">Administrator</span>
                                        </span>
                                    </label>
                                </div>
                                <div class="col-sm-12 col-md-6 col-lg-6 col-xxl-6">
                                    <label class="btn btn-outline btn-outline-dashed btn-outline-default d-flex text-start p-4" data-kt-button="true">
                                        <span
                                            class="form-check form-check-custom form-check-solid form-check-sm align-items-start mt-1">
                                            <input class="form-check-input" type="radio" name="role"
                                                value="peternak" />
                                        </span>
                                        <span class="ms-5">
                                            <span class="mt-1 d-block">Peternak</span>
                                        </span>
                                    </label>
                                </div>
                                @if ($errors->has('role'))
                                    <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                            class="font-medium">Oops!</span> {{ $errors->first('role') }}</p>
                                @endif
                            </div>
                        </div>
                        <div class="float-start">
                            <button type="submit" class="btn btn-primary">
                                <span class="indicator-label">Register</span>
                            </button>
                            <button type="reset" class="btn btn-light me-3">Batal</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
