|
@@ -72,6 +72,40 @@ $siteName = 'Crop Monitor';
|
|
|
|
|
|
|
|
include __DIR__ . '/../../../layouts/header.php';
|
|
include __DIR__ . '/../../../layouts/header.php';
|
|
|
?>
|
|
?>
|
|
|
|
|
+<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;
|
|
|
|
|
+ }
|
|
|
|
|
+ .report-textarea {
|
|
|
|
|
+ border:none;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .report-textarea {
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ resize: none;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="container-fluid px-4">
|
|
<div class="container-fluid px-4">
|
|
@@ -232,12 +266,18 @@ include __DIR__ . '/../../../layouts/header.php';
|
|
|
|
|
|
|
|
// ── Auto-save ────────────────────────────────────────────────────────── //
|
|
// ── Auto-save ────────────────────────────────────────────────────────── //
|
|
|
document.querySelectorAll('.report-form .report-textarea')
|
|
document.querySelectorAll('.report-form .report-textarea')
|
|
|
- .forEach(function (el) {
|
|
|
|
|
- el.addEventListener('input', function () {
|
|
|
|
|
- clearTimeout(saveTimer);
|
|
|
|
|
- saveTimer = setTimeout(saveReport, 1200);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ .forEach(function (el) {
|
|
|
|
|
+
|
|
|
|
|
+ // initial resize
|
|
|
|
|
+ autoResize(el);
|
|
|
|
|
+
|
|
|
|
|
+ el.addEventListener('input', function () {
|
|
|
|
|
+ autoResize(el);
|
|
|
|
|
+
|
|
|
|
|
+ clearTimeout(saveTimer);
|
|
|
|
|
+ saveTimer = setTimeout(saveReport, 1200);
|
|
|
});
|
|
});
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
function saveReport() {
|
|
function saveReport() {
|
|
|
var form = document.querySelector('.report-form');
|
|
var form = document.querySelector('.report-form');
|
|
@@ -261,6 +301,26 @@ include __DIR__ . '/../../../layouts/header.php';
|
|
|
saveReport();
|
|
saveReport();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ function autoResize(el) {
|
|
|
|
|
+ el.style.height = 'auto';
|
|
|
|
|
+ el.style.height = el.scrollHeight + 'px';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ document.querySelectorAll('.report-textarea').forEach(function (el) {
|
|
|
|
|
+
|
|
|
|
|
+ // force correct initial height AFTER render
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ autoResize(el);
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+
|
|
|
|
|
+ el.addEventListener('input', function () {
|
|
|
|
|
+ autoResize(el);
|
|
|
|
|
+
|
|
|
|
|
+ clearTimeout(saveTimer);
|
|
|
|
|
+ saveTimer = setTimeout(saveReport, 1200);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// ── AI generation ────────────────────────────────────────────────────── //
|
|
// ── AI generation ────────────────────────────────────────────────────── //
|
|
|
function generateSection(btn, section, targetSelector) {
|
|
function generateSection(btn, section, targetSelector) {
|
|
|
var textarea = document.querySelector(targetSelector);
|
|
var textarea = document.querySelector(targetSelector);
|