Skip to content

Commit

Permalink
add confirm all button
Browse files Browse the repository at this point in the history
  • Loading branch information
theomartinsantoso committed Sep 2, 2024
1 parent 7c2fa0a commit 0e46ead
Show file tree
Hide file tree
Showing 7 changed files with 1,139 additions and 1,286 deletions.
15 changes: 15 additions & 0 deletions app/Http/Controllers/JournalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,19 @@ public function approve($id)

return back()->with($context);
}

public function bulkApprove(Request $request)
{
$userId = $request->query('user');
$companyId = $request->query('company');

$journals = Journal::where('user_id', $userId)
->where('company_id', $companyId)
->whereNotNull('work_type')
->whereNotNull('description')
->where('is_approved', false)
->update(['is_approved' => true]);

return back()->with('success', 'All valid journals have been approved.');
}
}
15 changes: 15 additions & 0 deletions app/Http/Controllers/PresenceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,19 @@ public function approve($id)

return redirect()->back()->with('success', 'Data kehadiran berhasil disetujui');
}

public function bulkApprove(Request $request)
{
$userId = decrypt($request->query('user'));
$companyId = decrypt($request->query('company'));

// Update all presences with check_in and check_out values
Presence::where('user_id', $userId)
->where('company_id', $companyId)
->whereNotNull('check_in')
->whereNotNull('check_out')
->update(['is_approved' => true]);

return redirect()->back()->with('success', 'Semua kehadiran yang valid berhasil disetujui.');
}
}
2 changes: 1 addition & 1 deletion client
Submodule client updated from 2b67c7 to ce2813
Loading

0 comments on commit 0e46ead

Please sign in to comment.