<?php
/**
 * soil-analysis-full-report.php
 *
 * Combined report view: redirects to the analysis page which links to the soil report.
 * The individual pages (soil-analysis.php and soil-report.php) replaced the original
 * combined getResources approach.
 */

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

require_once __DIR__ . '/../../../config/database.php';
require_once __DIR__ . '/../../../lib/auth.php';

requireLogin();

$rid  = (int)   ($_GET['rid']  ?? 0);
$rand = (float) ($_GET['rand'] ?? 0);

if ($rid > 0) {
    header("Location: /dashboard/crop-analysis/soil-test-data/soil-analysis.php?rid={$rid}&rand={$rand}");
} else {
    header("Location: /dashboard/crop-analysis/soil-test-data/soil-test-data.php");
}
exit;
