<!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]]" >

		[[!Profile]]
		
		[[$dash-header]]
		
		<link href="/client-assets/css/dashboard.css" rel="stylesheet" type="text/css" />
		<script src="https://unpkg.com/gijgo@1.9.11/js/gijgo.min.js" type="text/javascript"></script>
		<link href="https://unpkg.com/gijgo@1.9.11/css/gijgo.min.css" rel="stylesheet" type="text/css" />
		<script src="client-assets/js/skycons.js" type="text/javascript"></script>
    
        <link href="client-assets/home/css/graphing.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="client-assets/home/css/alux.min.css" rel="stylesheet" type="text/css" media="screen" />
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js" integrity="sha512-YcsIPGdhPK4P/uRW6/sruonlYj+Q7UHWeKfTAkBW+g83NKM+jMJFJ4iAPfSnVp7BKD4dKMHmVSvICUbE/V1sSw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

        <style>
            @media print {
                @page {
                    size: A4 portrait;
                }
                @page :left {
                    margin-left: 0.5cm;
                }
                @page :right {
                    margin-right: 0.5cm;
                }
                @page :top {
                    margin-top: 0cm;
                }
                @page :bottom {
                    margin-bottom: 0cm;
                }
            }
        </style>

    </head>
<body>

<title>[[*pagetitle]]</title>
<link rel="stylesheet" href="client-assets/home/css/graphPrint.css" media="print">

<style>
    .progress {
        border-radius: 0rem !important;
    }
</style>

<div id="loader-gif" style="display:none; z-index:10000;" >[[$plantPOPUP]]</div>

<script>
    $(document).ready(function() {
        $("#start-loader").click(function() {
            $("#loader-gif").show();
                setTimeout(function() {
                $("#loader-gif").hide();
            }, 5000);
        });
    });
</script>

<div class="container">
    <div class="row mb-5">
        [[!logoHeader]]
    </div>
    
    [[!plantAnalysisClient]]

    <!-- Graph Button -->
    <div class="d-print-none">
        [[!plantAnalysisReportButton]]
    </div>
    
    <!-- GRAPH BANNER -->
    
    <div class="row">
        <div class="col-md-12 text-center font-weight-bold h4" >ANALYSIS RESULTS</div>
    </div>
    
    <hr class="p-1 m-1">
    
    <!-- CHART HEADER  -->
    
    <table class="chart">
        <tbody>
          <tr class="chart-header">
            <th colspan=3 class="black text-center col-50 border-left border-right border-top">ELEMENT</th>
            <th colspan=3 class="black text-center col-50 border-right border-top">STATUS</th>
          </tr>
          
          <tr class="chart-header-sub">
            <th class="black text-center col-16 border-bottom border-left">Elements</th>
            <th class="black text-center col-16 border-bottom">Desired</th>
            <th class="black text-center col-16 border-bottom">Found</th>
            <th class="text-center col-16 stripe-1">Deficient</th>
            <th class="text-center col-16 stripe-1">Ideal</th>
            <th class="text-center col-16 border-right stripe-1">High</th>
          </tr>
          
          <tr class="sub-chart-plant">
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left nutrient-balance"></td>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left border-right"></td>
          </tr>
          
          <tr class="chart-header-sub">
            <th colspan=3 class="col-16 border-left text-center lightgreen">MAJOR ELEMENTS</th>
            <th class="text-center col-16 border-left stripe-1"></th>
            <th class="text-center col-16 border-left stripe-1"></th>
            <th class="text-center col-16 border-left border-right stripe-1"></th>
          </tr>
          
          [[!plantAnalysisCalcs? &element=n  &sbl=`` &nutrient=`Nitrogen` &type=`%` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=p  &sbl=`` &nutrient=`Phosphorus` &type=`%` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=k  &sbl=`` &nutrient=`Potassium` &type=`%` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=mg  &sbl=`` &nutrient=`Magnesium` &type=`%` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=ca  &sbl=`` &nutrient=`Calcium` &type=`%` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=na  &sbl=`` &nutrient=`Sodium` &type=`%` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
    
    <!-- Blank Graph row for seperation -->
          <tr>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left nutrient-balance"></td>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left border-right"></td>
          </tr>
          
          <tr class="chart-header-sub">
            <th colspan=3 class="col-16 border-left text-center lightred">TRACE ELEMENTS</th>
            <th class="text-center col-16 border-left stripe-1"></th>
            <th class="text-center col-16 border-left stripe-1"></th>
            <th class="text-center col-16 border-left border-right stripe-1"></th>
          </tr>
          
    <!-- Blank Graph row for seperation -->
          <tr>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left nutrient-balance"></td>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left border-right"></td>
          </tr>

          [[!plantAnalysisCalcs? &element=fe &sbl=`` &nutrient=`Iron` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=mn  &sbl=`` &nutrient=`Manganese` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=zn  &sbl=`` &nutrient=`Zinc` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=cu  &sbl=`` &nutrient=`Copper` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=b  &sbl=`` &nutrient=`Boron` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]

    <!-- Blank Graph row for seperation -->
          <tr>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left nutrient-balance"></td>
            <td class="border-left"></td>
            <td class="border-left"></td>
            <td class="border-left border-right"></td>
          </tr>

          <tr class="chart-header-sub">
            <th colspan=3 class="col-16 border-left text-center lightpurple">MACRO ELEMENTS</th>
            <th class="text-center col-16 border-left stripe-1"></th>
            <th class="text-center col-16 border-left stripe-1"></th>
            <th class="text-center col-16 border-left border-right stripe-1"></th>
          </tr>
          
          [[!plantAnalysisCalcs? &element=m  &sbl=`` &nutrient=`Molybdenum` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=co  &sbl=`` &nutrient=`Cobalt` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=se  &sbl=`` &nutrient=`Selenium` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=cl  &sbl=`` &nutrient=`Chloride` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          [[!plantAnalysisCalcs? &element=c  &sbl=`` &nutrient=`Carbon` &type=`ppm` &min=`` &max=`` &text=`y` &graph=`progress-bar-success`]]
          
          <tr>
            <td class="border-bottom border-left"></td>
            <td class="border-bottom border-left"></td>
            <td class="border-bottom border-left nutrient-balance"></td>
            <td class="border-bottom border-left"></td>
            <td class="border-bottom border-left"></td>
            <td class="border-bottom border-left border-right"></td>
          </tr>
          
        </tbody>
    </table>

    <div class="analysis-footer">
        <p><i class="fa fa-envira nav_icon " style="color: green;"></i>It is always an advantage to assess tisue analysis results along with a corresponding soil analysis for more accurate diagnosis of plant nutrient status.</p>
        <p><i class="fa fa-envira nav_icon " style="color: green;"></i>Trace element levels - manganese, copper and zinc, can all be affeced by fungicide spray residues, giving msleading results, See Comment above.</p>
        <p><i class="fa fa-envira nav_icon " style="color: green;"></i>Talk to your qualified consultant to make a plan for correction or maintenance of the found nutrient levels.</p>
        <p style="font-style: italic; font-size: 9px;">Desired ranges indexed from:  CSIRO Plant Anlysis Handbook 2nd Ed.  Hill Laborotories consultants guide.  PIRSA Soil and Plant Analysis.</p>
        <p style="font-style: italic; font-size: 9px;">Any recommendationa provided by Cropmonitor are advice only We are not paid consultants and we are not covered to accept responsibiliy for any of our suggestions. As no control can be exercised over storage, handling, mixing application or use, or weather, plant or soil conditions before, during or after application (all of which may affect the preformance of our program), no responsibility for, or liability for any failure in performance, losses, damage or injuries consequential or otherwise, arisiing form such storage mixng application or use will be accepted under any circumstances whatsoever. The buyer assumes all responsibility for the use of any of our products.</p>
    </div>

    
</div>

    <!-- 
    <script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=xcotawi18mg1imp8im144buq68h9g3ndd3c9c8215w8qu3ld"></script>
    <script>
        tinymce.init({
            selector: 'textarea',
            menubar: false,
            toolbar: 'bold italic  | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat',
            plugins: 'autosave',
            autosave_interval: '20s'
        });
    </script>
    -->
    
    [[$dash-footer]]
    
    <script>
        //https://github.com/eKoopmans/html2pdf.js
        $('.downloadPDF').click(function () {
        	var element = document.getElementById('content'); //document.createElement("body");
        	element.classList.remove('screen');
        	element.classList.add('print');
        	var opt = {
        		margin:       3,
        		filename:     'soil-analysis.pdf',
        		image:        { type: 'jpeg', quality: 1.0 },
        		html2canvas:  { scale: 2, letterRendering: true, windowWidth: 1024 },  //, windowWidth: 1024
        		jsPDF:        { orientation: 'portrait', unit: 'mm', format: 'a4', putOnlyUsedFonts: true, floatPrecision: 'smart', }
        	};
        	html2pdf()
        	    .from(element)
        	    .toPdf()
        	    .set(opt)
        	    .save()
        	    .then(function(){
        		    element.classList.remove('print');
        		    element.classList.add('screen');
        	});
        	
        });
    </script>
</body>
</html>