@extends('layout.main')
@section('content')
@php
$employees = App\Employee::all();
$staffNumbers = 0;
foreach ($employees as $employee) {
if (preg_match('/^([A-Za-z]+)(\d+)$/', $employee->staff_id, $matches)) {
$prefix = $matches[1];
$number = (int) $matches[2];
if ($number > $staffNumbers) {
$staffNumbers = $number;
}
}
}
// Fallback PHP: Format 5 digit (misal: 00296) jika JS belum loading
$staffNumbers = $staffNumbers + 1;
$staffNumbers = sprintf('%05d', $staffNumbers);
@endphp
{{ trans('file.Employee') }}
{{ trans('file.Company') }}
{{ __('End Of Contract') }}
{{ trans('file.Status') }}
{{ trans('file.action') }}