@extends('admin-system.admin')

@section('content')
<div class="container-fluid px-0">
    <div class="row">
        <div class="col-sm-12">
            <div class="card border-0 bg-transparent">
                
                <div class="card-header border-0 bg-transparent px-0 py-0 mb_16">
                    <div class="d-flex justify-content-between align-items-center">
                        <h5 class="text-koulen text-secondary">Create Branch</h5>
                        <a href="{{ url('adminbranch') }}" class="btn btn-secondary btn-sm">Back</a>
                    </div>
                </div>

                <div class="card-body p-3 border-0 bg-white rounded-lg">

                    <form action="{{ url('adminbranch') }}" method="POST">
                        @csrf

                        <div class="row">
                            <div class="col-sm-6 mb-3">
                                <label>Name (English)</label>
                                <input type="text" name="name_en" class="form-control" value="{{ old('name_en') }}" required>
                                @error('name_en') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>

                            <div class="col-sm-6 mb-3">
                                <label>Name (Khmer)</label>
                                <input type="text" name="name_km" class="form-control" value="{{ old('name_km') }}" required>
                                @error('name_km') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-6 mb-3">
                                <label>Phone</label>
                                <input type="text" name="phone" class="form-control" value="{{ old('phone') }}">
                                @error('phone') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>

                            <div class="col-sm-6 mb-3">
                                <label>Address</label>
                                <textarea name="address" class="form-control" rows="3">{{ old('address') }}</textarea>
                                @error('address') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 mb-3">
                                <label>Branch Prefix</label>
                                <input type="text" name="branch_prefix" class="form-control" value="{{ old('branch_prefix') }}">
                                @error('branch_prefix') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>

                            <div class="col-sm-6 mb-3">
                                <label>Client Prefix</label>
                                <input type="text" name="client_prefix" class="form-control" value="{{ old('client_prefix') }}">
                                @error('client_prefix') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 mb-3">
                                <label>CO Prefix</label>
                                <input type="text" name="co_prefix" class="form-control" value="{{ old('co_prefix') }}">
                                @error('co_prefix') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>

                            <div class="col-sm-6 mb-3">
                                <label>User Prefix</label>
                                <input type="text" name="user_prefix" class="form-control" value="{{ old('user_prefix') }}">
                                @error('user_prefix') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 mb-3">
                                <label>Loan Prefix</label>
                                <input type="text" name="loan_prefix" class="form-control" value="{{ old('loan_prefix') }}">
                                @error('loan_prefix') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>

                            <div class="col-sm-6 mb-3">
                                <label>Invoice Prefix</label>
                                <input type="text" name="invoice_prefix" class="form-control" value="{{ old('invoice_prefix') }}">
                                @error('invoice_prefix') <span class="text-danger">{{ $message }}</span> @enderror
                            </div>
                        </div>

                        <button type="submit" class="btn btn-primary">Save</button>

                    </form>
                </div>

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