@extends('layouts.admin')
@section('content')
<!-- [ breadcrumb ] start -->
<div class="page-header">
    <div class="page-block">
        <div class="row align-items-center">
            <div class="col-md-12">
                <ul class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">হোম</a></li>
                    <li class="breadcrumb-item"><a href="javascript: void(0)">সংগঠন</a></li>
                    <li class="breadcrumb-item" aria-current="page">Divisions / Edit</li>
                </ul>
            </div>
            <div class="col-md-12">
                <div class="page-header-title">
                    <h2 class="mb-0">{{ __('Edit Division') }}</h2>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- [ breadcrumb ] end -->

<form action="{{ route('division.update', $division->id) }}" method="POST">
    @csrf @method('PUT')
    <div class="card">
        <div class="card-header"><h5>{{ __('Division Details') }}</h5></div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-6 mb-3">
                    <label class="form-label">{{ __('Language') }} <span class="text-danger">*</span></label>
                    <select name="language_id" class="form-select" required>
                        @foreach($languages as $lang)
                            <option value="{{ $lang->id }}" {{ $lang->id == $division->language_id ? 'selected' : '' }}>{{ $lang->language }}</option>
                        @endforeach
                    </select>
                </div>
                <div class="col-md-6 mb-3">
                    <label class="form-label">{{ __('Division Name') }} <span class="text-danger">*</span></label>
                    <input type="text" name="name" value="{{ $division->name }}" class="form-control" required>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-body">
            <button type="submit" class="btn btn-primary"><i class="ti ti-device-floppy me-1"></i>{{ __('Update') }}</button>
            <a href="{{ route('division.index') }}" class="btn btn-secondary ms-2">{{ __('Cancel') }}</a>
        </div>
    </div>
</form>
@endsection
