perbaikan print out dan penambahan nomor laporan
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user