Soil Analysis for
Sample: | Date:
| Address | State/Postcode | ||
|---|---|---|---|
| Lab Number | |||
| Crop | Test Date |
prepare("SELECT * FROM soil_records WHERE id = ? AND rand = ?"); $stmt->execute([$record_id, $rand_id]); $row = $stmt->fetch(PDO::FETCH_ASSOC); if (!$row) { http_response_code(404); die('Soil record not found'); } $client = htmlspecialchars($row['client_name'] ?? '', ENT_QUOTES, 'UTF-8'); $address = htmlspecialchars($row['site_address'] ?? '', ENT_QUOTES, 'UTF-8'); $state = htmlspecialchars($row['state_postcode'] ?? '', ENT_QUOTES, 'UTF-8'); $email = htmlspecialchars($row['email'] ?? '', ENT_QUOTES, 'UTF-8'); $labNo = htmlspecialchars($row['lab_no'] ?? '', ENT_QUOTES, 'UTF-8'); $sampleDate = htmlspecialchars($row['date_sampled'] ?? '', ENT_QUOTES, 'UTF-8'); $sample = htmlspecialchars($row['site_id'] ?? '', ENT_QUOTES, 'UTF-8'); $crop = htmlspecialchars($row['sample_id'] ?? '', ENT_QUOTES, 'UTF-8'); } catch (PDOException $e) { error_log("Database error in soil-report.php: " . $e->getMessage()); die('Database error occurred'); } $today = date('jS F Y'); $pageTitle = 'Soil Report - ' . ($client ?: 'Crop Monitoring'); $siteName = 'Crop Management Platform'; $activeItem = 'Soil Report'; include __DIR__.'/../../layouts/header.php'; include __DIR__.'/../../layouts/navbar.php'; ?>