@extends('layouts.app')

@section('title')
  Dashboard
@endsection

@section('admin-content')
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>Tambahkan Cabang Baru</h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="{{ route('dashboard.index') }}">Dashboard</a></li>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="card card-primary card-outline">
                <div class="card-body">
					<form method="POST" action="{{ route('admin.cabang.store') }}">
                        @csrf
                        @include('backend.layouts.partials.messages')
                        <div class="mb-3">
                            <label class="form-label">Pilih Kepala Cabang</label>
                            <select class="form-control" name="head_id">
                                <option value="">Pilih Kepala Cabang</option>
                                @foreach ($users as $user)
                                    <option value="{{ $user->id }}">{{ $user->name }} | {{ $user->email }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Pilih Induk Region</label>
                            <select class="form-control" name="region_id">
                                <option value="">Pilih Region</option>
                                @foreach ($regions as $item)
                                    <option value="{{ $item->id }}">{{ $item->code }} | {{ $item->name }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Pilih Cost Centre</label>
                            <select class="form-control" name="cost_id">
                                <option value="">Pilih Cost Centre</option>
                                @foreach ($cost_centres as $item)
                                    <option value="{{ $item->id }}">{{ $item->code }} | {{ $item->name }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Code Cabang</label>
                            <input type="text" class="form-control" name="code">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Nama Cabang</label>
                            <input type="text" class="form-control" name="name">
                        </div>
                        <button type="submit" class="btn btn-primary">Submit</button>
					</form>
                </div>
            </div>
        </div>
    </section>
@endsection
