No plant type specified.

'; return; } // ── Plant specifications table ──────────────────────────────────────────── $stmt = $pdo->prepare(' SELECT plant_stage, n_min, n_max, P_min, P_max, K_min, K_max, S_min, S_max, Ca_min, Ca_max, Mg_min, Mg_max, Na_min, Na_max, Cu_min, Cu_max, Zn_min, Zn_max, Mn_min, Mn_max, B_min, B_max, Fe_min, Fe_max, M_Min, M_Max, Co_min, Co_max, se_min, se_max, cl_min, cl_max FROM plant_specifications WHERE modx_user_id = ? AND plant_type = ? '); $stmt->execute([$userId, $plantType]); $specs = $stmt->fetchAll(); $h = fn($v) => htmlspecialchars((string) $v, ENT_QUOTES, 'UTF-8'); if (empty($specs)) { echo '

No specifications found for plant type: ' . $h($plantType) . '

'; } else { echo '
'; echo ''; echo ''; $cols = array_keys($specs[0]); foreach ($cols as $col) { $label = ucwords(str_replace('_', ' ', $col)); echo ''; } echo ''; foreach ($specs as $row) { echo ''; foreach ($row as $key => $val) { $display = ($val === '' || $val === null) ? '0.0' : (is_numeric($val) ? number_format((float) $val, 2, '.', '') : $h($val)); echo ''; } echo ''; } echo '
' . $h($label) . '
' . $display . '
'; } // ── Plant images gallery ────────────────────────────────────────────────── $imgStmt = $pdo->prepare('SELECT id, name FROM plant_images ORDER BY id DESC LIMIT 20'); $imgStmt->execute(); $images = $imgStmt->fetchAll(); if (!empty($images)) { echo '
'; foreach ($images as $img) { echo '
'; echo ''; echo '
'; } echo '
'; } // ── Image upload form ───────────────────────────────────────────────────── ?>