@extends('layouts.app')
@section('page_title','Designations')
@section('page_subtitle','Manage job grades, titles and levels.')
@section('content')
<div class="card"><h3>Add Designation</h3><form method="POST" action="{{ route('admin.designations.store') }}">@csrf<div class="form-row"><div class="field"><label>Name</label><input class="input" name="name" required></div><div class="field"><label>Level</label><input class="input" name="level"></div><div class="field"><label>Status</label><select name="status"><option value="active">Active</option><option value="inactive">Inactive</option></select></div></div><div class="field"><label>Description</label><textarea name="description"></textarea></div><button class="btn">Save Designation</button></form></div>
<div class="card"><h3>Designation List</h3><table class="table"><tr><th>Name</th><th>Level</th><th>Employees</th><th>Status</th><th>Update</th></tr>@foreach($designations as $designation)<tr><form method="POST" action="{{ route('admin.designations.update',$designation) }}">@csrf @method('PUT')<td><input class="input" name="name" value="{{ $designation->name }}"></td><td><input class="input" name="level" value="{{ $designation->level }}"><textarea name="description" style="display:none">{{ $designation->description }}</textarea></td><td>{{ $designation->employees_count }}</td><td><select name="status"><option value="active" @selected($designation->status==='active')>Active</option><option value="inactive" @selected($designation->status==='inactive')>Inactive</option></select></td><td><button class="btn secondary">Update</button></td></form></tr>@endforeach</table></div>
@endsection
