<?php
$created = can_action('70', 'created');
$edited = can_action('70', 'edited');
if (!empty($created) || !empty($edited)) {
?>

	<?php if (!empty($department_info->departments_id)) {
		$departments_id = $department_info->departments_id;
	} elseif (!empty($inline)) {
		$departments_id = 'inline/true';
	} ?>
	<div class="modal-body">
		<form data-parsley-validate="" novalidate=""
			action="<?php echo base_url() ?>admin/departments/edit_departments/<?= $departments_id; ?>"
			method="post" class="space-y-4">

			<?= form_input_group('deptname', lang('departments') . ' ' . lang('name'), (!empty($department_info->deptname) ? $department_info->deptname : ''), 'text', true); ?>

			<div class="flex items-center justify-end gap-2 pt-2">
				<button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted" data-dismiss="modal">
					<i data-lucide="x" class="h-4 w-4"></i>
					<?= lang('close') ?>
				</button>
				<button type="submit" class="inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500">
					<i data-lucide="save" class="h-4 w-4"></i>
					<?= lang('update') ?>
				</button>
			</div>
		</form>
</div>
<?php } ?>
