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

<link rel="stylesheet" href="client-assets/home/css/graphPrint.css" media="print">

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

<div class="container" id="content">
    <div class="row">
        [[!logoHeader]]
    </div>

    [[!animalAnalysisClient]]
    
    
    <!-- Graph Button -->
    <div class="d-print-none">
        [[!animalAnalysisReportButton]]
        <!-- <button class="btn btn-secondary downloadPDF" >Generate PDF</button> -->
    </div>

    <!-- GRAPH BANNER -->
    
    <div class="row">
        <div class="col-md-12 text-center font-weight-bold h4" >ANIMAL DIETARY MINERAL BALANCE</div>
    </div>

    <hr class="p-1 m-1">
    
    <!-- CHART HEADER  -->
    
    <table class="chart">
        <tbody>
          <tr class="chart-header">
            <th class="text-center col-1-7">Elements</th>
            <th class="text-center col-1-7">Daily Intake</th>
            <th class="text-center col-1-7">Daily Req.</th>
            <th class="text-center col-1-7">Nutrient Bal</th>
            <th class="text-center col-1-7">Deficit</th>
            <th class="text-center col-1-7">Satisfactory</th>
            <th >Surplus</th>
          </tr>
          
          <tr>
            <td class="border-left"></td>
            <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>
          
          [[!animalAnalysisCalcs? &element=`n`  &nutrient=`Nitrogen` &weight=`g`]]
          [[!animalAnalysisCalcs? &element=`p`  &nutrient=`Phosphorus` &weight=`g`]]
          [[!animalAnalysisCalcs? &element=`k`  &nutrient=`Potassium` &weight=`g`]]
          [[!animalAnalysisCalcs? &element=`mg`  &nutrient=`Magnesium` &weight=`g`]]
          [[!animalAnalysisCalcs? &element=`ca`  &nutrient=`Calcium` &weight=`g`]]
          [[!animalAnalysisCalcs? &element=`na`  &nutrient=`Sodium` &weight=`g`]]
    
          
          <tr>
            <td class="text-left border-left"></td>
            <td class="text-center border-left"></td>
            <td class="text-center border-left"></td>
            <td class="text-center border-left nutrient-balance"></td>
            <td class="text-center border-left"></td>
            <td class="text-center border-left"></td>
            <td class="text-center border-left border-right"></td>
          </tr>
          
          [[!animalAnalysisCalcs? &element=`fe` &nutrient=`Iron` &weight=`mg`]]
          [[!animalAnalysisCalcs? &element=`mn`  &nutrient=`Manganese` &weight=`mg`]]
          [[!animalAnalysisCalcs? &element=`zn`  &nutrient=`Zinc` &weight=``]]
          [[!animalAnalysisCalcs? &element=`cu`  &nutrient=`Copper` &weight=`mg`]]
          [[!animalAnalysisCalcs? &element=`b`  &nutrient=`Boron` &weight=`mg`]]
          
          <tr>
            <td class="border-bottom border-left"></td>
            <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>
          
          [[!animalAnalysisCalcs? &element=`mo` &nutrient=`Molybdenum` &weight=`mg`]]
          [[!animalAnalysisCalcs? &element=`co`  &nutrient=`Colbalt` &weight=`mg`]]
          [[!animalAnalysisCalcs? &element=`se`  &nutrient=`Selenium` &weight=`mg`]]
          [[!animalAnalysisCalcs? &element=`ch`  &nutrient=`Chloride` &weight=`g`]]
          
          <tr>
            <td class="border-bottom border-left"></td>
            <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="clearfix"></div>
    
    <p>Note: The above assessment is for individual nutrient levels.  The influence of nutrient interations is not considered above.  Some key Nutrient Ratio Indices, which do account for these interactions, are shown below.  Although based on published calculations, they should be used with caution, as metabolic disorders can be induced by a multitude of factors, and not just these nutrient rations alone.</p>
    
    <div class="clearfix"></div>
    
    [[!animalRatios]]
    
    <div class="clearfix"></div>      
    
    <p>The normal range levels shown above are based on the minimum for either animal or plant requirement (which ever is the greater).  The following nutrient ratio indices have been calculated as requested to assist in evaluation the sutability of ths sample as a dairy feed. Although based on published calculations, hey should be useed with caution, as metabolic disorders can be induced by a multitude of factors and not just these nutrient ratios alone.</p>
    <p><b>References:</b></p>
    <p><ul>
        <li>AFIA Laboratory Methods Manual v7 Appendix 2.2R(1) , p93 <a href="https://www.afia.org.au/files/pdfs/AFIA_Lab_Manual_v7.pdf">Link</a></li>
        <li>NRC Nutrient Requirements of Dairy Cattle. National Academy Press, Washington DC. 7th Revised Edition, 2001 <a href="#">Link</a></li>
        <li>Milk Production from Pasture – Principles and Practices. Massey University, NZ, 2002 <a href="#">Link</a></li>
        <li>Forage Evaluation in Ruminant Nutrition. CABI, Wallingford, UK, 2000<a href="https://www.researchgate.net/profile/Khalid_Hassan10/post/Can_anybody_help_with_ruminant_nutrition_textbook2/attachment/59d6393779197b80779966e8/AS%3A400869553131522%401472586157622/download/Forage+evaluation+in+Ruminant.pdf">Link</a></li>
    </ul></p>
    <div class="clearfix"></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>