soil-analysis-full-report.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <title>[[*longtitle]] | [[++site_name]]</title>
  5. <base href="[[!++site_url]]" >
  6. <meta charset="[[++modx_charset]]" >
  7. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
  9. <meta name="keywords" content="[[*introtext]]" >
  10. <meta name="description" content="[[*description]]" >
  11. [[!Profile]]
  12. <link rel="icon" href="client-assets/images/favicon.ico?v=2" type="image/x-icon" >
  13. <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
  14. <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" rel="stylesheet" type="text/css" />
  15. <link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
  16. <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css" integrity="sha256-PF6MatZtiJ8/c9O9HQ8uSUXr++R9KBYu4gbNG5511WE=" crossorigin="anonymous" rel="stylesheet" type="text/css" />
  17. <link type="text/css" href="/client-assets/weather-icons/css/weather-icons.min.css?version=1.16" rel="stylesheet" type="text/css" />
  18. <link href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" rel="stylesheet" type="text/css" />
  19. <script type="text/javascript" src="https://use.fontawesome.com/1e2844bb90.js"></script>
  20. <link href="client-assets/css/dashboard.css" rel="stylesheet" type="text/css" />
  21. <script src="https://unpkg.com/gijgo@1.9.11/js/gijgo.min.js" type="text/javascript"></script>
  22. <link href="https://unpkg.com/gijgo@1.9.11/css/gijgo.min.css" rel="stylesheet" type="text/css" />
  23. <script src="client-assets/js/skycons.js" type="text/javascript"></script>
  24. <link href="client-assets/home/css/graphing.css" rel="stylesheet" type="text/css" media="screen" />
  25. <link href="client-assets/home/css/alux.min.css" rel="stylesheet" type="text/css" media="screen" />
  26. <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>
  27. <style>
  28. @media print {
  29. @page {
  30. size: A4 portrait;
  31. }
  32. @page :left {
  33. margin-left: 0.5cm;
  34. }
  35. @page :right {
  36. margin-right: 0.5cm;
  37. }
  38. @page :top {
  39. margin-top: 0cm;
  40. }
  41. @page :bottom {
  42. margin-bottom: 0cm;
  43. }
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <!-- Get Front Page -->
  49. <!-- Get Graph
  50. [[!getResources? &resources=`32` &tpl=`graph-page` &includeContent=1]] -->
  51. <? include_once soil-analysis.php; ?>
  52. <p></p>
  53. <!-- Get Report -->
  54. [[!getResources? &resources=`41` &tpl=@INLINE [[+content]] &includeContent=`1`]] -->
  55. <? include_once soil-report.php; ?>
  56. <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  57. <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
  58. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  59. <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  60. <script type="text/javascript">
  61. addEventListener("load", function() {
  62. setTimeout(hideURLbar, 0);
  63. }, false);
  64. function hideURLbar(){
  65. window.scrollTo(0,1);
  66. }
  67. </script>
  68. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o" crossorigin="anonymous"></script>
  69. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
  70. <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>
  71. <script>
  72. //https://github.com/eKoopmans/html2pdf.js
  73. $('.downloadPDF').click(function () {
  74. var element = document.getElementById('content'); //document.createElement("body");
  75. element.classList.remove('screen');
  76. element.classList.add('print');
  77. var opt = {
  78. margin: 3,
  79. filename: 'soil-analysis.pdf',
  80. image: { type: 'jpeg', quality: 1.0 },
  81. html2canvas: { scale: 2, letterRendering: true, windowWidth: 1024 }, //, windowWidth: 1024
  82. jsPDF: { orientation: 'portrait', unit: 'mm', format: 'a4', putOnlyUsedFonts: true, floatPrecision: 'smart', }
  83. };
  84. html2pdf()
  85. .from(element)
  86. .toPdf()
  87. .set(opt)
  88. .save()
  89. .then(function(){
  90. element.classList.remove('print');
  91. element.classList.add('screen');
  92. });
  93. });
  94. </script>
  95. </body>
  96. </html>