|
@@ -0,0 +1,811 @@
|
|
|
|
|
+<!doctype html>
|
|
|
|
|
+<html lang="en">
|
|
|
|
|
+
|
|
|
|
|
+<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>
|
|
|
|
|
+
|
|
|
|
|
+<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>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="container-fluid px-4">
|
|
|
|
|
+ <h1 class="mt-4">[[*pagetitle]]</h1>
|
|
|
|
|
+
|
|
|
|
|
+ <ol class="breadcrumb mb-4"> [[$dash-breadcrumbs]] </ol>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="container-fluid">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <h2>[[*pagetitle]]</h2>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!--grid-->
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-12 col-md-3">
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <form action="#" method="GET">
|
|
|
|
|
+ <div class="input-group mb-3">
|
|
|
|
|
+ <input type="text" class="form-control" aria-label="Recipient's username" aria-describedby="basic-addon2" placeholder="Search...">
|
|
|
|
|
+ <div class="input-group-append">
|
|
|
|
|
+ <span class="input-group-text" id="basic-addon2"><i class="fa fa-search"></i></span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- Input Group -->
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row ">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="alert alert-danger" role="alert">
|
|
|
|
|
+ <h3>[[*longtitle]]</h3>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row ">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="list-group">
|
|
|
|
|
+ <a href="#" class="list-group-item list-group-item-action"> Folders
|
|
|
|
|
+ </a>
|
|
|
|
|
+ <a href="#" class="list-group-item list-group-item-action list-group-item-light text-warning">
|
|
|
|
|
+ <i class="fa fa-archive text-warning" aria-hidden="true"></i> Archived
|
|
|
|
|
+ <span class="badge badge-warning badge-pill float-right">[[!analysisCount? &analysis=`block_info` &cid=`[[+id]]` &status=`2` ]]</span>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ <a href="#" class="list-group-item list-group-item-action list-group-item-light text-danger">
|
|
|
|
|
+ <i class="fa fa-trash text-danger" aria-hidden="true"></i> Deleted
|
|
|
|
|
+ <span class="badge badge-danger badge-pill float-right">[[!analysisCount? &analysis=`block_info` &cid=`[[+id]]` &status=`3` ]]</span>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <hr>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- tab content -->
|
|
|
|
|
+ <div class="col-12 col-md-9 ">
|
|
|
|
|
+ <!-- tab content -->
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <br>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <h3>[[*longtitle]]</h3>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <button type="button" class="btn btn-success" data-toggle="modal" data-target="#createPaddock">Create New Paddock</button>
|
|
|
|
|
+ <!-- Modal -->
|
|
|
|
|
+<div class="modal fade" id="createPaddock" tabindex="-1" role="dialog" aria-labelledby="createPaddock" aria-hidden="true">
|
|
|
|
|
+ <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <h5 class="modal-title" id="exampleModalLabel">Create Paddock Record</h5>
|
|
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+error_reporting(E_ALL);
|
|
|
|
|
+ini_set('display_errors', 1);
|
|
|
|
|
+
|
|
|
|
|
+if(isset($_POST['submit'])) {
|
|
|
|
|
+
|
|
|
|
|
+ $sql = null;
|
|
|
|
|
+ //$con = mysqli_connect("localhost", "root", "R3M0T31", "cropmonitor");
|
|
|
|
|
+ $con = mysqli_connect("localhost", "cropmonitor", "brvnCcaEYxlPCS3", "cropmonitor");
|
|
|
|
|
+
|
|
|
|
|
+ //set todays date
|
|
|
|
|
+ $date_added = date("Y-m-d H:i:s");
|
|
|
|
|
+
|
|
|
|
|
+ //Get figures
|
|
|
|
|
+ $modx_user_id = (isset($_POST["m_user"])) ? $_POST["m_user"] : "";
|
|
|
|
|
+
|
|
|
|
|
+ $client_name = (isset($_POST["name"])) ? $_POST["name"] : "";
|
|
|
|
|
+ $site_address = (isset($_POST["site_address"])) ? $_POST["site_address"] : "";
|
|
|
|
|
+
|
|
|
|
|
+ $site_id = (isset($_POST["site_id"])) ? $_POST["site_id"] : "";
|
|
|
|
|
+
|
|
|
|
|
+ $soil_type = (isset($_POST["analysis_type"])) ? $_POST["analysis_type"] : ""; //need to fix form to say soil_type not analysis_type
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /* ********* END ********* */
|
|
|
|
|
+
|
|
|
|
|
+ // Check connection
|
|
|
|
|
+ if (mysqli_connect_errno()) {
|
|
|
|
|
+ echo "Failed to connect to MySQL: " . mysqli_connect_error();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $sql = mysqli_query($con, "INSERT into `block_info`
|
|
|
|
|
+ (
|
|
|
|
|
+ modx_user_id,
|
|
|
|
|
+ date_added,
|
|
|
|
|
+ area,
|
|
|
|
|
+ block_id
|
|
|
|
|
+ ) VALUES (
|
|
|
|
|
+ '" . $modx_user_id . "',
|
|
|
|
|
+ '" . $date_added . "',
|
|
|
|
|
+ '" . $area . "',
|
|
|
|
|
+ '" . $block_id . "'
|
|
|
|
|
+ )" );
|
|
|
|
|
+
|
|
|
|
|
+ $insert_id = mysqli_insert_id($con);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if ($sql === TRUE)
|
|
|
|
|
+ {
|
|
|
|
|
+ //echo "success"; //CHECKING
|
|
|
|
|
+ // forward to results page if successfully inserts to database [[~32]]
|
|
|
|
|
+ echo "";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ die(mysqli_error($con)); // TODO: better error handling
|
|
|
|
|
+ //echo "User Profile incorrect";
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+?>
|
|
|
|
|
+
|
|
|
|
|
+ <form method="post" action="[~[*id*]~]" id="createPaddock" novalidate>
|
|
|
|
|
+
|
|
|
|
|
+ <input type="text" class="form-control" id="modx_user" value="[[+user]]" hidden>
|
|
|
|
|
+ <input type="text" class="form-control" id="mid" value="[[+id]]" hidden>
|
|
|
|
|
+
|
|
|
|
|
+ <h6>Block Identification</h6>
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block ID</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="id" aria-describedby="idHelp" placeholder="Block Id" required>
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ <div class="valid-feedback">Looks good!</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name" required>
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <h6>Location / Sizing</h6>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label for="exampleInputPassword1">Location</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="location" placeholder="Block Address">
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Area</label>
|
|
|
|
|
+ <input type="number" class="form-control form-control-sm" id="area_ha" aria-describedby="areaHelp" placeholder="Block Size" oninput="areaConverter(this.id,this.value)" onchange="areaConverter(this.value)">
|
|
|
|
|
+ <small id="areaHelp" class="form-text text-muted">in hectare's</small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Area</label>
|
|
|
|
|
+ <input type="number" class="form-control form-control-sm" id="area_ac" aria-describedby="areaHelp" placeholder="Block Size" oninput="areaConverter(this.id,this.value)" onchange="areaConverter(this.value)">
|
|
|
|
|
+ <small id="areaHelp" class="form-text text-muted">in acre's</small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name">
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <script>
|
|
|
|
|
+ function areaConverter(source,valNum) {
|
|
|
|
|
+ valNum = parseFloat(valNum);
|
|
|
|
|
+ var area_ha = document.getElementById("area_ha");
|
|
|
|
|
+ var area_ac = document.getElementById("area_ac");
|
|
|
|
|
+
|
|
|
|
|
+ if (source=="area_ha") {
|
|
|
|
|
+ area_ac.value=(valNum/0.404686).toFixed(2);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (source=="area_ac") {
|
|
|
|
|
+ area_ha.value=(valNum/2.4710559990832).toFixed(2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ </script>
|
|
|
|
|
+
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <h6>Soil Clasification</h6>
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Area</label>
|
|
|
|
|
+ <select class="form-control form-control-sm" name="analysis_type" id="analysis_type" required>
|
|
|
|
|
+ <option>Select the type of soil...</option>
|
|
|
|
|
+ <option id="sandy">sandy</option>
|
|
|
|
|
+ <option id="light">light</option>
|
|
|
|
|
+ <option id="medium">medium</option>
|
|
|
|
|
+ <option id="heavy">heavy</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name">
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-footer">
|
|
|
|
|
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
|
|
|
+ <button form="createPaddock" type="submit" class="btn btn-success">Save changes</button>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <br>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="d-none d-md-block "> <!-- d-lg-none -->
|
|
|
|
|
+ <div class='form-row'>
|
|
|
|
|
+ <div class='col-md-1'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='ID' ></div>
|
|
|
|
|
+ <div class='col-md-1'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Edit' ></div>
|
|
|
|
|
+ <div class='col'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Name' ></div>
|
|
|
|
|
+ <div class='col-md-1'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Size' ></div>
|
|
|
|
|
+ <div class='col-md-2'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Location' ></div>
|
|
|
|
|
+ <div class='col-md-2'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Current Crop' ></div>
|
|
|
|
|
+ <div class='col-md-1'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Status' ></div>
|
|
|
|
|
+ <div class='col-md-1'><input type='text' readonly class='text-center form-control-plaintext font-weight-bold' placeholder='Actions' ></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ /*[[!blockIdentification? &cid=`[[+id]]` ]]*/
|
|
|
|
|
+ <?php
|
|
|
|
|
+if ($cid) {
|
|
|
|
|
+ $client_id = $cid; // client number
|
|
|
|
|
+} else {
|
|
|
|
|
+ $client_id = '2'; // client number
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+$client_id = '2'; // client number
|
|
|
|
|
+
|
|
|
|
|
+$analysisType = $analysis;
|
|
|
|
|
+$icon = $icon;
|
|
|
|
|
+
|
|
|
|
|
+/*
|
|
|
|
|
+Status Table
|
|
|
|
|
+0 = Blank
|
|
|
|
|
+1 = Read
|
|
|
|
|
+2 = Archived
|
|
|
|
|
+3 = Deleted
|
|
|
|
|
+*/
|
|
|
|
|
+
|
|
|
|
|
+//Database connection
|
|
|
|
|
+//$con = mysqli_connect("localhost", "root", "R3M0T31", "cropmonitor");
|
|
|
|
|
+$con = mysqli_connect("localhost", "cropmonitor", "brvnCcaEYxlPCS3", "cropmonitor");
|
|
|
|
|
+
|
|
|
|
|
+// Check connection
|
|
|
|
|
+if (mysqli_connect_errno()) {
|
|
|
|
|
+ echo "Failed to connect to MySQL: " . mysqli_connect_error();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// Get results from database
|
|
|
|
|
+$result = mysqli_query($con, "SELECT * FROM `block_info` WHERE `modx_user_id` = ". $client_id ." AND `status` <= 1 "); //
|
|
|
|
|
+ //
|
|
|
|
|
+//plant_records.crop_type, plant_specifications.plant_type, plant_specifications.N_Min, plant_specifications.N_Max, plant_records.N, plant_records.id
|
|
|
|
|
+// mysqli_query returns false if something went wrong with the query
|
|
|
|
|
+
|
|
|
|
|
+if ($result === FALSE) {
|
|
|
|
|
+ die(mysqli_error($con)); // TODO: better error handling
|
|
|
|
|
+ echo "User Profile incorrect";
|
|
|
|
|
+
|
|
|
|
|
+} else {
|
|
|
|
|
+ $i = 1;
|
|
|
|
|
+ while ($row = mysqli_fetch_array($result)) {
|
|
|
|
|
+
|
|
|
|
|
+ $rowid = $row['id'];
|
|
|
|
|
+ $name = $row['name'];
|
|
|
|
|
+ $block = $row['block_id'];
|
|
|
|
|
+ $location = $row['location'];
|
|
|
|
|
+ $area = $row['area'];
|
|
|
|
|
+ $area_ha = number_format($area,1);
|
|
|
|
|
+ $area_ac = number_format(($area * 2.47105),1);
|
|
|
|
|
+ $area_value = $area_ha . "ha - " . $area_ac . "acres";
|
|
|
|
|
+ $gps = $row['gps'];
|
|
|
|
|
+ $status = $row['status'];
|
|
|
|
|
+
|
|
|
|
|
+ $currentCrop = '';
|
|
|
|
|
+
|
|
|
|
|
+ /* Status Table */
|
|
|
|
|
+ if ($row['status'] == 0 ) { // 0 = Blank
|
|
|
|
|
+ $colour = 'table-secondary';
|
|
|
|
|
+ } else if ($row['status'] == 1 ) { //1 = Read
|
|
|
|
|
+ $colour = '';
|
|
|
|
|
+ } else if ($row['status'] == 2 ) { //2 = Archived
|
|
|
|
|
+ $colour = '';
|
|
|
|
|
+ } else if ($row['status'] == 3 ) { //3 = Deleted
|
|
|
|
|
+ $colour = '';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $colour = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //$today = date('dS l M y');
|
|
|
|
|
+ //$filename = $row['rand'] . " - Soil-Analysis - " . $today;
|
|
|
|
|
+
|
|
|
|
|
+ echo "<div class='row mb-2'>";
|
|
|
|
|
+ echo "<div class='col border border-success rounded p-1'>";
|
|
|
|
|
+ echo "<div class='form-row m-1'>";
|
|
|
|
|
+ echo "<div class='text-left font-weight-bold' ><p>$i</p></div>"; //<label for=''>ID</label> d-none d-md-block d-lg-none
|
|
|
|
|
+ echo "<div class='col-6 col-sm-11 col-md-2'>";
|
|
|
|
|
+ echo "<div class='row'>";
|
|
|
|
|
+ echo "<div class='col-6 col-md-6'><a class='text-left font-weight-bold btn btn-primary btn-sm btn-block' href='[[~93]]?rid=$rowid&id=$block&block=$name'><i class='fas fa-globe-asia fa-1x text-white' aria-hidden='true'></i></a></div>";
|
|
|
|
|
+ echo "<div class='col-6 col-md-6'><button type='submit' class='text-left font-weight-bold btn btn-success btn-sm btn-block ' data-toggle='modal' data-target='#editPaddock$rowid'><i class='far fa-edit'></i> " . $block . "</button></div>";
|
|
|
|
|
+ echo "</div>"; //<label for=''>Block</label>
|
|
|
|
|
+ echo "</div>";
|
|
|
|
|
+ echo "<div class='col'><label class='form-label form-label-sm m-0 d-block d-sm-none' for=''>Name</label><input type='text' class='form-control form-control-sm' value='$name'></div>"; //<label for=''>Name</label>
|
|
|
|
|
+ echo "<div class='col-md-1'><label class='form-label form-label-sm m-0 d-block d-sm-none' for=''>Size</label><input type='text' class='form-control form-control-sm text-center' value='$area_value'></div>"; //<label for=''>Size</label>
|
|
|
|
|
+ echo "<div class='col-md-2'><label class='form-label form-label-sm m-0 d-block d-sm-none' for=''>Location</label><input type='text' class='form-control form-control-sm' value='$location'></div>"; //<label for=''>Location</label>
|
|
|
|
|
+ echo "<div class='col-md-2'><label class='form-label form-label-sm m-0 d-block d-sm-none' for=''>Current Crop</label><input type='text' class='form-control form-control-sm' value='$currentCrop'></div>"; //<label for=''>Location</label>
|
|
|
|
|
+ echo "<div class='col-md-1'><label class='form-label form-label-sm m-0 d-block d-sm-none' for=''>Location</label><input type='text' readonly class='form-control form-control-plaintext form-control-sm' value='$status'></div>"; //<label for=''>Location</label>
|
|
|
|
|
+ echo "<div class='col-md-1'><label class='form-label form-label-sm m-0 d-block d-sm-none' for=''>Actions</label>";
|
|
|
|
|
+ echo "<a href='#' target='_blank' data-toggle='tooltip' data-placement='top' title='Delete Block'><i class='fa fa-trash text-danger' aria-hidden='true'></i> ";
|
|
|
|
|
+ echo "<a href='#' target='_blank' data-toggle='tooltip' data-placement='top' title='Archive Block'><i class='fa fa-archive text-warning' aria-hidden='true'></i> ";
|
|
|
|
|
+ echo "<a href='#' target='_blank' data-toggle='tooltip' data-placement='top' title='Reply to Client'><i class='text-success fa fa-reply' aria-hidden='true'></i> ";
|
|
|
|
|
+ echo "<a href='#' target='_blank' data-toggle='tooltip' data-placement='top' title='Share Report'><i class='text-success fa fa-share' aria-hidden='true'></i></a> ";
|
|
|
|
|
+ echo "<a href='#' target='_blank' data-toggle='tooltip' data-placement='top' title='Download Report'><i class='text-dark fas fa-cloud-download-alt'></i></a>";
|
|
|
|
|
+ echo "</div>";
|
|
|
|
|
+ echo "</div>";
|
|
|
|
|
+ echo "</div>";
|
|
|
|
|
+ echo "</div>";
|
|
|
|
|
+
|
|
|
|
|
+ ?>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- ********************************************************* Modal ********************************************************* -->
|
|
|
|
|
+ <div class="modal fade" id="editPaddock<?php echo $rowid; ?>" tabindex="-1" role="dialog" aria-labelledby="editPaddock<?php echo $rowid; ?>" aria-hidden="true">
|
|
|
|
|
+ <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <h5 class="modal-title" id="exampleModalLabel">Edit Paddock Record</h5>
|
|
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+
|
|
|
|
|
+ [[!createBlockSubmit]]
|
|
|
|
|
+
|
|
|
|
|
+ <form method="post" action="[~[*id*]~]" id="editPaddock<?php echo $rowid; ?>" novalidate>
|
|
|
|
|
+
|
|
|
|
|
+ <input type="text" class="form-control" id="modx_user" value="<?php echo $rowid; ?>" hidden>
|
|
|
|
|
+ <input type="text" class="form-control" id="mid" value="[[+id]]" hidden>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block ID</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="block_id" aria-describedby="block_idHelp" value="<?php echo $block; ?>" required>
|
|
|
|
|
+ <small id="block_idHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ <div class="valid-feedback">Looks good!</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="nameHelp" value="<?php echo $name; ?>" required>
|
|
|
|
|
+ <small id="nameHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <h6>Location / Sizing</h6>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label for="exampleInputPassword1">Location</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="location" value="<?php echo $location; ?>" >
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Area</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="area_ha" aria-describedby="areahaHelp" value="<?php echo $area_ha; ?>" oninput="areaConverter(this.id,this.value)" onchange="areaConverter(this.value)">
|
|
|
|
|
+ <small id="areahaHelp" class="form-text text-muted">in hectare's</small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Area</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="area_ac" aria-describedby="areaacHelp" value="<?php echo $area_ac; ?>" oninput="areaConverter(this.id,this.value)" onchange="areaConverter(this.value)">
|
|
|
|
|
+ <small id="areaaHelp" class="form-text text-muted">in acre's</small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">GPS</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="gps" aria-describedby="gpsHelp" value="<?php echo $gps; ?>" >
|
|
|
|
|
+ <small id="gpsHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <script>
|
|
|
|
|
+ function areaConverter(source,valNum) {
|
|
|
|
|
+ valNum = parseFloat(valNum);
|
|
|
|
|
+ var area_ha = document.getElementById("area_ha");
|
|
|
|
|
+ var area_ac = document.getElementById("area_ac");
|
|
|
|
|
+
|
|
|
|
|
+ if (source=="area_ha") {
|
|
|
|
|
+ area_ac.value=(valNum/0.404686).toFixed(2);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (source=="area_ac") {
|
|
|
|
|
+ area_ha.value=(valNum/2.4710559990832).toFixed(2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ </script>
|
|
|
|
|
+
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <h6>Soil Clasification</h6>
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Area</label>
|
|
|
|
|
+ <select class="form-control form-control-sm" name="analysis_type" id="analysis_type" required>
|
|
|
|
|
+ <option>Select the type of soil...</option>
|
|
|
|
|
+ <option id="sandy">sandy</option>
|
|
|
|
|
+ <option id="light">light</option>
|
|
|
|
|
+ <option id="medium">medium</option>
|
|
|
|
|
+ <option id="heavy">heavy</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name">
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <hr>
|
|
|
|
|
+ <h6>Current Crop Details</h6>
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name">
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name">
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <label for="exampleInputEmail1">Block Name</label>
|
|
|
|
|
+ <input type="text" class="form-control form-control-sm" id="name" aria-describedby="idHelp" placeholder="Block Name">
|
|
|
|
|
+ <small id="emailHelp" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-footer">
|
|
|
|
|
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
|
|
|
+ <button form="editPaddock<?php echo $rowid; ?>" type="submit" class="btn btn-success">Save changes</button>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+<?php
|
|
|
|
|
+ $i++;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+mysqli_close($con);
|
|
|
|
|
+?>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+<div class="container-fluid">
|
|
|
|
|
+ <div class="row clearfix ">
|
|
|
|
|
+ <div class="col border border-success rounded shadow">
|
|
|
|
|
+ <form>
|
|
|
|
|
+ <div class="form-row">
|
|
|
|
|
+ <div class="form-group col-3">
|
|
|
|
|
+ <label for="farm_name">Farm Name</label>
|
|
|
|
|
+ <input type="text" class="form-control" for="farm_name" placeholder="" readonly></input>
|
|
|
|
|
+ <small id="farm_name" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group col-3">
|
|
|
|
|
+ <label for="paddock_name">Paddock Name</label>
|
|
|
|
|
+ <input type="text" class="form-control" for="paddock_name" placeholder="" readonly></input>
|
|
|
|
|
+ <small id="paddock_name" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group col-3">
|
|
|
|
|
+ <label for="crop_name">Crop Name</label>
|
|
|
|
|
+ <input type="text" class="form-control" for="crop_name" placeholder="" readonly></input>
|
|
|
|
|
+ <small id="crop_name" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group col-3">
|
|
|
|
|
+ <label for="paddock_area">Area</label>
|
|
|
|
|
+ <input type="text" class="form-control" for="paddock_area" placeholder="" readonly></input>
|
|
|
|
|
+ <small id="paddock_area" class="form-text text-muted"></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row clearfix">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <br>
|
|
|
|
|
+ <h3>Crop Information</h3>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row clearfix">
|
|
|
|
|
+ <div class="col-4 ">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-header">
|
|
|
|
|
+ <h4>Current Alerts</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body">
|
|
|
|
|
+ <div class="table-responsive table-editable">
|
|
|
|
|
+ <span class="table-add float-right mb-3 mr-2"><a href="#!" class="text-success"><i class="fas fa-plus fa-2x" aria-hidden="true"></i></a></span>
|
|
|
|
|
+ <table class="table table-striped table-hover">
|
|
|
|
|
+ <thead class="table-danger">
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="col">#</th>
|
|
|
|
|
+ <th scope="col">First</th>
|
|
|
|
|
+ <th scope="col">Last</th>
|
|
|
|
|
+ <th scope="col">Handle</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">1</th>
|
|
|
|
|
+ <td>Mark</td>
|
|
|
|
|
+ <td>Otto</td>
|
|
|
|
|
+ <td>@mdo</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">2</th>
|
|
|
|
|
+ <td>Jacob</td>
|
|
|
|
|
+ <td>Thornton</td>
|
|
|
|
|
+ <td>@fat</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">3</th>
|
|
|
|
|
+ <td>Larry</td>
|
|
|
|
|
+ <td>the Bird</td>
|
|
|
|
|
+ <td>@twitter</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="col-4 ">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-header">
|
|
|
|
|
+ <h4>Fertiliser and Disease Control</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body">
|
|
|
|
|
+ <div class="table-responsive table-editable">
|
|
|
|
|
+ <span class="table-add float-right mb-3 mr-2"><a href="#!" class="text-success"><i class="fas fa-plus fa-2x" aria-hidden="true"></i></a></span>
|
|
|
|
|
+ <table class="table table-striped table-hover">
|
|
|
|
|
+ <thead class="table-success">
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="col">#</th>
|
|
|
|
|
+ <th scope="col">First</th>
|
|
|
|
|
+ <th scope="col">Last</th>
|
|
|
|
|
+ <th scope="col">Handle</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">1</th>
|
|
|
|
|
+ <td>Mark</td>
|
|
|
|
|
+ <td>Otto</td>
|
|
|
|
|
+ <td>@mdo</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">2</th>
|
|
|
|
|
+ <td>Jacob</td>
|
|
|
|
|
+ <td>Thornton</td>
|
|
|
|
|
+ <td>@fat</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">3</th>
|
|
|
|
|
+ <td>Larry</td>
|
|
|
|
|
+ <td>the Bird</td>
|
|
|
|
|
+ <td>@twitter</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="col-4 ">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-header">
|
|
|
|
|
+ <h4>Irrigation and Weather</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body">
|
|
|
|
|
+ <div class="table-responsive table-editable">
|
|
|
|
|
+ <span class="table-add float-right mb-3 mr-2"><a href="#!" class="text-success"><i class="fas fa-plus fa-2x" aria-hidden="true"></i></a></span>
|
|
|
|
|
+ <table class="table table-striped table-hover">
|
|
|
|
|
+ <thead class="table-warning">
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="col">#</th>
|
|
|
|
|
+ <th scope="col">First</th>
|
|
|
|
|
+ <th scope="col">Last</th>
|
|
|
|
|
+ <th scope="col">Handle</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">1</th>
|
|
|
|
|
+ <td>Mark</td>
|
|
|
|
|
+ <td>Otto</td>
|
|
|
|
|
+ <td>@mdo</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">2</th>
|
|
|
|
|
+ <td>Jacob</td>
|
|
|
|
|
+ <td>Thornton</td>
|
|
|
|
|
+ <td>@fat</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th scope="row">3</th>
|
|
|
|
|
+ <td>Larry</td>
|
|
|
|
|
+ <td>the Bird</td>
|
|
|
|
|
+ <td>@twitter</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+</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">[[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>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </footer>
|
|
|
|
|
+
|
|
|
|
|
+ </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>
|
|
|
|
|
+ <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>
|