@extends('employee.layouts.app')
@section('title', 'Edit Department | Career Development and Consultation (CDC)')
@section('navigation')
    <h1 class="my-1 d-flex align-items-center text-dark fw-bolder fs-3">Department
        <span class="mx-2 border-gray-200 h-20px border-start ms-3"></span>
        <small class="my-1 text-muted fs-7 fw-bold ms-1">Edit Department</small>
    </h1>
@endsection
@section('content')
    <div class="card">
        <div class="pt-4 border card-body">
            <form action="{{ route('departments.update', $departments) }}" method="POST" class="form" autocomplete="off">
                @csrf
                @method('PUT')
                <div class="pt-4 mb-8 d-flex flex-column fv-row">
                    <label class="mb-2 d-flex align-items-center fs-6 fw-bold">
                        <span class="required">Kode</span>
                        <i class="fas fa-exclamation-circle ms-2 fs-7" data-bs-toggle="tooltip"
                            title="Kode jurusan dibuat secara otomatis"></i>
                    </label>
                    <input type="text" class="form-control form-control-solid" placeholder="Kode" name="department_code"
                        value="{{ old('department_code', $departments->department_code) }}" readonly />
                    @error('department_code')
                        <div class="fv-plugins-message-container invalid-feedback">
                            <span>{{ $message }}</span>
                        </div>
                    @enderror
                </div>
                <div class="pt-4 mb-8 d-flex flex-column fv-row">
                    <label class="mb-2 d-flex align-items-center fs-6 fw-bold">
                        <span class="required">Jurusan</span>
                        <i class="fas fa-exclamation-circle ms-2 fs-7" data-bs-toggle="tooltip"
                            title="Jurusan Mahasiswa"></i>
                    </label>
                    <input type="text" class="form-control form-control-solid" placeholder="Contoh: Teknik Informatika"
                        name="department_name" value="{{ old('department_name', $departments->department_name) }}" />
                    @error('department_name')
                        <div class="fv-plugins-message-container invalid-feedback">
                            <span>{{ $message }}</span>
                        </div>
                    @enderror
                </div>
                <div class="d-flex justify-content-end">
                    <a href="{{ route('departments') }}" class="btn btn-light btn-active-light-primary me-2">Kembali</a>
                    <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
                </div>
            </form>
        </div>
    </div>
@endsection
