0byt3m1n1
Path:
C:
/
wamp64
/
www
/
WaterCat
/
[
Home
]
File: print.php
<?php require_once 'dompdf/autoload.inc.php'; use Dompdf\Dompdf; $id=$_GET['id']; $servername="localhost"; $username="root"; $password=""; $dbname="watercat"; $conn=mysqli_connect($servername,$username,$password,$dbname); $query="select * from info where id='$id'"; $result=mysqli_query($conn,$query); while($rows=mysqli_fetch_assoc($result)) { $ph=$rows['pH']; $alk=$rows['Alkalinity']; $hrd=$rows['Hardness']; $cl=$rows['Chloride']; $tds=$rows['TDS']; $iron=$rows['Iron']; $amo=$rows['Ammonia']; $ni=$rows['Nitrate']; $ph=$rows['Phosphate']; $rcl=$rows['Residual_Chloride']; $wtr=$rows['WaterLevel']; $rmks=$rows['Remarks']; $html='<html> <head> <link rel="stylesheet" type="text/css" href="styles.css"> <link rel="stylesheet" type="text/css" href="nav.css"> </head> <style> table, th, td { border: 1px solid black; </style> </head> <body background="assets/images/slider/s1.jpg" alt="" > <div class="topnav"> <a class="active" href="indexnew.php">Home</a> <a href="#news">News</a> <a href="contact.php">Contact</a> <a href="about.html">About</a> </div> <table cellspacing="5px" cellpadding="5%"; 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>STATUS</th> </tr> <tr> <td>'.$ph.'</td> <td>'.$alk.'</td> <td>'.$hrd.'</td> <td>'.$cl.'</td> <td>'.$tds.'</td> <td>'.$iron.'</td> <td>'.$amo.'</td> <td>'.$ni.'</td> <td>'.$ph.'</td> <td>'.$rcl.'</td> <td>'.$wtr.'</td> <td>'.$rmks.'</td> </tr>'; } $html.='</table> </body> </html>'; $dompdf=new Dompdf; $dompdf->loadHtml($html); $dompdf->setPaper('A4','landscape'); $dompdf->render(); ob_end_clean(); $dompdf->loadHtml(html_entity_decode($html)); $dompdf->stream('file.pdf'); ?>