<?php
// ajax/meters_month.ajax.php
// Returns CSV: RIEMING,DRILLING,CASING,BLASTING totals for current month.
// Query param: user_id (optional) — if provided, filters to that user only (driver view).
include $_SERVER['DOCUMENT_ROOT'] . "/root.class.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/test/classes/dashboard.class.php";

$db      = new db_safeguard();
$dash    = new DashboardData($db);
$user_id = isset($_GET['user_id']) ? intval($_GET['user_id']) : 0;

echo $dash->metersThisMonthCSV($user_id);