0byt3m1n1
Path:
C:
/
wamp64
/
www
/
WaterCat
/
[
Home
]
File: down.php
<?php require_once 'dompdf/autoload.inc.php'; use Dompdf\Dompdf; $id=$_GET['id']; $infoid=$_GET['infoid']; $ph=$_GET['ph']; $alk=$_GET['alk']; $hdns=$_GET['hdns']; $cl=$_GET['cl']; $tds=$_GET['tds']; $iron=$_GET['iron']; $amonia=$_GET['amonia']; $nitrate=$_GET['nitrate']; $phs=$_GET['phs']; $rchl=$_GET['rchl']; $wtr=$_GET['wtr']; $rmks=$_GET['rmks']; $img=$_GET['img']; $servername="localhost"; $username="root"; $password=""; $dbname="watercat"; $conn=mysqli_connect($servername,$username,$password,$dbname); $query="select * from info join details on info.id=details.Id where info.info_id='$infoid'"; $result=mysqli_query($conn,$query); $html = ' <html> <head> <style> table { border-left: 0.05em solid #ccc; border-right: 0; border-top: 0.05em solid #ccc; border-bottom: 0; border-collapse: collapse; } table td, table th { border-left: 0; border-right: 0.05em solid #ccc; border-top: 0; border-bottom: 0.05em solid #ccc; } <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-MLKHL5MWPW"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-MLKHL5MWPW'); </script> </head> <body background="assets/images/slider/s1.jpg" alt="" > <table cellspacing="5px" cellpadding="5px"; align="center"> <tr> <th>pH</th> <th>ALKALINITY</th> <th>HARDNESS</th> <th>CHLORIDE</th> <th>TDS</th> <th>IRON</th> <th>AMMONIA</th> <th>NITRATE</th> <th>PHOSPHATE</th> <th>RESIDUAL CHLORIDE</th> <th>WATER LEVEL</th> <th>REMARKS</th> <th>SITE VIEW</th> </tr> <tr> <td>'.$ph.'</td> <td>'.$alk.'</td> <td>'.$hdns.'</td> <td>'.$cl.'</td> <td>'.$tds.'</td> <td>'.$iron.'</td> <td>'.$amonia.'</td> <td>'.$nitrate.'</td> <td>'.$phs.'</td> <td>'.$rchl.'</td> <td>'.$wtr.'</td> <td>'.$rmks.'</td> <td style="text-align: center;"><img width=5px height=5px src=images/'.$img. 'alt='.$img.'></td> </tr> </table> </body> </html>'; $dompdf=new Dompdf; use Dompdf\Options; $options = new Options(); $options->set('isRemoteEnabled', true); $dompdf = new Dompdf($options); $options->set('defaultMediaType', 'print'); $options->set('isHtml5ParserEnabled', true); $options->set('isPhpEnabled', true); $options->set('chroot', realpath('.')); $dompdf->setOptions($options); $dompdf->loadHtml($html); $dompdf->setPaper('A4','landscape'); $dompdf->render(); ob_end_clean(); $dompdf->stream('file.pdf'); ?>