perbaikan print out dan penambahan nomor laporan

This commit is contained in:
majid
2024-12-27 11:29:55 +07:00
parent 66d0226d55
commit b70b3b730f
6 changed files with 620 additions and 304 deletions

View File

@@ -316,3 +316,16 @@
return User::find($userId);
}
function generateLpjUniqueCode($randomLength = 6)
{
$year = date('y');
$month = str_pad(date('m'), 2, '0', STR_PAD_LEFT);
$day = str_pad(date('d'), 2, '0', STR_PAD_LEFT);
// Generate random numbers
$randomNumber = str_pad(mt_rand(0, pow(10, $randomLength) - 1), $randomLength, '0', STR_PAD_LEFT);
// Concatenate components to create the custom code
return $year . $month . $day . $randomNumber;
}