Report Request LOG dan Final LOG

This commit is contained in:
2024-01-30 14:26:14 +07:00
parent c41181b93b
commit d92e2aba2e
13 changed files with 1135 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ use Symfony\Component\HttpFoundation\Response;
use PHPMailer\PHPMailer\PHPMailer;
use Illuminate\Support\Facades\DB;
use App\Models\Member;
use App\Models\User;
use App\Models\Service;
class Helper
@@ -89,6 +90,22 @@ class Helper
return $principalName->name;
}
public static function userName($id)
{
$user = User::find($id);
if ($user) {
$person = $user->person;
if ($person) {
return $person->name;
} else {
return 'Person not found for this user.';
}
} else {
return 'User not found.';
}
}
public static function serviceName($code)
{
$serviceName = Service::where('code', $code)->get()->first();
@@ -138,6 +155,14 @@ class Helper
return $datesAvailabilities;
}
public static function differenceTime($startDate, $endDate){
$startTime = Carbon::parse($startDate);
$endTime = Carbon::parse($endDate);
$interval = $endTime->diff($startTime);
return $interval->format('%d days, %h hours and %i minutes');
}
public static function dailyAvailabilities($availabilities)
{
$hours = [