Manager Review & Map View
Managers can review field staff routes on an interactive Google Map, viewing the trail of GPS waypoints captured during a duty period. This provides visual verification of field visits.
Map Review Flow
Map Data Construction
The controller builds a JavaScript markers array from the GPS detail records:
DataTable dt = bo.MobileAttendanceApprovalODMap(MobileAttendanceId);
string markers = "[";
foreach (DataRow dr in dt.Rows)
{
strLocation += "{";
strLocation += string.Format("'title': '{0}',", dr["LocationDescription"]);
strLocation += string.Format("'description': '{0}',", dr["LocationDescription"]);
strLocation += string.Format("'lat': '{0}',", dr["Latitude"]);
strLocation += string.Format("'lng': '{0}'", dr["Longitude"]);
strLocation += "}";
}
markers += strLocation + "];";This creates a JavaScript array that is passed to the view via ViewBag.Markers and rendered on a Google Map with pins at each waypoint.
Role-Based Access
The GetSVGPSByUserId endpoint implements role-based data access:
| Role Level | Access | Method Called |
|---|---|---|
| 6 and above | See entire team's GPS records | GetMyTeamOnDuty() |
| Below 6 | See only own GPS records | GetMyVisits(userId) |
long RoleLevel = o.GetRoleLevel(id);
if (RoleLevel >= 6)
dt = o.GetMyTeamOnDuty();
else
dt = o.GetMyVisits(id);Admin Portal (Next.js)
The modern admin portal provides an enhanced GPS review experience:
Table Columns
| Column | Description |
|---|---|
| Reference | Auto-generated ref number |
| Staff | Name + location/designation |
| Purpose | Visit purpose category |
| Window | Start and end date/time |
| Duration | Calculated from start to end |
| Locations | Count of GPS waypoints captured |
| Images | Count of photos uploaded |
| Approval | Status badge (Approved/Pending/Rejected) |
Metrics Dashboard
The GPS list page shows summary metrics at the top:
| Metric | Description |
|---|---|
| Total Records | All GPS records in the filtered period |
| Approved | Count of approved records |
| Pending | Count awaiting approval |
| Latest Activity | Most recent GPS record timestamp |
Modern API (Go)
The Go core API provides a modern endpoint for GPS list retrieval:
GET /api/marketing/siteVisitGPSList
?search=keyword
&limit=50
&userId=1234
&mode=all| Parameter | Type | Description |
|---|---|---|
| search | string | Free-text search filter |
| limit | int | Max records to return |
| userId | long | Filter by specific user |
| mode | string | "all" for team view, "my" for personal |
Source Files
| File | Purpose |
|---|---|
MobileAttendanceController.cs | Map view rendering |
SiteVisitGPSAPIController.cs | Role-based GPS list |
site-visit-gps-list/run.go | Modern Go API handler |
sv-tables.tsx | Next.js admin table component |
report-pages.tsx | GPS report page rendering |