|
|
@@ -147,18 +147,19 @@ $reportUrl = '/dashboard/crop-analysis/soil-test-data/soil-report.php?' . $par
|
|
|
|
|
|
</div>
|
|
|
|
|
|
-<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
|
|
|
-<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
|
|
|
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
|
|
<script>
|
|
|
- $('.downloadPDF').click(function () {
|
|
|
- var element = document.body;
|
|
|
- html2pdf().from(element).set({
|
|
|
- margin: 3,
|
|
|
- filename: 'soil-analysis.pdf',
|
|
|
- image: { type: 'jpeg', quality: 1.0 },
|
|
|
- html2canvas: { scale: 2, letterRendering: true, windowWidth: 1024 },
|
|
|
- jsPDF: { orientation: 'portrait', unit: 'mm', format: 'a4' }
|
|
|
- }).save();
|
|
|
+ document.querySelectorAll('.downloadPDF').forEach(function (btn) {
|
|
|
+ btn.addEventListener('click', function () {
|
|
|
+ var element = document.body;
|
|
|
+ html2pdf().from(element).set({
|
|
|
+ margin: 3,
|
|
|
+ filename: 'soil-analysis.pdf',
|
|
|
+ image: { type: 'jpeg', quality: 1.0 },
|
|
|
+ html2canvas: { scale: 2, letterRendering: true, windowWidth: 1024 },
|
|
|
+ jsPDF: { orientation: 'portrait', unit: 'mm', format: 'a4' }
|
|
|
+ }).save();
|
|
|
+ });
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|