Geo-verification System
-Welcome, = htmlspecialchars($username) ?>! You are logged in as a = htmlspecialchars($current_role) ?>.
+ +Set Your Branch
+Please set your branch to continue.
+ +Dashboard
+Welcome, = htmlspecialchars($username) ?>! You are logged in as a = htmlspecialchars($current_role) ?> from the = htmlspecialchars($branch) ?> branch.
+Add New Visit
-Capture GPS coordinates and client details for a new visit.
- Go » +Visits by Status
+Review Visits
-View, verify, or reject recorded client visits.
- Go » + + + + + prepare('SELECT status, COUNT(*) as count FROM visits WHERE user_id = ? GROUP BY status'); + $stmt->execute([$_SESSION['user_id']]); + ?> + query("SELECT u.branch, u.username, COUNT(v.id) AS visit_count FROM visits v JOIN users u ON v.user_id = u.id WHERE u.branch IS NOT NULL AND u.role_id = (SELECT id FROM roles WHERE name = 'Loan Officer') GROUP BY u.branch, u.username ORDER BY u.branch, u.username"); + $visits_by_officer = $stmt->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); + ?> +Visits by Branch and Loan Officer
No visits recorded yet.
+ ++ +
+-
+
+
- + = htmlspecialchars($officer['username']) ?> + = $officer['visit_count'] ?> visits + + +