keymasterviriya1150

Untitled

May 5th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1.  
  2. <?php
  3. require_once('config.php');
  4. ob_start();
  5. ?>
  6.  
  7.  
  8. <?php
  9.     $con=mysqli_connect("localhost","root","","testorder");
  10.     /*if($con!=null)
  11.         echo"Sucess";*/
  12.     $result=mysqli_query($con,"SELECT * FROM orders WHERE IDTYPE>0 " );
  13.     if(!$result)
  14.         die("connot");
  15.     $data=array("ID","IDType","Type","Price","No","PriceResult" );
  16.     echo"<center>";
  17.     echo"<h1><u>Report</u></h1>";
  18.     echo"<table border=1>";
  19.         echo"<tr>";
  20.             for($i=0; $i<count($data) ; $i++)
  21.                 echo"<td>".$data[$i]."</td>";  
  22.     echo"</tr>";   
  23.     while($row=mysqli_fetch_array($result,MYSQLI_NUM))
  24.     {
  25.         echo"<tr>";
  26.         for($i =0; $i<6 ;$i++)
  27.             echo "<td>".$row[$i]."</td>";  
  28.         echo"<tr>";
  29.     }
  30.    
  31. echo"</table>";
  32. echo"</center>";
  33.  
  34.  
  35.  
  36. ?>
  37. <?Php
  38.  
  39. $content = ob_get_clean();
  40. require_once'/mpdf1/mpdf.php';
  41. $pdf = new mPDF();
  42. $pdf->writeHTML($content,2);
  43. $pdf->output();
  44.  
  45.  
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment