<?php
header('Content-Type: application/json; charset=utf-8');

require_once __DIR__ . '/../inc/auth.php';
$session = auth_require('owner', 'engineer');

$pdo = getDB();

$stmt = $pdo->query("SELECT * FROM shs_records ORDER BY id DESC LIMIT 1");
$shs = $stmt->fetch();

echo json_encode($shs ?: ['error' => 'Нет данных']);
