-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 27, 2026 at 07:37 AM
-- Server version: 8.0.45-0ubuntu0.24.04.1
-- PHP Version: 8.4.18

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `cropmonitor`
--

-- --------------------------------------------------------

--
-- Table structure for table `animal_records`
--

CREATE TABLE `animal_records` (
  `id` int NOT NULL,
  `client_records_id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `date` date NOT NULL,
  `email` varchar(30) DEFAULT NULL,
  `client_name` varchar(30) DEFAULT NULL,
  `site_address` varchar(30) DEFAULT NULL,
  `state_postcode` varchar(30) DEFAULT NULL,
  `analysis_type` varchar(30) DEFAULT NULL,
  `lab_no` varchar(30) DEFAULT NULL,
  `date_sampled` date DEFAULT NULL,
  `sample_id` varchar(30) DEFAULT NULL,
  `crop_type` varchar(30) DEFAULT NULL,
  `animal` varchar(30) DEFAULT NULL,
  `live_weight` varchar(5) DEFAULT NULL,
  `dm_intake` varchar(15) DEFAULT NULL,
  `lactation` varchar(30) DEFAULT NULL,
  `n` varchar(15) DEFAULT NULL,
  `p` varchar(15) DEFAULT NULL,
  `k` varchar(15) DEFAULT NULL,
  `s` varchar(15) DEFAULT NULL,
  `mg` varchar(15) DEFAULT NULL,
  `ca` varchar(15) DEFAULT NULL,
  `na` varchar(15) DEFAULT NULL,
  `fe` varchar(15) DEFAULT NULL,
  `mn` varchar(15) DEFAULT NULL,
  `zn` varchar(15) DEFAULT NULL,
  `cu` varchar(15) DEFAULT NULL,
  `b` varchar(15) DEFAULT NULL,
  `mo` varchar(15) DEFAULT NULL,
  `co` varchar(15) DEFAULT NULL,
  `se` varchar(15) DEFAULT NULL,
  `cl` varchar(15) DEFAULT NULL,
  `ch` varchar(15) DEFAULT NULL,
  `k_meq` varchar(15) DEFAULT NULL,
  `s_meq` varchar(15) DEFAULT NULL,
  `ca_meq` varchar(15) DEFAULT NULL,
  `mg_meq` varchar(15) DEFAULT NULL,
  `na_meq` varchar(15) DEFAULT NULL,
  `cl_meq` varchar(15) DEFAULT NULL,
  `rand` varchar(100) NOT NULL,
  `status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `animal_specifications`
--

CREATE TABLE `animal_specifications` (
  `id` int NOT NULL,
  `modx_user_id` int DEFAULT '1',
  `animal` varchar(20) DEFAULT NULL,
  `lactation` varchar(15) DEFAULT NULL,
  `live_weight` varchar(5) DEFAULT NULL,
  `dm_intake` varchar(15) DEFAULT NULL,
  `n` varchar(10) DEFAULT NULL,
  `p` varchar(10) DEFAULT NULL,
  `k` varchar(10) DEFAULT NULL,
  `s` varchar(10) DEFAULT NULL,
  `ca` varchar(10) DEFAULT NULL,
  `mg` varchar(10) DEFAULT NULL,
  `na` varchar(10) DEFAULT NULL,
  `fe` varchar(10) DEFAULT NULL,
  `mn` varchar(10) DEFAULT NULL,
  `zn` varchar(10) DEFAULT NULL,
  `cu` varchar(10) DEFAULT NULL,
  `b` varchar(10) DEFAULT NULL,
  `mo` varchar(10) DEFAULT NULL,
  `co` varchar(10) DEFAULT NULL,
  `se` varchar(10) DEFAULT NULL,
  `i` varchar(10) DEFAULT NULL,
  `cl` varchar(10) DEFAULT NULL,
  `ch` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `block_info`
--

CREATE TABLE `block_info` (
  `id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `name` text,
  `block_id` text,
  `location` text,
  `area` int DEFAULT NULL,
  `gps` int DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `date_added` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `calendar_events`
--

CREATE TABLE `calendar_events` (
  `id` int NOT NULL,
  `modx_user_id` text,
  `start` datetime DEFAULT NULL,
  `end` datetime DEFAULT NULL,
  `title` text,
  `site_id` text,
  `type` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Stand-in structure for view `calendar_view`
-- (See below for the actual view)
--
CREATE TABLE `calendar_view` (
`Aanalysis_type` varchar(30)
,`Aend` date
,`Aid` int
,`Asam_id` varchar(30)
,`Asite_id` varchar(30)
,`Astart` date
,`Auid` int
,`Cend` date
,`Cid` int
,`Cstart` datetime
,`Cuid` text
,`Panalysis_type` varchar(30)
,`Pend` date
,`Pid` int
,`Psam_id` varchar(30)
,`Psite_id` varchar(30)
,`Pstart` date
,`Puid` int
,`Sanalysis_type` varchar(100)
,`Send` date
,`Sid` int
,`Ssam_id` varchar(100)
,`Ssite_id` varchar(100)
,`Sstart` datetime
,`Suid` varchar(10)
,`title` text
,`type` text
,`Wanalysis_type` varchar(30)
,`Wend` date
,`Wid` int
,`Wsam_id` varchar(30)
,`Wsite_id` varchar(30)
,`Wstart` date
,`Wuid` int
);

-- --------------------------------------------------------

--
-- Table structure for table `client_records`
--

CREATE TABLE `client_records` (
  `id` int NOT NULL,
  `modx_user_id` int DEFAULT NULL,
  `modx_user_attributes` int DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `client` varchar(100) DEFAULT NULL,
  `address` varchar(100) DEFAULT NULL,
  `state_postcode` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(100) DEFAULT NULL,
  `mobile` varchar(100) DEFAULT NULL,
  `fax` varchar(100) DEFAULT NULL,
  `wustationid` varchar(100) DEFAULT NULL,
  `wuapikey` varchar(100) DEFAULT NULL,
  `dkstationid` varchar(100) DEFAULT NULL,
  `dkapikey` varchar(100) DEFAULT NULL,
  `owstationid` varchar(100) DEFAULT NULL,
  `owapikey` varchar(100) DEFAULT NULL,
  `aerisstationid` varchar(100) DEFAULT NULL,
  `aerisapi` varchar(100) DEFAULT NULL,
  `apiselect` varchar(20) DEFAULT 'wunderground'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `crop_info`
--

CREATE TABLE `crop_info` (
  `id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `paddock_id` text,
  `name` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `editor`
--

CREATE TABLE `editor` (
  `id` int NOT NULL,
  `content` text COLLATE utf8mb3_unicode_ci NOT NULL,
  `created` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `fertiliser_specifications`
--

CREATE TABLE `fertiliser_specifications` (
  `id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `name` text,
  `chemical` text,
  `n` varchar(10) DEFAULT NULL,
  `p` varchar(10) DEFAULT NULL,
  `k` varchar(10) DEFAULT NULL,
  `Na` varchar(10) DEFAULT NULL,
  `Ca` varchar(10) DEFAULT NULL,
  `Mg` varchar(10) DEFAULT NULL,
  `B` varchar(10) DEFAULT NULL,
  `Zn` varchar(10) DEFAULT NULL,
  `Cu` varchar(10) DEFAULT NULL,
  `Mn` varchar(10) DEFAULT NULL,
  `Fe` varchar(10) DEFAULT NULL,
  `Co` varchar(10) DEFAULT NULL,
  `Mo` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `field_sensors`
--

CREATE TABLE `field_sensors` (
  `id` int NOT NULL,
  `modx_user_id` varchar(10) NOT NULL,
  `sensor_id` varchar(50) DEFAULT NULL,
  `DATEUTC` datetime DEFAULT NULL,
  `sensor_name` text,
  `value` decimal(10,3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `newtile`
--

CREATE TABLE `newtile` (
  `id` int NOT NULL,
  `datetime` datetime NOT NULL,
  `input1` varchar(10) DEFAULT NULL,
  `input2` varchar(10) DEFAULT NULL,
  `input3` varchar(10) DEFAULT NULL,
  `input4` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `plant_images`
--

CREATE TABLE `plant_images` (
  `id` int NOT NULL,
  `plant_type` varchar(50) DEFAULT NULL,
  `name` blob NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `plant_records`
--

CREATE TABLE `plant_records` (
  `id` int NOT NULL,
  `client_records_id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `date` date NOT NULL,
  `email` varchar(30) DEFAULT NULL,
  `client_name` varchar(30) DEFAULT NULL,
  `site_address` varchar(30) DEFAULT NULL,
  `state_postcode` varchar(30) DEFAULT NULL,
  `analysis_type` varchar(30) DEFAULT NULL,
  `lab_no` varchar(30) DEFAULT NULL,
  `batch_no` varchar(30) DEFAULT NULL,
  `date_sampled` date DEFAULT NULL,
  `sample_id` varchar(30) DEFAULT NULL,
  `site_id` varchar(30) DEFAULT NULL,
  `crop_type` varchar(30) DEFAULT NULL,
  `n` varchar(15) DEFAULT NULL,
  `p` varchar(15) DEFAULT NULL,
  `k` varchar(15) DEFAULT NULL,
  `s` varchar(15) DEFAULT NULL,
  `mg` varchar(15) DEFAULT NULL,
  `ca` varchar(15) DEFAULT NULL,
  `na` varchar(15) DEFAULT NULL,
  `fe` varchar(15) DEFAULT NULL,
  `mn` varchar(15) DEFAULT NULL,
  `zn` varchar(15) DEFAULT NULL,
  `cu` varchar(15) DEFAULT NULL,
  `b` varchar(15) DEFAULT NULL,
  `m` varchar(15) DEFAULT NULL,
  `co` varchar(15) DEFAULT NULL,
  `se` varchar(15) DEFAULT NULL,
  `cl` varchar(15) DEFAULT NULL,
  `c` varchar(15) DEFAULT NULL,
  `rand` varchar(100) NOT NULL,
  `status` varchar(10) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `plant_specifications`
--

CREATE TABLE `plant_specifications` (
  `id` int NOT NULL,
  `modx_user_id` varchar(10) NOT NULL DEFAULT '1',
  `plant_type` text,
  `plant_stage` text,
  `n_min` varchar(10) DEFAULT NULL,
  `n_avg` varchar(10) DEFAULT NULL,
  `n_max` varchar(10) DEFAULT NULL,
  `P_Min` varchar(10) DEFAULT NULL,
  `P_Avg` varchar(10) DEFAULT NULL,
  `P_Max` varchar(10) DEFAULT NULL,
  `K_Min` varchar(10) DEFAULT NULL,
  `K_Avg` varchar(10) DEFAULT NULL,
  `K_Max` varchar(10) DEFAULT NULL,
  `S_Min` varchar(10) DEFAULT NULL,
  `S_Avg` varchar(10) DEFAULT NULL,
  `S_Max` varchar(10) DEFAULT NULL,
  `Ca_Min` varchar(10) DEFAULT NULL,
  `Ca_Avg` varchar(10) DEFAULT NULL,
  `Ca_Max` varchar(10) DEFAULT NULL,
  `Mg_Min` varchar(10) DEFAULT NULL,
  `Mg_Avg` varchar(10) DEFAULT NULL,
  `Mg_Max` varchar(10) DEFAULT NULL,
  `Na_Min` varchar(10) DEFAULT NULL,
  `Na_Avg` varchar(10) DEFAULT NULL,
  `Na_Max` varchar(10) DEFAULT NULL,
  `Cu_Min` varchar(10) DEFAULT NULL,
  `Cu_Avg` varchar(10) DEFAULT NULL,
  `Cu_Max` varchar(10) DEFAULT NULL,
  `Zn_Min` varchar(10) DEFAULT NULL,
  `Zn_Avg` varchar(10) DEFAULT NULL,
  `Zn_Max` varchar(10) DEFAULT NULL,
  `Mn_Min` varchar(10) DEFAULT NULL,
  `Mn_Avg` varchar(10) DEFAULT NULL,
  `Mn_Max` varchar(10) DEFAULT NULL,
  `B_Min` varchar(10) DEFAULT NULL,
  `B_Avg` varchar(10) DEFAULT NULL,
  `B_Max` varchar(10) DEFAULT NULL,
  `Fe_Min` varchar(10) DEFAULT NULL,
  `Fe_Avg` varchar(10) DEFAULT NULL,
  `Fe_Max` varchar(10) DEFAULT NULL,
  `M_Min` varchar(10) DEFAULT NULL,
  `M_Avg` varchar(10) DEFAULT NULL,
  `M_Max` varchar(10) DEFAULT NULL,
  `Co_min` varchar(10) NOT NULL,
  `Co_Avg` varchar(10) NOT NULL,
  `Co_max` varchar(10) NOT NULL,
  `se_min` varchar(10) NOT NULL,
  `se_avg` varchar(10) NOT NULL,
  `se_max` varchar(10) NOT NULL,
  `cl_min` varchar(10) NOT NULL,
  `cl_avg` varchar(10) NOT NULL,
  `cl_max` varchar(10) NOT NULL,
  `c_min` varchar(10) NOT NULL,
  `c_avg` varchar(10) NOT NULL,
  `c_max` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `power`
--

CREATE TABLE `power` (
  `DID` int NOT NULL,
  `action` varchar(20) DEFAULT NULL,
  `ID` varchar(20) DEFAULT NULL,
  `PASSWORD` varchar(20) DEFAULT NULL,
  `dateutc` varchar(20) DEFAULT NULL,
  `power0` varchar(20) DEFAULT NULL,
  `power1` varchar(20) DEFAULT NULL,
  `power2` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `reports`
--

CREATE TABLE `reports` (
  `id` int NOT NULL,
  `modx_user_id` int DEFAULT NULL,
  `record_id` int DEFAULT NULL,
  `rand` int DEFAULT NULL,
  `comment` text,
  `dateTime` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Stand-in structure for view `reports_view`
-- (See below for the actual view)
--
CREATE TABLE `reports_view` (
`analysis_type` varchar(100)
,`batch_no` varchar(50)
,`client_name` varchar(100)
,`crop_type` varchar(50)
,`date` datetime
,`date_sampled` date
,`id` int
,`lab_no` varchar(50)
,`modx_user_id` varchar(11)
,`rand` varchar(100)
,`sample_id` varchar(100)
,`site_id` varchar(100)
,`status` varchar(10)
);

-- --------------------------------------------------------

--
-- Table structure for table `sensor_id`
--

CREATE TABLE `sensor_id` (
  `id` int NOT NULL,
  `modx_user_id` int DEFAULT NULL,
  `sensor` varchar(50) DEFAULT NULL,
  `sensor_id` varchar(5) DEFAULT NULL,
  `mac` varchar(70) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `soil_comments`
--

CREATE TABLE `soil_comments` (
  `id` int NOT NULL,
  `client_records_id` int DEFAULT NULL,
  `modx_user_id` int DEFAULT NULL,
  `type` varchar(15) NOT NULL,
  `element` varchar(15) NOT NULL,
  `variable` varchar(15) NOT NULL,
  `comment` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `soil_records`
--

CREATE TABLE `soil_records` (
  `id` int NOT NULL,
  `client_records_id` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `modx_user_id` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `client_name` varchar(100) DEFAULT NULL,
  `site_address` varchar(100) DEFAULT NULL,
  `state_postcode` varchar(100) DEFAULT NULL,
  `analysis_type` varchar(100) DEFAULT NULL,
  `lab_no` varchar(50) DEFAULT NULL,
  `batch_no` varchar(50) DEFAULT NULL,
  `sample_id` varchar(100) DEFAULT NULL,
  `site_id` varchar(100) DEFAULT NULL,
  `crop_type` varchar(50) DEFAULT NULL,
  `soil_type` varchar(10) DEFAULT NULL,
  `date_sampled` date DEFAULT NULL,
  `tec` varchar(50) DEFAULT NULL,
  `cec` varchar(50) DEFAULT NULL,
  `texture` varchar(10) DEFAULT NULL,
  `gravel` varchar(10) DEFAULT NULL,
  `colour` varchar(10) DEFAULT NULL,
  `NO3_N` varchar(10) DEFAULT NULL,
  `NH3_N` varchar(10) DEFAULT NULL,
  `p_mehlick` varchar(10) DEFAULT NULL,
  `p_bray2` varchar(10) DEFAULT NULL,
  `p_morgan` varchar(10) DEFAULT NULL,
  `p_colwell` varchar(10) DEFAULT NULL,
  `k_morgan` varchar(10) DEFAULT NULL,
  `ca_morgan` varchar(10) DEFAULT NULL,
  `mg_morgan` varchar(10) DEFAULT NULL,
  `na_morgan` varchar(10) DEFAULT NULL,
  `ch_h2o` varchar(10) DEFAULT NULL,
  `ocarbon` varchar(10) DEFAULT NULL,
  `omatter` varchar(10) DEFAULT NULL,
  `fe` varchar(10) DEFAULT NULL,
  `ec` varchar(10) DEFAULT NULL,
  `ph_cacl2` varchar(10) DEFAULT NULL,
  `ph_h2o` varchar(10) DEFAULT NULL,
  `paramag` varchar(10) DEFAULT NULL,
  `s_morgan` varchar(10) DEFAULT NULL,
  `b_cacl2` varchar(10) DEFAULT NULL,
  `mn_dtpa` varchar(10) DEFAULT NULL,
  `zn_dtpa` varchar(10) DEFAULT NULL,
  `fe_dtpa` varchar(10) DEFAULT NULL,
  `cu_dtpa` varchar(10) DEFAULT NULL,
  `al` varchar(10) DEFAULT NULL,
  `sl_cacl2` varchar(10) DEFAULT NULL,
  `m_dtpa` varchar(10) DEFAULT NULL,
  `co_dtpa` varchar(10) DEFAULT NULL,
  `se` varchar(10) DEFAULT NULL,
  `ca_mehlick3` varchar(10) DEFAULT NULL,
  `BS_ca2` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `BS_ca_ppm` varchar(10) DEFAULT NULL,
  `mg_mehlick3` varchar(10) DEFAULT NULL,
  `BS_mg2` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `BS_mg_ppm` varchar(10) DEFAULT NULL,
  `k_mehlick3` varchar(10) DEFAULT NULL,
  `BS_k` varchar(10) DEFAULT NULL,
  `BS_k_ppm` varchar(10) DEFAULT NULL,
  `na_mehlick3` varchar(10) DEFAULT NULL,
  `BS_na` varchar(10) DEFAULT NULL,
  `BS_na_ppm` varchar(10) DEFAULT NULL,
  `al_mehlick3` varchar(10) DEFAULT NULL,
  `BS_al3` varchar(10) DEFAULT NULL,
  `BS_al_ppm` varchar(10) DEFAULT NULL,
  `BS_ob` varchar(10) DEFAULT NULL,
  `BS_h` varchar(10) DEFAULT NULL,
  `cabs_min` varchar(10) DEFAULT NULL,
  `ca_ppm_min` varchar(10) DEFAULT NULL,
  `cabs_max` varchar(10) DEFAULT NULL,
  `ca_ppm_max` varchar(10) DEFAULT NULL,
  `mgbs_min` varchar(10) DEFAULT NULL,
  `mg_ppm_min` varchar(10) DEFAULT NULL,
  `mgbs_max` varchar(10) DEFAULT NULL,
  `mg_ppm_max` varchar(10) DEFAULT NULL,
  `kbs_min` varchar(10) DEFAULT NULL,
  `k_ppm_min` varchar(10) DEFAULT NULL,
  `kbs_max` varchar(10) DEFAULT NULL,
  `k_ppm_max` varchar(10) DEFAULT NULL,
  `nabs_min` varchar(10) DEFAULT NULL,
  `na_ppm_min` varchar(10) DEFAULT NULL,
  `nabs_max` varchar(10) DEFAULT NULL,
  `na_ppm_max` varchar(10) DEFAULT NULL,
  `albs_min` varchar(10) DEFAULT NULL,
  `al_ppm_min` varchar(10) DEFAULT NULL,
  `albs_max` varchar(10) DEFAULT NULL,
  `al_ppm_max` varchar(10) DEFAULT NULL,
  `ob_rec` varchar(10) DEFAULT NULL,
  `h_rec` varchar(10) DEFAULT NULL,
  `ca_mg_ratio` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `c_n_ratio` varchar(10) DEFAULT NULL,
  `program_years` varchar(5) DEFAULT NULL,
  `overview` text,
  `folia_program` text,
  `microbe__program` text,
  `rand` varchar(10) DEFAULT NULL,
  `status` varchar(10) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `soil_specifications`
--

CREATE TABLE `soil_specifications` (
  `id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `soil_type` varchar(10) DEFAULT NULL,
  `crop` varchar(10) DEFAULT NULL,
  `tec` varchar(10) DEFAULT NULL,
  `cec` varchar(10) DEFAULT NULL,
  `texture` varchar(10) DEFAULT NULL,
  `gravel` varchar(10) DEFAULT NULL,
  `colour` varchar(10) DEFAULT NULL,
  `NO3_N` varchar(10) DEFAULT NULL,
  `NH3_N` varchar(10) DEFAULT NULL,
  `p_mehlick` varchar(10) DEFAULT NULL,
  `p_bray2` varchar(10) DEFAULT NULL,
  `p_morgan` varchar(10) DEFAULT NULL,
  `p_colwell` varchar(10) DEFAULT NULL,
  `k_morgan` varchar(10) DEFAULT NULL,
  `ca_morgan` varchar(10) DEFAULT NULL,
  `mg_morgan` varchar(10) DEFAULT NULL,
  `na_morgan` varchar(10) DEFAULT NULL,
  `ch_h2o` varchar(10) DEFAULT NULL,
  `ocarbon` varchar(10) DEFAULT NULL,
  `omatter` varchar(10) DEFAULT NULL,
  `fe` varchar(10) DEFAULT NULL,
  `ec` varchar(10) DEFAULT NULL,
  `ph_cacl2` varchar(10) DEFAULT NULL,
  `ph_h2o` varchar(10) DEFAULT NULL,
  `paramag` varchar(10) DEFAULT NULL,
  `s_morgan` varchar(10) DEFAULT NULL,
  `b_cacl2` varchar(10) DEFAULT NULL,
  `mn_dtpa` varchar(10) DEFAULT NULL,
  `zn_dtpa` varchar(10) DEFAULT NULL,
  `fe_dtpa` varchar(10) DEFAULT NULL,
  `cu_dtpa` varchar(10) DEFAULT NULL,
  `al` varchar(10) DEFAULT NULL,
  `sl_cacl2` varchar(10) DEFAULT NULL,
  `m_dtpa` varchar(10) DEFAULT NULL,
  `co_dtpa` varchar(10) DEFAULT NULL,
  `se` varchar(10) DEFAULT NULL,
  `ca_mehlick3` varchar(10) DEFAULT NULL,
  `mg_mehlick3` varchar(10) DEFAULT NULL,
  `k_mehlick3` varchar(10) DEFAULT NULL,
  `na_mehlick3` varchar(10) DEFAULT NULL,
  `al_mehlick3` varchar(10) DEFAULT NULL,
  `BS_ca2` varchar(10) DEFAULT NULL,
  `BS_ca_ppm` varchar(10) DEFAULT NULL,
  `BS_mg2` varchar(10) DEFAULT NULL,
  `BS_mg_ppm` varchar(10) DEFAULT NULL,
  `BS_k` varchar(10) DEFAULT NULL,
  `BS_k_ppm` varchar(10) DEFAULT NULL,
  `BS_na` varchar(10) DEFAULT NULL,
  `BS_na_ppm` varchar(10) DEFAULT NULL,
  `BS_al3` varchar(10) DEFAULT NULL,
  `BS_ob` varchar(10) DEFAULT NULL,
  `BS_h` varchar(10) DEFAULT NULL,
  `ca_mg_ratio` varchar(10) DEFAULT NULL,
  `c_n_ratio` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `thingspeak-api`
--

CREATE TABLE `thingspeak-api` (
  `id` int NOT NULL,
  `DATEUTC` datetime DEFAULT NULL,
  `api_key` text,
  `field1` varchar(100) DEFAULT NULL,
  `field2` varchar(100) DEFAULT NULL,
  `field3` varchar(100) DEFAULT NULL,
  `field4` varchar(100) DEFAULT NULL,
  `field5` varchar(100) DEFAULT NULL,
  `field6` varchar(100) DEFAULT NULL,
  `field7` varchar(100) DEFAULT NULL,
  `field8` varchar(100) DEFAULT NULL,
  `field9` varchar(100) DEFAULT NULL,
  `field10` varchar(100) DEFAULT NULL,
  `field11` varchar(100) DEFAULT NULL,
  `field12` varchar(100) DEFAULT NULL,
  `status` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `water_records`
--

CREATE TABLE `water_records` (
  `id` int NOT NULL,
  `client_records_id` int NOT NULL,
  `modx_user_id` int NOT NULL,
  `date` date NOT NULL,
  `email` varchar(30) DEFAULT NULL,
  `client_name` varchar(30) DEFAULT NULL,
  `site_address` varchar(30) DEFAULT NULL,
  `state_postcode` varchar(30) DEFAULT NULL,
  `analysis_type` varchar(30) DEFAULT NULL,
  `lab_no` varchar(30) DEFAULT NULL,
  `batch_no` varchar(30) DEFAULT NULL,
  `date_sampled` date DEFAULT NULL,
  `sample_id` varchar(30) DEFAULT NULL,
  `site_id` varchar(30) DEFAULT NULL,
  `crop_type` varchar(30) DEFAULT NULL,
  `nh4` varchar(15) DEFAULT NULL,
  `no3` varchar(15) DEFAULT NULL,
  `p` varchar(15) DEFAULT NULL,
  `k` varchar(15) DEFAULT NULL,
  `s` varchar(15) DEFAULT NULL,
  `mg` varchar(15) DEFAULT NULL,
  `ca` varchar(15) DEFAULT NULL,
  `na` varchar(15) DEFAULT NULL,
  `fe` varchar(15) DEFAULT NULL,
  `mn` varchar(15) DEFAULT NULL,
  `zn` varchar(15) DEFAULT NULL,
  `cu` varchar(15) DEFAULT NULL,
  `b` varchar(15) DEFAULT NULL,
  `m` varchar(15) DEFAULT NULL,
  `co` varchar(15) DEFAULT NULL,
  `cond_dsm` varchar(15) DEFAULT NULL,
  `hco3-` varchar(15) DEFAULT NULL,
  `ph` varchar(15) DEFAULT NULL,
  `rand` varchar(100) NOT NULL,
  `status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `water_specifications`
--

CREATE TABLE `water_specifications` (
  `id` int NOT NULL,
  `type` varchar(50) DEFAULT NULL,
  `nh4_min` varchar(50) DEFAULT NULL,
  `nh4_avg` varchar(50) DEFAULT NULL,
  `nh4_max` varchar(50) DEFAULT NULL,
  `no3_min` varchar(50) DEFAULT NULL,
  `no3_avg` varchar(50) NOT NULL,
  `no3_max` varchar(50) NOT NULL,
  `ph_min` varchar(50) NOT NULL,
  `ph_avg` varchar(50) NOT NULL,
  `ph_max` varchar(50) NOT NULL,
  `p_min` varchar(50) NOT NULL,
  `p_avg` varchar(50) NOT NULL,
  `p_max` varchar(50) NOT NULL,
  `k_min` varchar(50) DEFAULT NULL,
  `k_avg` varchar(50) DEFAULT NULL,
  `k_max` varchar(50) DEFAULT NULL,
  `s_min` varchar(50) DEFAULT NULL,
  `s_avg` varchar(50) DEFAULT NULL,
  `s_max` varchar(50) DEFAULT NULL,
  `ca_min` varchar(50) DEFAULT NULL,
  `ca_avg` varchar(50) DEFAULT NULL,
  `ca_max` varchar(50) DEFAULT NULL,
  `mg_min` varchar(50) DEFAULT NULL,
  `mg_avg` varchar(50) DEFAULT NULL,
  `mg_max` varchar(50) DEFAULT NULL,
  `na_min` varchar(50) DEFAULT NULL,
  `na_avg` varchar(50) DEFAULT NULL,
  `na_max` varchar(50) DEFAULT NULL,
  `cu_min` varchar(50) DEFAULT NULL,
  `cu_avg` varchar(50) DEFAULT NULL,
  `cu_max` varchar(50) DEFAULT NULL,
  `zn_min` varchar(50) DEFAULT NULL,
  `zn_avg` varchar(50) DEFAULT NULL,
  `zn_max` varchar(50) DEFAULT NULL,
  `mn_min` varchar(50) DEFAULT NULL,
  `mn_avg` varchar(50) DEFAULT NULL,
  `mn_max` varchar(50) DEFAULT NULL,
  `b_min` varchar(50) DEFAULT NULL,
  `b_avg` varchar(50) DEFAULT NULL,
  `b_max` varchar(50) DEFAULT NULL,
  `fe_min` varchar(50) DEFAULT NULL,
  `fe_avg` varchar(50) DEFAULT NULL,
  `fe_max` varchar(50) DEFAULT NULL,
  `cl_min` varchar(50) DEFAULT NULL,
  `cl_avg` varchar(50) DEFAULT NULL,
  `cl_max` varchar(50) DEFAULT NULL,
  `cond_dsm_min` varchar(50) DEFAULT NULL,
  `cond_dsm_avg` varchar(50) DEFAULT NULL,
  `cond_dsm_max` varchar(50) DEFAULT NULL,
  `hco3-_min` varchar(50) DEFAULT NULL,
  `hco3-_avg` varchar(50) DEFAULT NULL,
  `hco3-_max` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `weather_station`
--

CREATE TABLE `weather_station` (
  `cid` int NOT NULL,
  `modx_user_id` varchar(20) DEFAULT NULL,
  `action` varchar(20) DEFAULT NULL,
  `id` varchar(20) DEFAULT NULL,
  `password` varchar(20) DEFAULT NULL,
  `dateutc` datetime DEFAULT NULL,
  `winddir` varchar(20) DEFAULT NULL,
  `windspeedmph` varchar(20) DEFAULT NULL,
  `windgustmph` varchar(20) DEFAULT NULL,
  `windgustdir` varchar(20) DEFAULT NULL,
  `windspdmph_avg2m` varchar(20) DEFAULT NULL,
  `winddir_avg2m` varchar(20) DEFAULT NULL,
  `windgustmph_10m` varchar(20) DEFAULT NULL,
  `windgustdir_10m` varchar(20) DEFAULT NULL,
  `humidity` varchar(20) DEFAULT NULL,
  `dewptf` varchar(20) DEFAULT NULL,
  `tempf` varchar(20) DEFAULT NULL,
  `temp2f` varchar(20) DEFAULT NULL,
  `temp3f` varchar(20) DEFAULT NULL,
  `temp4f` varchar(20) DEFAULT NULL,
  `rainin` varchar(20) DEFAULT NULL,
  `dailyrainin` varchar(20) DEFAULT NULL,
  `baromin` varchar(20) DEFAULT NULL,
  `weather` varchar(20) DEFAULT NULL,
  `clouds` varchar(20) DEFAULT NULL,
  `soiltempf` varchar(20) DEFAULT NULL,
  `soiltemp2f` varchar(20) DEFAULT NULL,
  `soiltemp3f` varchar(20) DEFAULT NULL,
  `soiltemp4f` varchar(20) DEFAULT NULL,
  `soilmoisture` varchar(20) DEFAULT NULL,
  `soilmoisture2` varchar(20) DEFAULT NULL,
  `soilmoisture3` varchar(20) DEFAULT NULL,
  `soilmoisture4` varchar(20) DEFAULT NULL,
  `leafwetness` varchar(20) DEFAULT NULL,
  `leafwetness2` varchar(20) DEFAULT NULL,
  `solarradiation` varchar(20) DEFAULT NULL,
  `UV` varchar(20) DEFAULT NULL,
  `visibility` varchar(20) DEFAULT NULL,
  `indoortempf` varchar(20) DEFAULT NULL,
  `indoorhumidity` varchar(20) DEFAULT NULL,
  `AqNO` varchar(20) DEFAULT NULL,
  `AqNO2T` varchar(20) DEFAULT NULL,
  `AqNO2` varchar(20) DEFAULT NULL,
  `AqNO2Y` varchar(20) DEFAULT NULL,
  `AqNOX` varchar(20) DEFAULT NULL,
  `AqNOY` varchar(20) DEFAULT NULL,
  `AqNO3` varchar(20) DEFAULT NULL,
  `AqSO4` varchar(20) DEFAULT NULL,
  `AqSO2` varchar(20) DEFAULT NULL,
  `AqSO2T` varchar(20) DEFAULT NULL,
  `AqCO` varchar(20) DEFAULT NULL,
  `AqCOT` varchar(20) DEFAULT NULL,
  `AqEC` varchar(20) DEFAULT NULL,
  `AqOC` varchar(20) DEFAULT NULL,
  `AqBC` varchar(20) DEFAULT NULL,
  `AqUV-AETH` varchar(20) DEFAULT NULL,
  `AqPM2.5` varchar(20) DEFAULT NULL,
  `AqPM10` varchar(20) DEFAULT NULL,
  `AqOZONE` varchar(20) DEFAULT NULL,
  `softwaretype` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `animal_records`
--
ALTER TABLE `animal_records`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `animal_specifications`
--
ALTER TABLE `animal_specifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `block_info`
--
ALTER TABLE `block_info`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `calendar_events`
--
ALTER TABLE `calendar_events`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `client_records`
--
ALTER TABLE `client_records`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `crop_info`
--
ALTER TABLE `crop_info`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `editor`
--
ALTER TABLE `editor`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `fertiliser_specifications`
--
ALTER TABLE `fertiliser_specifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `field_sensors`
--
ALTER TABLE `field_sensors`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `newtile`
--
ALTER TABLE `newtile`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `plant_images`
--
ALTER TABLE `plant_images`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `plant_records`
--
ALTER TABLE `plant_records`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `plant_specifications`
--
ALTER TABLE `plant_specifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `power`
--
ALTER TABLE `power`
  ADD PRIMARY KEY (`DID`);

--
-- Indexes for table `reports`
--
ALTER TABLE `reports`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sensor_id`
--
ALTER TABLE `sensor_id`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `soil_comments`
--
ALTER TABLE `soil_comments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `soil_records`
--
ALTER TABLE `soil_records`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `soil_specifications`
--
ALTER TABLE `soil_specifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `thingspeak-api`
--
ALTER TABLE `thingspeak-api`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `water_records`
--
ALTER TABLE `water_records`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `water_specifications`
--
ALTER TABLE `water_specifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `weather_station`
--
ALTER TABLE `weather_station`
  ADD PRIMARY KEY (`cid`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `animal_records`
--
ALTER TABLE `animal_records`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `animal_specifications`
--
ALTER TABLE `animal_specifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `block_info`
--
ALTER TABLE `block_info`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `calendar_events`
--
ALTER TABLE `calendar_events`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `client_records`
--
ALTER TABLE `client_records`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crop_info`
--
ALTER TABLE `crop_info`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `editor`
--
ALTER TABLE `editor`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `fertiliser_specifications`
--
ALTER TABLE `fertiliser_specifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `field_sensors`
--
ALTER TABLE `field_sensors`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `newtile`
--
ALTER TABLE `newtile`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `plant_images`
--
ALTER TABLE `plant_images`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `plant_records`
--
ALTER TABLE `plant_records`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `plant_specifications`
--
ALTER TABLE `plant_specifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `power`
--
ALTER TABLE `power`
  MODIFY `DID` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `reports`
--
ALTER TABLE `reports`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sensor_id`
--
ALTER TABLE `sensor_id`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `soil_comments`
--
ALTER TABLE `soil_comments`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `soil_records`
--
ALTER TABLE `soil_records`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `soil_specifications`
--
ALTER TABLE `soil_specifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `thingspeak-api`
--
ALTER TABLE `thingspeak-api`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `water_records`
--
ALTER TABLE `water_records`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `water_specifications`
--
ALTER TABLE `water_specifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `weather_station`
--
ALTER TABLE `weather_station`
  MODIFY `cid` int NOT NULL AUTO_INCREMENT;

-- --------------------------------------------------------

--
-- Structure for view `calendar_view`
--
DROP TABLE IF EXISTS `calendar_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `calendar_view`  AS SELECT `calendar_events`.`id` AS `Cid`, `calendar_events`.`modx_user_id` AS `Cuid`, `calendar_events`.`title` AS `title`, `calendar_events`.`type` AS `type`, `calendar_events`.`start` AS `Cstart`, ifnull(cast(`calendar_events`.`end` as date),(cast(`calendar_events`.`start` as date) + interval 1 day)) AS `Cend`, `plant_records`.`id` AS `Pid`, `plant_records`.`modx_user_id` AS `Puid`, `plant_records`.`sample_id` AS `Psam_id`, `plant_records`.`site_id` AS `Psite_id`, `plant_records`.`analysis_type` AS `Panalysis_type`, `plant_records`.`date` AS `Pstart`, ifnull(cast(`plant_records`.`date` as date),(cast(`plant_records`.`date` as date) + interval 1 day)) AS `Pend`, `soil_records`.`id` AS `Sid`, `soil_records`.`modx_user_id` AS `Suid`, `soil_records`.`sample_id` AS `Ssam_id`, `soil_records`.`site_id` AS `Ssite_id`, `soil_records`.`analysis_type` AS `Sanalysis_type`, `soil_records`.`date` AS `Sstart`, ifnull(cast(`soil_records`.`date` as date),(cast(`soil_records`.`date` as date) + interval 1 day)) AS `Send`, `water_records`.`id` AS `Wid`, `water_records`.`modx_user_id` AS `Wuid`, `water_records`.`sample_id` AS `Wsam_id`, `water_records`.`site_id` AS `Wsite_id`, `water_records`.`analysis_type` AS `Wanalysis_type`, `water_records`.`date` AS `Wstart`, ifnull(cast(`water_records`.`date` as date),(cast(`water_records`.`date` as date) + interval 1 day)) AS `Wend`, `animal_records`.`id` AS `Aid`, `animal_records`.`modx_user_id` AS `Auid`, `animal_records`.`sample_id` AS `Asam_id`, `animal_records`.`animal` AS `Asite_id`, `animal_records`.`analysis_type` AS `Aanalysis_type`, `animal_records`.`date` AS `Astart`, ifnull(cast(`animal_records`.`date` as date),(cast(`animal_records`.`date` as date) + interval 1 day)) AS `Aend` FROM ((((`calendar_events` left join `animal_records` on((`calendar_events`.`modx_user_id` = `animal_records`.`modx_user_id`))) left join `water_records` on((`calendar_events`.`modx_user_id` = `water_records`.`modx_user_id`))) left join `soil_records` on((`calendar_events`.`modx_user_id` = `soil_records`.`modx_user_id`))) left join `plant_records` on((`calendar_events`.`modx_user_id` = `plant_records`.`modx_user_id`))) ;

-- --------------------------------------------------------

--
-- Structure for view `reports_view`
--
DROP TABLE IF EXISTS `reports_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `reports_view`  AS SELECT `soil_records`.`id` AS `id`, `soil_records`.`date` AS `date`, `soil_records`.`modx_user_id` AS `modx_user_id`, `soil_records`.`client_name` AS `client_name`, `soil_records`.`analysis_type` AS `analysis_type`, `soil_records`.`lab_no` AS `lab_no`, `soil_records`.`batch_no` AS `batch_no`, `soil_records`.`sample_id` AS `sample_id`, `soil_records`.`site_id` AS `site_id`, `soil_records`.`crop_type` AS `crop_type`, `soil_records`.`date_sampled` AS `date_sampled`, `soil_records`.`rand` AS `rand`, `soil_records`.`status` AS `status` FROM `soil_records`union all select `plant_records`.`id` AS `id`,`plant_records`.`date` AS `date`,`plant_records`.`modx_user_id` AS `modx_user_id`,`plant_records`.`client_name` AS `client_name`,`plant_records`.`analysis_type` AS `analysis_type`,`plant_records`.`lab_no` AS `lab_no`,`plant_records`.`batch_no` AS `batch_no`,`plant_records`.`sample_id` AS `sample_id`,`plant_records`.`site_id` AS `site_id`,`plant_records`.`crop_type` AS `crop_type`,`plant_records`.`date_sampled` AS `date_sampled`,`plant_records`.`rand` AS `rand`,`plant_records`.`status` AS `status` from `plant_records` union all select `water_records`.`id` AS `id`,`water_records`.`date` AS `date`,`water_records`.`modx_user_id` AS `modx_user_id`,`water_records`.`client_name` AS `client_name`,`water_records`.`analysis_type` AS `analysis_type`,`water_records`.`lab_no` AS `lab_no`,`water_records`.`batch_no` AS `batch_no`,`water_records`.`sample_id` AS `sample_id`,`water_records`.`site_id` AS `site_id`,`water_records`.`crop_type` AS `crop_type`,`water_records`.`date_sampled` AS `date_sampled`,`water_records`.`rand` AS `rand`,`water_records`.`status` AS `status` from `water_records` order by `date` desc  ;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
