| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- // dashboard/crop-analysis/soil-test-data.php
- // New include-based layout (migrating from modX snippets)
- // Start session for CSRF protection
- if (session_status() === PHP_SESSION_NONE) {
- session_start();
- }
- $pageTitle = 'Soil Test Analysis Report';
- $siteName = 'Crop Management Platform';
- $activeItem = 'Soil Analysis';
- include __DIR__ . '/../../../layouts/header.php';
- include __DIR__ . '/../../../layouts/navbar.php';
- ?>
- <div id="layoutSidenav">
- <div id="layoutSidenav_nav">
- <?php include __DIR__ . '/../../../layouts/sidebar.php'; ?>
- </div>
- <div id="layoutSidenav_content">
- <main>
- <div class="container-fluid px-4">
- <h1 class="mt-4"><?= htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8') ?></h1>
- <ol class="breadcrumb mb-4"><!-- TODO: render breadcrumbs dynamically --></ol>
- <div class="row">
- <div class="container">
- <h3 id="forms-example">Soil Test Details</h3>
- <p class="text-muted">Complete the soil test form and submit.</p>
- <!-- Client Details Form Component -->
- <?php include __DIR__ . '/../../components/clientDetailsForm.php'; ?>
- <!-- New Client Modal Component -->
- <?php include __DIR__ . '/../../components/newClientModal.php'; ?>
- <form method="post" action="/controllers/soilTestSubmit.php" id="SoilcsvForm" class="needs-validation" novalidate>
- <input type="hidden" name="csrf_token" value="<?php echo generateCsrfToken(); ?>">
- <?php // Soil Analysis Form Component ?>
- <?php include __DIR__ . '/../../components/soilAnalysisForm.php'; ?>
- <button form="SoilcsvForm" type="submit" name="SoilcsvForm" class="btn btn-success">Submit</button>
- </form>
- <hr />
- <div class="card">
- <div class="card-body">
- <h5 class="card-title">Excel/CSV Upload</h5>
- <p class="card-text">Download a CSV of this form for easy filling or upload a filled form to pre-populate.</p>
- <div class="input-group mt-3">
- <div class="custom-file">
- <input type="file" class="custom-file-input" id="upload" accept=".csv" />
- <label class="custom-file-label border-success" for="upload">Choose file</label>
- </div>
- <div class="input-group-append">
- <button class="btn btn-success" type="button" id="download">Download</button>
- </div>
- </div>
- </div>
- </div>
- <?php // include __DIR__ . '/../../controllers/soilTestSubmit.php'; ?>
- <!-- old modX placeholders: [[!clientDetailsFORM]], [[!soilformSubmit]], [[!newClientDetails]] -->
- </div>
- </div>
- </div>
- </main>
- <footer class="py-4 bg-light mt-auto">
- <div class="container-fluid px-4">
- <div class="d-flex align-items-center justify-content-between small">
- <div class="text-muted">© <?= date('Y') ?> Crop Management Platform. All Rights Reserved.</div>
- <div>
- <a href="/privacy-policy.php">Privacy Policy</a> · <a href="/terms.php">Terms & Conditions</a>
- </div>
- </div>
- </div>
- </footer>
- </div>
- </div>
- <?php include __DIR__ . '/../../layouts/footer.php'; ?>
|