Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. if (trim($_POST['pdfid']) == "All") {
  2. $qry = "select master.hcid,hcmaster.hcname,master.instdate,master.sendname,master.address,statemaster.statename,master.district,master.mobile,master.receiptm,master.subject,master.disposal,master.dispdate,MASTER.dispdetail,master.remark
  3.  
  4. if ($qry) {
  5. $tbdata = '';
  6. $con = mysqli_connect("localhost", "root", "", "dakmanagement");
  7. $res = mysqli_query($con, $qry) or die("not fire");
  8.  
  9.  
  10.  
  11. if (mysqli_num_rows($res)!=0)
  12. {
  13. $i = 1;
  14. while($row=mysqli_fetch_array($res, MYSQLI_ASSOC))
  15. {
  16. $tbdata .= '<tr><td colspan="3">&nbsp;</td></tr><tr><td width="10%" align="left">' . $i .
  17.  
  18. }
  19. }
  20.  
  21. // create new PDF document
  22. $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  23.  
  24. // set document information
  25. $pdf->SetCreator(PDF_CREATOR);
  26. $pdf->SetAuthor('Vinay Soni');
  27. $pdf->SetTitle('High Court');
  28. $pdf->SetSubject('High Court');
  29. $pdf->SetKeywords('High Court');
  30.  
  31.  
  32. // set margins
  33. $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  34. $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
  35. $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
  36.  
  37. // set auto page breaks
  38. $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  39.  
  40. // set some language-dependent strings (optional)
  41. if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
  42. require_once(dirname(__FILE__) . '/lang/eng.php');
  43. $pdf->setLanguageArray($l);
  44. }
  45.  
  46. // ---------------------------------------------------------
  47. // set font
  48. $pdf->SetFont('dejavusans', '', 10);
  49.  
  50. // add a page
  51. $pdf->AddPage();
  52.  
  53. // writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='')
  54. // writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true)
  55. // create some HTML content
  56. $html = '
  57. <div style="width:100%; float:left;">
  58. <p style="font-weight: bold; font-size: 20px; text-align: center;">RAJASTHAN HIGH COURT BENCH JAIPUR.<br/>
  59. <span style="font-weight: bold; font-size: 18px; text-align: center;">Hon`ble CJ Secretariat</span>
  60. </p>
  61. </div>
  62. <table width="100%" border="1">
  63. <tr >
  64. <th align="left">S.No.</th>
  65. <th align="center">Complete Detail of Records</th>
  66. <th align="right" >Inst_date<br/>Disp_date</th>
  67. </tr>
  68. ' . $tbdata . '
  69. </table>
  70. ';
  71. // output the HTML content
  72. $pdf->writeHTML($html, true, false, true, false, '');
  73.  
  74. // reset pointer to the last page
  75. $pdf->lastPage();
  76.  
  77. //Close and output PDF document
  78. $pdf->Output('Report.pdf', 'I');
  79. }
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement