Field Staff Tracking
Approval Workflow
Manager Review & Map View

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 LevelAccessMethod Called
6 and aboveSee entire team's GPS recordsGetMyTeamOnDuty()
Below 6See only own GPS recordsGetMyVisits(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

ColumnDescription
ReferenceAuto-generated ref number
StaffName + location/designation
PurposeVisit purpose category
WindowStart and end date/time
DurationCalculated from start to end
LocationsCount of GPS waypoints captured
ImagesCount of photos uploaded
ApprovalStatus badge (Approved/Pending/Rejected)

Metrics Dashboard

The GPS list page shows summary metrics at the top:

MetricDescription
Total RecordsAll GPS records in the filtered period
ApprovedCount of approved records
PendingCount awaiting approval
Latest ActivityMost 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
ParameterTypeDescription
searchstringFree-text search filter
limitintMax records to return
userIdlongFilter by specific user
modestring"all" for team view, "my" for personal

Source Files

FilePurpose
MobileAttendanceController.csMap view rendering
SiteVisitGPSAPIController.csRole-based GPS list
site-visit-gps-list/run.goModern Go API handler
sv-tables.tsxNext.js admin table component
report-pages.tsxGPS report page rendering