Selaa lähdekoodia

Plant Analysis

Benjamin Harris 2 kuukautta sitten
vanhempi
sitoutus
cc4d435afa

+ 47 - 35
dashboard/crop-analysis/plant-test-data/plant-analysis.php

@@ -89,18 +89,35 @@ $siteName  = 'Crop Monitor';
 
 if (!$printMode) {
     include __DIR__ . '/../../../layouts/header.php';
-    include __DIR__ . '/../../../layouts/navbar.php';
 }
 ?>
 
-<?php if (!$printMode): ?>
 <link rel="stylesheet" href="/client-assets/home/css/graphPrint.css" media="print">
 <style>
+    @media print {
+        @page {
+            size: A4 portrait;
+        }
+        @page :left {
+            margin-left: 0.5cm;
+        }
+        @page :right {
+            margin-right: 0.5cm;
+        }
+        @page :top {
+            margin-top: 0cm;
+        }
+        @page :bottom {
+            margin-bottom: 0cm;
+        }
+        body {
+            min-width: 992px !important;
+        }
+        .container {
+            min-width: 992px !important;
+        }
+    }
     .progress { border-radius: 0 !important; }
-    table.chart { width: 100%; border-collapse: collapse; }
-    table.chart th, table.chart td { padding: 3px 6px; font-size: 0.85rem; }
-    .chart-header th { background: #343a40; color: white; }
-    .chart-header-sub th { background: #6c757d; color: white; }
     .lightgreen  { background: #d4edda !important; color: #155724 !important; }
     .lightred    { background: #f8d7da !important; color: #721c24 !important; }
     .lightpurple { background: #e2d9f3 !important; color: #432874 !important; }
@@ -113,13 +130,11 @@ if (!$printMode) {
 
 <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">
 
-<?php endif; ?>
 
 <div class="container" id="content">
 
@@ -128,9 +143,9 @@ if (!$printMode) {
     <?php else: ?>
 
     <!-- ── Header ──────────────────────────────────────────────────────────── -->
-    <div class="row mb-2 mt-3">
+    <div class="row mb-2">
         <div class="col-md-3">
-            <img class="img-fluid" src="/client-assets/images/crop-monitor.png" alt="Crop Monitor" style="max-height:55px;">
+            <img class="img-fluid" src="/client-assets/images/crop-monitor.png" alt="Crop Monitor">
         </div>
     </div>
 
@@ -189,23 +204,28 @@ if (!$printMode) {
         <div class="col-md-12 text-center fw-bold h4">Plant Tissue Analysis Results</div>
     </div>
 
-    <hr class="p-1 m-1">
-
     <table class="chart">
         <tbody>
             <tr class="chart-header">
-                <th colspan="3" class="text-center border-left border-right border-top">ELEMENT</th>
-                <th colspan="3" class="text-center border-right border-top">STATUS</th>
+                <th colspan="3" class="text-center col-md-6 border-left border-right border-top">ELEMENT</th>
+                <th colspan="3" class="text-center col-md-6 border-right border-top">STATUS</th>
             </tr>
             <tr class="chart-header-sub">
-                <th class="text-center border-bottom border-left">Element</th>
-                <th class="text-center border-bottom">Desired</th>
-                <th class="text-center border-bottom">Found</th>
-                <th class="text-center stripe-1">Deficient</th>
-                <th class="text-center stripe-1">Ideal</th>
-                <th class="text-center border-right stripe-1">High</th>
+                <th class="text-center col-18 border-left"></th>
+                <th class="text-center col-15">DESIRED</th>
+                <th class="text-center col-15">FOUND</th>
+                <th class="text-center col-16 stripe-1">Deficient</th>
+                <th class="text-center col-16 stripe-1">Ideal</th>
+                <th class="text-center col-16 border-right stripe-1">High</th>
             </tr>
-            <tr><td class="border-left" colspan="6"></td></tr>
+            <tr>
+            <td class="border-left"></td>
+            <td class="border-left"></td>
+            <td class="border-left"></td>
+            <td class="border-left"></td>
+            <td class="border-left"></td>
+            <td class="border-left border-right"></td>
+          </tr>
 
             <!-- Major Elements -->
             <tr class="chart-header-sub">
@@ -230,8 +250,8 @@ if (!$printMode) {
             ?>
             <tr>
                 <td class="border-left"><?= $h($nutrient) ?> (<?= $h($unit) ?>)</td>
-                <td><?= $h($desired) ?></td>
-                <td><?= $found > 0 ? number_format($found, $dp) : '—' ?></td>
+                <td class="text-center"><?= $h($desired) ?></td>
+                <td class="text-center"><?= $found > 0 ? number_format($found, $dp) : '—' ?></td>
                 <?= statusBar($found, $min, $max) ?>
             </tr>
             <?php endforeach; ?>
@@ -259,8 +279,8 @@ if (!$printMode) {
             ?>
             <tr>
                 <td class="border-left"><?= $h($nutrient) ?> (<?= $h($unit) ?>)</td>
-                <td><?= $h($desired) ?></td>
-                <td><?= $found > 0 ? number_format($found, $dp) : '—' ?></td>
+                <td class="text-center"><?= $h($desired) ?></td>
+                <td class="text-center"><?= $found > 0 ? number_format($found, $dp) : '—' ?></td>
                 <?= statusBar($found, $min, $max) ?>
             </tr>
             <?php endforeach; ?>
@@ -288,8 +308,8 @@ if (!$printMode) {
             ?>
             <tr>
                 <td class="border-left"><?= $h($nutrient) ?> (<?= $h($unit) ?>)</td>
-                <td><?= $h($desired) ?></td>
-                <td><?= $found > 0 ? number_format($found, $dp) : '—' ?></td>
+                <td class="text-center"><?= $h($desired) ?></td>
+                <td class="text-center"><?= $found > 0 ? number_format($found, $dp) : '—' ?></td>
                 <?= statusBar($found, $min, $max) ?>
             </tr>
             <?php endforeach; ?>
@@ -316,11 +336,3 @@ if (!$printMode) {
     <?php endif; ?>
 
 </div><!-- /.container -->
-
-<?php if (!$printMode): ?>
-            </div><!-- /.container-fluid -->
-        </main>
-        <?php include __DIR__ . '/../../../layouts/footer.php'; ?>
-    </div><!-- /#layoutSidenav_content -->
-</div><!-- /#layoutSidenav -->
-<?php endif; ?>

+ 1 - 2
dashboard/crop-analysis/soil-test-data/soil-analysis.php

@@ -84,7 +84,7 @@ include __DIR__.'/../../../layouts/header.php';
         </div>
     </div>
 
-    <table class="title">
+    <table class="title w-100 mb-3 small">
         <tbody>
             <tr>
                 <th class="col-20"></th><th class="col-20"></th><th class="col-20"></th>
@@ -156,7 +156,6 @@ include __DIR__.'/../../../layouts/header.php';
 
     <table class="chart">
         <tbody>
-
           <!-- ── CHART HEADER ──────────────────────────────────────────── -->
           <tr class="chart-header">
             <th colspan="3" class="text-center col-md-6 border-left border-right border-top">ELEMENT</th>

+ 1 - 1
pdf-files/headlessChrome_pdf.php

@@ -73,7 +73,7 @@ $reportTypes = [
     ],
     // Plant
     'plant-analysis' => [
-        'print_page'   => '/dashboard/crop-analysis/plant-test-data/plant-analysis-print.php?rid={rid}&rand={rand}&cid={cid}',
+        'print_page'   => '/dashboard/crop-analysis/plant-test-data/plant-analysis.php?rid={rid}&rand={rand}&cid={cid}',
         'verify_table' => 'plant_records',
         'filename'     => 'plant-analysis',
         'label'        => 'Plant Analysis',