|
@@ -1,507 +1,262 @@
|
|
|
-<!doctype html>
|
|
|
|
|
-<html lang="en">
|
|
|
|
|
|
|
+<?php
|
|
|
|
|
+require_once __DIR__ . '/../../../config/database.php';
|
|
|
|
|
+require_once __DIR__ . '/../../../lib/auth.php';
|
|
|
|
|
+require_once __DIR__ . '/../../../lib/csrf.php';
|
|
|
|
|
|
|
|
-<head>
|
|
|
|
|
- <title>[[*longtitle]] | [[++site_name]]</title>
|
|
|
|
|
- <base href="[[!++site_url]]">
|
|
|
|
|
- <meta charset="[[++modx_charset]]">
|
|
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
|
|
|
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
|
- <meta name="keywords" content="[[*introtext]]">
|
|
|
|
|
- <meta name="description" content="[[*description]]">
|
|
|
|
|
- <link rel="icon" href="client-assets/images/favicon.ico?v=2" type="image/x-icon"> [[!Profile]]
|
|
|
|
|
-
|
|
|
|
|
- <script type="text/javascript">
|
|
|
|
|
- window.dataLayer = window.dataLayer || [];
|
|
|
|
|
-
|
|
|
|
|
- function gtag() {
|
|
|
|
|
- dataLayer.push(arguments);
|
|
|
|
|
- }
|
|
|
|
|
- gtag('js', new Date());
|
|
|
|
|
- gtag('set', {
|
|
|
|
|
- 'user_id': '[[+modx.user.id]]'
|
|
|
|
|
- }); // Set the user ID using signed-in user_id.
|
|
|
|
|
- gtag('config', 'UA-133963301-1');
|
|
|
|
|
- </script>
|
|
|
|
|
-
|
|
|
|
|
- <link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" />
|
|
|
|
|
- <link href="client-assets/css/dashboard-2021.css" rel="stylesheet" />
|
|
|
|
|
- <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js" crossorigin="anonymous"></script>
|
|
|
|
|
- <link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet" crossorigin="anonymous" />
|
|
|
|
|
- <script src="client-assets/js/skycons.js"></script>
|
|
|
|
|
- <style>
|
|
|
|
|
- .btn-append {
|
|
|
|
|
- color: #495057;
|
|
|
|
|
- background-color: #e9ecef;
|
|
|
|
|
- border: 1px solid #ced4da;
|
|
|
|
|
- }
|
|
|
|
|
- .footer {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 60px;
|
|
|
|
|
- line-height: 60px;
|
|
|
|
|
- }
|
|
|
|
|
- </style>
|
|
|
|
|
-</head>
|
|
|
|
|
|
|
+if (session_status() === PHP_SESSION_NONE) {
|
|
|
|
|
+ session_start();
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-<body class="sb-nav-fixed" id="page-top">
|
|
|
|
|
- [[!Personalize?
|
|
|
|
|
- &yesChunk=`navHeaderLogged`
|
|
|
|
|
- &noChunk=`navHeader`
|
|
|
|
|
- &allowedGroups=`basicClients,bacicAdmin,companyClients,companyManagers`
|
|
|
|
|
- ]]
|
|
|
|
|
-
|
|
|
|
|
- <div id="layoutSidenav">
|
|
|
|
|
- <div id="layoutSidenav_nav">
|
|
|
|
|
- <!-- Sidebar -->
|
|
|
|
|
- [[Wayfinder?
|
|
|
|
|
- &startId=`2`
|
|
|
|
|
- &displayStart=`0`
|
|
|
|
|
- &startitemTpl=`startitemTpl`
|
|
|
|
|
- &selfClass=`show`
|
|
|
|
|
- &level=`2`
|
|
|
|
|
- &outerTpl=`outer`
|
|
|
|
|
- &outerClass=`sb-sidenav accordion sb-sidenav-dark`
|
|
|
|
|
- &rowTpl=`row`
|
|
|
|
|
- &rowClass=`nav-link`
|
|
|
|
|
- &parentRowTpl=`parentRow`
|
|
|
|
|
- &parentClass=`nav-link collapsed`
|
|
|
|
|
- &innerTpl=`inner`
|
|
|
|
|
- &innerClass=`collapse`
|
|
|
|
|
- &innerRowTpl=`secondInner`
|
|
|
|
|
- &innerRowClass=`nav-link`
|
|
|
|
|
- ]]
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div id="layoutSidenav_content">
|
|
|
|
|
- <main>
|
|
|
|
|
|
|
+requireLogin();
|
|
|
|
|
|
|
|
- <div class="container-fluid px-4">
|
|
|
|
|
- <h1 class="mt-4">[[*pagetitle]]</h1>
|
|
|
|
|
|
|
+$pageTitle = 'Water Test Analysis';
|
|
|
|
|
+$siteName = 'Crop Monitor';
|
|
|
|
|
|
|
|
- <ol class="breadcrumb mb-4"> [[$dash-breadcrumbs]] </ol>
|
|
|
|
|
-
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js" integrity="sha256-gfQwA6PlkZsLqWu4bU4hXPrbTqzixm0B5MdvBLI+Oas=" crossorigin="anonymous"></script>
|
|
|
|
|
|
|
+include __DIR__ . '/../../../layouts/header.php';
|
|
|
|
|
+include __DIR__ . '/../../../layouts/navbar.php';
|
|
|
|
|
+?>
|
|
|
|
|
|
|
|
-<div class="grid-form1">
|
|
|
|
|
-<h3 id="forms-example" class="">[[*longtitle]]</h3>
|
|
|
|
|
-
|
|
|
|
|
-<span class="error">* required fields.</span>
|
|
|
|
|
-
|
|
|
|
|
-<form method="post" action="[[~34~]]" id="WatercsvForm"class="needs-validation" novalidate >
|
|
|
|
|
|
|
+<style>
|
|
|
|
|
+ .btn-append {
|
|
|
|
|
+ color: #495057;
|
|
|
|
|
+ background-color: #e9ecef;
|
|
|
|
|
+ border: 1px solid #ced4da;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|
|
|
|
|
|
|
|
- [[!Personalize?
|
|
|
|
|
- &yesChunk=`analysisLogged_Clientdetails`
|
|
|
|
|
- &noChunk=`analysis_Clientdetails`
|
|
|
|
|
- ]]
|
|
|
|
|
-
|
|
|
|
|
- <hr>
|
|
|
|
|
-
|
|
|
|
|
- <div class="row">
|
|
|
|
|
-
|
|
|
|
|
- <div class="col ">
|
|
|
|
|
- <small id="lab_no" class="form-text text-muted">Lab No</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="lab_no" id="lab_no" placeholder="Lab No"></input>
|
|
|
|
|
-
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="col ">
|
|
|
|
|
- <small id="batch_no" class="form-text text-muted">Batch No</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="batch_no" id="batch_no" placeholder="Batch No"></input>
|
|
|
|
|
-
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col ">
|
|
|
|
|
- <small id="date_sampled" class="form-text text-muted">Date Sampled</small>
|
|
|
|
|
- <input data-provide="datepicker" class="form-control form-control-sm" name="date_sampled" id="datepicker" placeholder="Date Sampled" data-date-format="dd/mm/yyyy" data-date-end-date="0d" ></input>
|
|
|
|
|
- <script>
|
|
|
|
|
- $('#datepicker').datepicker({
|
|
|
|
|
- uiLibrary: 'bootstrap4',
|
|
|
|
|
- calendarWeeks: 'true',
|
|
|
|
|
- todayHighlight: 'true'
|
|
|
|
|
- });
|
|
|
|
|
- </script>
|
|
|
|
|
|
|
+<div id="layoutSidenav">
|
|
|
|
|
+ <div id="layoutSidenav_nav">
|
|
|
|
|
+ <?php include __DIR__ . '/../../../layouts/sidebar.php'; ?>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <!-- Hidden Fields for Database -->
|
|
|
|
|
- <input type="hidden" class="form-control form-control-sm" name="m_user" id="m_user" placeholder="[[+modx.user.id]]" required>
|
|
|
|
|
- <input type="hidden" class="form-control form-control-sm" name="client_id" id="client_id" placeholder="[[+modx.user.username]]" required>
|
|
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <li class="breadcrumb-item"><a href="/dashboard/dashboard.php">Dashboard</a></li>
|
|
|
|
|
+ <li class="breadcrumb-item active">Water Test Analysis</li>
|
|
|
|
|
+ </ol>
|
|
|
|
|
|
|
|
- <div class="col ">
|
|
|
|
|
- <small id="lab_no" class="form-text text-muted">Sample ID<span class="error">*</span></small>
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="sample_id" id="sample_id" placeholder="Sample Id" required></input>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="col ">
|
|
|
|
|
- <small id="lab_no" class="form-text text-muted">Site ID</small>
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="site_id" id="site_id" placeholder="Paddock Id"></input>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="container">
|
|
|
|
|
+ <h3>Water Test Details</h3>
|
|
|
|
|
+ <span class="text-danger small">* required fields.</span>
|
|
|
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <?php include __DIR__ . '/../../../components/clientDetailsForm.php'; ?>
|
|
|
|
|
|
|
|
-<hr>
|
|
|
|
|
|
|
+ <form method="post" action="/controllers/waterTestSubmit.php" id="WatercsvForm" class="needs-validation" novalidate>
|
|
|
|
|
+ <input type="hidden" name="csrf_token" value="<?= htmlspecialchars(generateCsrfToken(), ENT_QUOTES, 'UTF-8') ?>">
|
|
|
|
|
|
|
|
-<label class="col"><b>Analysis Inputs</b></label>
|
|
|
|
|
-
|
|
|
|
|
-<div class="row">
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="phSmall" class="form-text text-muted">pH</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="ph" id="ph" placeholder="pH" required></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" value="pH" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="phSmall" class="form-text text-muted">Conductivity</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="ph" id="ph" placeholder="pH" required></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" value="pH" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <small class="form-text text-muted">Lab No</small>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="lab_no" id="lab_no" placeholder="Lab No">
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
-<div class="row">
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="nSmall" class="form-text text-muted">Nitrogen</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="n" id="n" placeholder="N - Nitrogen" required></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="nitrogen" value="ppm" onClick="conversion(this, nitrogen, n, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="p" class="form-text text-muted">Phosphorus</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="p" id="p" placeholder="P - Phosphorus" required></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="phosphorus" value="ppm" onClick="conversion(this, phosphorus, p, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="k" class="form-text text-muted">Postassium</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="k" id="k" placeholder="K - Postassium" required></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="postassium" value="ppm" onClick="conversion(this, postassium, k, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="s" class="form-text text-muted">Sulphur</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="s" id="s" placeholder="S - Sulphur"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="sulphur" value="ppm" onClick="conversion(this, sulphur, s, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="mg" class="form-text text-muted">Magnesium</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="mg" id="mg" placeholder="Mg - Magnesium"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="magnesium" value="ppm" onClick="conversion(this, magnesium, mg, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="ca" class="form-text text-muted">Calcium</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="ca" id="ca" placeholder="Ca - Calcium"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="calcium" value="ppm" onClick="conversion(this, calcium, ca, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <small class="form-text text-muted">Batch No</small>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="batch_no" id="batch_no" placeholder="Batch No">
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <small class="form-text text-muted">Date Sampled</small>
|
|
|
|
|
+ <input type="date" class="form-control form-control-sm" name="date_sampled" id="date_sampled" placeholder="Date Sampled">
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-<div class="row">
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="na" class="form-text text-muted">Soduim</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="na" id="na" placeholder="Na - Soduim"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="soduim" value="ppm" onClick="conversion(this, soduim, na, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="fe" class="form-text text-muted">Iron</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="fe" id="fe" placeholder="Fe - Iron"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="iron" value="ppm" onClick="conversion(this, iron, fe, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="mn" class="form-text text-muted">Manganese</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="mn" id="mn" placeholder="Mn - Manganese"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="manganese" value="ppm" onClick="conversion(this, manganese, mn, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="zn" class="form-text text-muted">Zinc</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="zn" id="zn" placeholder="Zn - Zinc"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="zinc" value="ppm" onClick="conversion(this, zinc, zn, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="cu" class="form-text text-muted">Copper</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="cu" id="cu" placeholder="Cu - Copper"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="copper" value="ppm" onClick="conversion(this, copper, cu, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="b" class="form-text text-muted">Boron</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="b" id="b" placeholder="B - Boron"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="boron" value="ppm" onClick="conversion(this, boron, b, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <small class="form-text text-muted">Sample ID <span class="text-danger">*</span></small>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="sample_id" id="sample_id" placeholder="Sample Id" required>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
-<div class="row">
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="m" class="form-text text-muted">Molybdenum</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="m" id="m" placeholder="M - Molybdenum"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="molybdenum" value="ppm" onClick="conversion(this, molybdenum, m, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="co" class="form-text text-muted">Cobalt</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="co" id="co" placeholder="Co - Cobalt"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="cobalt" value="ppm" onClick="conversion(this, cobalt, co, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="se" class="form-text text-muted">Selenium</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="se" id="se" placeholder="Se - Selenium"></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="selenium" value="ppm" onClick="conversion(this, selenium, se, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class=" col-md-2">
|
|
|
|
|
- <small id="ch" class="form-text text-muted">Chloride</small>
|
|
|
|
|
- <div class="input-group input-group-sm mb-3">
|
|
|
|
|
- <input type="text" class="form-control form-control-sm" name="ch" id="ch" placeholder="Ch - Chloride" required></input>
|
|
|
|
|
- <div class="input-group-append">
|
|
|
|
|
- <input class="btn btn-append" type="button" id="chloride" value="ppm" onClick="conversion(this, chloride, cg, 10000)" ></input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <small class="form-text text-muted">Site ID</small>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="site_id" id="site_id" placeholder="Paddock Id">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <label class="col"><b>Analysis Inputs</b></label>
|
|
|
|
|
|
|
|
-<script type="text/javascript">
|
|
|
|
|
- function conversion(value, input, element, conversion) {
|
|
|
|
|
- var Nvalue = document.getElementById(element.id).value;
|
|
|
|
|
- var el = document.getElementById(input.id);
|
|
|
|
|
- if ( el.value === "%" ) {
|
|
|
|
|
- el.value = "ppm";
|
|
|
|
|
- document.getElementById(element.id).value = Nvalue*conversion;
|
|
|
|
|
- } else {
|
|
|
|
|
- el.value = "%";
|
|
|
|
|
- document.getElementById(element.id).value = Nvalue/conversion;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
- <button id="WatercsvForm" type="submit" class="btn btn-success">Submit</button>
|
|
|
|
|
-</form>
|
|
|
|
|
|
|
+ <div class="row mt-2">
|
|
|
|
|
+ <div class="col-md-2">
|
|
|
|
|
+ <small class="form-text text-muted">pH <span class="text-danger">*</span></small>
|
|
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="ph" id="ph" placeholder="pH" required>
|
|
|
|
|
+ <span class="input-group-text">pH</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- [[$waterAnalysisUpload]]
|
|
|
|
|
|
|
+ <div class="col-md-2">
|
|
|
|
|
+ <small class="form-text text-muted">Conductivity</small>
|
|
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="cond_dsm" id="cond_dsm" placeholder="Conductivity">
|
|
|
|
|
+ <span class="input-group-text">dS/m</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
-<hr>
|
|
|
|
|
|
|
+ <div class="col-md-2">
|
|
|
|
|
+ <small class="form-text text-muted">Bicarbonate (HCO3-)</small>
|
|
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" name="hco3" id="hco3" placeholder="HCO3-">
|
|
|
|
|
+ <span class="input-group-text">mg/L</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
-<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">
|
|
|
|
|
- <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>
|
|
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $elements = [
|
|
|
|
|
+ ['n', 'Nitrogen', 10000],
|
|
|
|
|
+ ['p', 'Phosphorus', 10000],
|
|
|
|
|
+ ['k', 'Potassium', 10000],
|
|
|
|
|
+ ['s', 'Sulphur', 10000],
|
|
|
|
|
+ ['mg', 'Magnesium', 10000],
|
|
|
|
|
+ ['ca', 'Calcium', 10000],
|
|
|
|
|
+ ];
|
|
|
|
|
+ foreach ($elements as [$id, $label, $factor]): ?>
|
|
|
|
|
+ <div class="col-md-2">
|
|
|
|
|
+ <small class="form-text text-muted"><?= htmlspecialchars($label, ENT_QUOTES, 'UTF-8') ?></small>
|
|
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm"
|
|
|
|
|
+ name="<?= $id ?>" id="<?= $id ?>"
|
|
|
|
|
+ placeholder="<?= htmlspecialchars($id . ' - ' . $label, ENT_QUOTES, 'UTF-8') ?>">
|
|
|
|
|
+ <input class="btn btn-append" type="button"
|
|
|
|
|
+ id="btn_<?= $id ?>" value="ppm"
|
|
|
|
|
+ onclick="conversion(this, document.getElementById('<?= $id ?>'), <?= $factor ?>)">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php endforeach; ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $elements2 = [
|
|
|
|
|
+ ['na', 'Sodium', 10000],
|
|
|
|
|
+ ['fe', 'Iron', 10000],
|
|
|
|
|
+ ['mn', 'Manganese', 10000],
|
|
|
|
|
+ ['zn', 'Zinc', 10000],
|
|
|
|
|
+ ['cu', 'Copper', 10000],
|
|
|
|
|
+ ['b', 'Boron', 10000],
|
|
|
|
|
+ ];
|
|
|
|
|
+ foreach ($elements2 as [$id, $label, $factor]): ?>
|
|
|
|
|
+ <div class="col-md-2">
|
|
|
|
|
+ <small class="form-text text-muted"><?= htmlspecialchars($label, ENT_QUOTES, 'UTF-8') ?></small>
|
|
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm"
|
|
|
|
|
+ name="<?= $id ?>" id="<?= $id ?>"
|
|
|
|
|
+ placeholder="<?= htmlspecialchars($id . ' - ' . $label, ENT_QUOTES, 'UTF-8') ?>">
|
|
|
|
|
+ <input class="btn btn-append" type="button"
|
|
|
|
|
+ id="btn_<?= $id ?>" value="ppm"
|
|
|
|
|
+ onclick="conversion(this, document.getElementById('<?= $id ?>'), <?= $factor ?>)">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php endforeach; ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $elements3 = [
|
|
|
|
|
+ ['m', 'Molybdenum', 10000],
|
|
|
|
|
+ ['co', 'Cobalt', 10000],
|
|
|
|
|
+ ['se', 'Selenium', 10000],
|
|
|
|
|
+ ['ch', 'Chloride', 10000],
|
|
|
|
|
+ ];
|
|
|
|
|
+ foreach ($elements3 as [$id, $label, $factor]): ?>
|
|
|
|
|
+ <div class="col-md-2">
|
|
|
|
|
+ <small class="form-text text-muted"><?= htmlspecialchars($label, ENT_QUOTES, 'UTF-8') ?></small>
|
|
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm"
|
|
|
|
|
+ name="<?= $id ?>" id="<?= $id ?>"
|
|
|
|
|
+ placeholder="<?= htmlspecialchars($id . ' - ' . $label, ENT_QUOTES, 'UTF-8') ?>">
|
|
|
|
|
+ <input class="btn btn-append" type="button"
|
|
|
|
|
+ id="btn_<?= $id ?>" value="ppm"
|
|
|
|
|
+ onclick="conversion(this, document.getElementById('<?= $id ?>'), <?= $factor ?>)">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php endforeach; ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
+ <button type="submit" class="btn btn-success">Submit</button>
|
|
|
|
|
+ </form>
|
|
|
|
|
|
|
|
-<!-- ************************ Download Form as CSV ************************ -->
|
|
|
|
|
-<script>
|
|
|
|
|
- document.getElementById("upload").addEventListener("change", upload, false);
|
|
|
|
|
- document.getElementById("download").addEventListener("click", download, false);
|
|
|
|
|
-
|
|
|
|
|
- function upload(e) {
|
|
|
|
|
- var data = null;
|
|
|
|
|
- var file = e.target.files[0];
|
|
|
|
|
- var reader = new FileReader();
|
|
|
|
|
- reader.readAsText(file);
|
|
|
|
|
- reader.onload = function (event) {
|
|
|
|
|
- var csvData = event.target.result;
|
|
|
|
|
- var parsedCSV = d3.csv.parseRows(csvData);
|
|
|
|
|
- parsedCSV.forEach(function (d, i) {
|
|
|
|
|
- if (i == 0) return true; // skip the header
|
|
|
|
|
- document.getElementById(d[0]).value = d[1];
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function download(e) {
|
|
|
|
|
- data = [ ["id","value"]];
|
|
|
|
|
- var f = d3.selectAll("#WatercsvForm input, select")[0];
|
|
|
|
|
- f.forEach(function(d,i){
|
|
|
|
|
- data.push([d.id, d.value]);
|
|
|
|
|
- });
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- var csvContent = "data:text/csv;charset=utf-8,";
|
|
|
|
|
- data.forEach(function (d, i) {
|
|
|
|
|
- dataString = d.join(",");
|
|
|
|
|
- csvContent += i < data.length ? dataString + "\n" : dataString;
|
|
|
|
|
- });
|
|
|
|
|
- var url = window.location.pathname;
|
|
|
|
|
- var filename = url.substring(url.lastIndexOf('/')+1);
|
|
|
|
|
- var fname = filename.split(".")[0];
|
|
|
|
|
- var today = new Date();
|
|
|
|
|
- var date = today.getDate()+''+(today.getMonth()+1)+''+today.getFullYear();
|
|
|
|
|
- var csvname = date+''+"-water.csv";
|
|
|
|
|
-
|
|
|
|
|
- var encodedUri = encodeURI(csvContent);
|
|
|
|
|
- var link = document.createElement("a");
|
|
|
|
|
- link.setAttribute("href", encodedUri);
|
|
|
|
|
- link.setAttribute("download", csvname);
|
|
|
|
|
- link.click();
|
|
|
|
|
- }
|
|
|
|
|
-</script>
|
|
|
|
|
-<script type="text/javascript">
|
|
|
|
|
- // JavaScript for disabling form submission if there are invalid fields
|
|
|
|
|
- (function() {
|
|
|
|
|
- 'use strict';
|
|
|
|
|
- window.addEventListener('load', function() {
|
|
|
|
|
- // Fetch all the forms we want to apply custom Bootstrap validation styles to
|
|
|
|
|
- var forms = document.getElementsByClassName('needs-validation');
|
|
|
|
|
- // Loop over them and prevent submission
|
|
|
|
|
- var validation = Array.prototype.filter.call(forms, function(form) {
|
|
|
|
|
- form.addEventListener('submit', function(event) {
|
|
|
|
|
- if (form.checkValidity() === false) {
|
|
|
|
|
- event.preventDefault();
|
|
|
|
|
- event.stopPropagation();
|
|
|
|
|
- }
|
|
|
|
|
- form.classList.add('was-validated');
|
|
|
|
|
- }, false);
|
|
|
|
|
- });
|
|
|
|
|
- }, false);
|
|
|
|
|
- })();
|
|
|
|
|
-
|
|
|
|
|
-</script>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <?php include __DIR__ . '/../../../components/newClientModal.php'; ?>
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <hr>
|
|
|
|
|
|
|
|
- </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">[[SimpleCopyright? &startYear=`2003`]]. All Rights Reserved <a href="[[~1]]"></a></div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <a href="[[~39~]]">Privacy Policy</a>
|
|
|
|
|
- ·
|
|
|
|
|
- <a href="[[~39~]]">Terms & Conditions</a>
|
|
|
|
|
|
|
+ <div class="card mt-3">
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <input type="file" class="form-control" id="upload" accept=".csv">
|
|
|
|
|
+ <button class="btn btn-success" type="button" id="download">Download</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </footer>
|
|
|
|
|
-
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </main>
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <?php include __DIR__ . '/../../../layouts/footer.php'; ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
|
|
|
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
|
|
|
|
- <script>
|
|
|
|
|
- /*!
|
|
|
|
|
- * Start Bootstrap - SB Admin v7.0.3 (https://startbootstrap.com/template/sb-admin)
|
|
|
|
|
- * Copyright 2013-2021 Start Bootstrap
|
|
|
|
|
- * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-sb-admin/blob/master/LICENSE)
|
|
|
|
|
- */
|
|
|
|
|
- //
|
|
|
|
|
- // Scripts
|
|
|
|
|
- //
|
|
|
|
|
-
|
|
|
|
|
- window.addEventListener('DOMContentLoaded', event => {
|
|
|
|
|
-
|
|
|
|
|
- // Toggle the side navigation
|
|
|
|
|
- const sidebarToggle = document.body.querySelector('#sidebarToggle');
|
|
|
|
|
- if (sidebarToggle) {
|
|
|
|
|
- // Uncomment Below to persist sidebar toggle between refreshes
|
|
|
|
|
- // if (localStorage.getItem('sb|sidebar-toggle') === 'true') {
|
|
|
|
|
- // document.body.classList.toggle('sb-sidenav-toggled');
|
|
|
|
|
- // }
|
|
|
|
|
- sidebarToggle.addEventListener('click', event => {
|
|
|
|
|
- event.preventDefault();
|
|
|
|
|
- document.body.classList.toggle('sb-sidenav-toggled');
|
|
|
|
|
- localStorage.setItem('sb|sidebar-toggle', document.body.classList.contains('sb-sidenav-toggled'));
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+<script>
|
|
|
|
|
+function conversion(btnEl, element, factor) {
|
|
|
|
|
+ var val = parseFloat(element.value) || 0;
|
|
|
|
|
+ if (btnEl.value === 'ppm') {
|
|
|
|
|
+ btnEl.value = '%';
|
|
|
|
|
+ element.value = (val / factor).toFixed(4);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ btnEl.value = 'ppm';
|
|
|
|
|
+ element.value = (val * factor).toFixed(2);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// CSV download
|
|
|
|
|
+document.getElementById('download').addEventListener('click', function () {
|
|
|
|
|
+ var data = [['id', 'value']];
|
|
|
|
|
+ document.querySelectorAll('#WatercsvForm input:not([type=hidden]):not([type=button]):not([type=submit]), #WatercsvForm select').forEach(function (el) {
|
|
|
|
|
+ if (el.id) data.push([el.id, el.value]);
|
|
|
|
|
+ });
|
|
|
|
|
+ var csv = data.map(function (r) { return r.join(','); }).join('\n');
|
|
|
|
|
+ var today = new Date();
|
|
|
|
|
+ var fname = today.getDate() + '' + (today.getMonth() + 1) + '' + today.getFullYear() + '-water.csv';
|
|
|
|
|
+ var link = document.createElement('a');
|
|
|
|
|
+ link.setAttribute('href', 'data:text/csv;charset=utf-8,' + encodeURIComponent(csv));
|
|
|
|
|
+ link.setAttribute('download', fname);
|
|
|
|
|
+ link.click();
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// CSV upload
|
|
|
|
|
+document.getElementById('upload').addEventListener('change', function (e) {
|
|
|
|
|
+ var file = e.target.files[0];
|
|
|
|
|
+ if (!file) return;
|
|
|
|
|
+ var reader = new FileReader();
|
|
|
|
|
+ reader.onload = function (ev) {
|
|
|
|
|
+ ev.target.result.split('\n').slice(1).forEach(function (line) {
|
|
|
|
|
+ var parts = line.split(',');
|
|
|
|
|
+ var el = document.getElementById(parts[0]);
|
|
|
|
|
+ if (el) el.value = parts[1] || '';
|
|
|
});
|
|
});
|
|
|
|
|
+ };
|
|
|
|
|
+ reader.readAsText(file);
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
- </script>
|
|
|
|
|
- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
|
|
|
|
|
- <script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" crossorigin="anonymous"></script>
|
|
|
|
|
-</body>
|
|
|
|
|
-</html>
|
|
|
|
|
|
|
+// Bootstrap validation
|
|
|
|
|
+(function () {
|
|
|
|
|
+ 'use strict';
|
|
|
|
|
+ document.querySelectorAll('.needs-validation').forEach(function (form) {
|
|
|
|
|
+ form.addEventListener('submit', function (event) {
|
|
|
|
|
+ if (!form.checkValidity()) {
|
|
|
|
|
+ event.preventDefault();
|
|
|
|
|
+ event.stopPropagation();
|
|
|
|
|
+ }
|
|
|
|
|
+ form.classList.add('was-validated');
|
|
|
|
|
+ }, false);
|
|
|
|
|
+ });
|
|
|
|
|
+})();
|
|
|
|
|
+</script>
|