PageRenderTime 26ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/reports/ebpls_professional_tax.php

http://ebpls.googlecode.com/
PHP | 344 lines | 150 code | 27 blank | 167 comment | 2 complexity | bae8ef9fe2bb5cbd55874432f2c8341e MD5 | raw file
  1. <?php
  2. require_once("lib/ebpls.utils.php");
  3. define('FPDF_FONTPATH','font/');
  4. require('ebpls-php-lib/html2pdf_lib/fpdf.php');
  5. include("lib/phpFunctions-inc.php");
  6. $dbLink = get_db_connection();
  7. $result=mysql_query("select lgumunicipality, lguprovince, lguoffice from ebpls_buss_preference") or die(mysql_error());
  8. $resulta=mysql_fetch_row($result);
  9. $pdf=new FPDF('L','mm','Legal');
  10. $pdf->AddPage();
  11. $pdf->image('peoplesmall.jpg',10,5,33);
  12. $pdf->SetFont('Arial','B',12);
  13. $pdf->Cell(340,5,'REPUBLIC OF THE PHILIPPINES',0,1,'C');
  14. $pdf->Cell(340,5,$resulta[0],0,1,'C');
  15. $pdf->Cell(340,5,$resulta[1],0,2,'C');
  16. $pdf->SetFont('Arial','B',14);
  17. $pdf->Cell(340,5,$resulta[2],0,2,'C');
  18. $pdf->Cell(340,5,'',0,2,'C');
  19. $pdf->SetFont('Arial','BU',16);
  20. $pdf->Cell(340,5,'PROFESSIONAL TAX COLLECTION',0,1,'C');
  21. $result=mysql_query("select a.business_permit_code, concat(c.owner_first_name, ' ', c.owner_middle_name, ' ',
  22. c.owner_last_name), b.business_name, e.bus_nature, b.business_street, e.cap_inv, e.last_yr, d.total_amount_paid,
  23. d.or_no, d.or_date, b.business_category_code
  24. from ebpls_business_enterprise_permit a, ebpls_business_enterprise b, ebpls_owner c, ebpls_transaction_payment_or d,
  25. tempbusnature e
  26. where a.owner_id = b.owner_id and a.owner_id = c.owner_id and b.owner_id = d.trans_id
  27. and b.business_id = e.business_id limit 8") or die(mysql_error());
  28. $number_of_rows = mysql_numrows($result);
  29. while ($resulta=mysql_fetch_row($result))
  30. {
  31. $row1 = $resulta[0];
  32. $row2 = $resulta[1];
  33. $row3 = $resulta[2];
  34. $row4 = $resulta[3];
  35. $row5 = $resulta[4];
  36. $row6 = number_format($resulta[5],',','.','.');
  37. $row7 = number_format($resulta[6],',','.','.');
  38. $row8 = $resulta[7];
  39. $row9 = $resulta[8];
  40. $row10 = substr($resulta[9],0,10);
  41. $row11 = $resulta[10];
  42. $column_code1 = $column_code1.$row1."\n";
  43. $column_code2 = $column_code2.$row2."\n";
  44. $column_code3 = $column_code3.$row3."\n";
  45. $column_code4 = $column_code4.$row4."\n";
  46. $column_code5 = $column_code5.$row5."\n";
  47. $column_code6 = $column_code6.$row6."\n";
  48. $column_code7 = $column_code7.$row7."\n";
  49. $column_code8 = $column_code8.$row8."\n";
  50. $column_code9 = $column_code9.$row9."\n";
  51. $column_code10 = $column_code10.$row10."\n";
  52. $column_code11 = $column_code11.$row11."\n";
  53. }
  54. $pdf->SetLineWidth(2);
  55. $pdf->Line(0,45,360,45);
  56. $pdf->SetLineWidth(0);
  57. $pdf->Cell(270,5,'',0,1,'C');
  58. $pdf->Cell(270,5,'',0,1,'C');
  59. $Y_Label_position = 50;
  60. $Y_Table_Position = 55;
  61. $pdf->SetFont('Arial','B',6);
  62. $pdf->SetY($Y_Label_position);
  63. $pdf->SetX(5);
  64. $pdf->Cell(35,5,'NAME OF BUSINESS',1,0,'C');
  65. $pdf->SetX(40);
  66. $pdf->Cell(20,5,'PERMIT NUMBER',1,0,'C');
  67. $pdf->SetX(60);
  68. $pdf->Cell(60,5,'NAME OF OWNER',1,0,'C');
  69. $pdf->SetX(120);
  70. $pdf->Cell(30,5,'BUSINESS NATURE',1,0,'C');
  71. $pdf->SetX(150);
  72. $pdf->Cell(60,5,'BUSINESS ADDRESS',1,0,'C');
  73. $pdf->SetX(210);
  74. $pdf->Cell(20,5,'1ST QUARTER',1,0,'C');
  75. $pdf->SetX(230);
  76. $pdf->Cell(15,5,'OR NUMBER',1,0,'C');
  77. $pdf->SetX(245);
  78. $pdf->Cell(20,5,'2ND QUARTER',1,0,'C');
  79. $pdf->SetX(265);
  80. $pdf->Cell(15,5,'OR NUMBER',1,0,'C');
  81. $pdf->SetX(280);
  82. $pdf->Cell(20,5,'3RD QUARTER',1,0,'C');
  83. $pdf->SetX(300);
  84. $pdf->Cell(15,5,'OR NUMBER',1,0,'C');
  85. $pdf->SetX(315);
  86. $pdf->Cell(20,5,'4TH QUARTER',1,0,'C');
  87. $pdf->SetX(335);
  88. $pdf->Cell(15,5,'OR NUMBER',1,0,'C');
  89. $pdf->SetFont('Arial','',6);
  90. $pdf->SetY($Y_Table_Position);
  91. $pdf->SetX(5);
  92. $pdf->MultiCell(35,5,$column_code1,1);
  93. $pdf->SetY($Y_Table_Position);
  94. $pdf->SetX(40);
  95. $pdf->MultiCell(20,5,$column_code2,1);
  96. $pdf->SetY($Y_Table_Position);
  97. $pdf->SetX(60);
  98. $pdf->MultiCell(60,5,$column_code3,1);
  99. $pdf->SetY($Y_Table_Position);
  100. $pdf->SetX(120);
  101. $pdf->MultiCell(30,5,$column_code4,1);
  102. $pdf->SetY($Y_Table_Position);
  103. $pdf->SetX(150);
  104. $pdf->MultiCell(60,5,$column_code5,1);
  105. $pdf->SetY($Y_Table_Position);
  106. $pdf->SetX(210);
  107. $pdf->MultiCell(20,5,$column_code6,1,'R');
  108. $pdf->SetY($Y_Table_Position);
  109. $pdf->SetX(230);
  110. $pdf->MultiCell(15,5,$column_code7,1,'R');
  111. $pdf->SetY($Y_Table_Position);
  112. $pdf->SetX(245);
  113. $pdf->MultiCell(20,5,$column_code8,1);
  114. $pdf->SetY($Y_Table_Position);
  115. $pdf->SetX(265);
  116. $pdf->MultiCell(15,5,$column_code9,1);
  117. $pdf->SetY($Y_Table_Position);
  118. $pdf->SetX(280);
  119. $pdf->MultiCell(20,5,$column_code10,1);
  120. $pdf->SetY($Y_Table_Position);
  121. $pdf->SetX(300);
  122. $pdf->MultiCell(15,5,$column_code11,1);
  123. $pdf->SetY($Y_Table_Position);
  124. $pdf->SetX(315);
  125. $pdf->MultiCell(20,5,$column_code11,1);
  126. $pdf->SetY($Y_Table_Position);
  127. $pdf->SetX(335);
  128. $pdf->MultiCell(15,5,$column_code11,1);
  129. $i = 1;
  130. $pdf->SetY($Y_Table_Position);
  131. while ($i < $number_of_rows)
  132. {
  133. $pdf->SetX(5);
  134. $pdf->MultiCell(345,5,'',1);
  135. $i = $i +1;
  136. }
  137. // $result=mysql_query("select gs_name, gs_pos, gs_office from global_sign where sign_id =1") or die(mysql_error());
  138. // $resulta=mysql_fetch_row($result);
  139. //$Y_Table_Position = $Y_Table_Position + 20;
  140. //$pdf->SetY($Y_Table_Position);
  141. $pdf->SetX(5);
  142. $pdf->SetFont('Arial','B',10);
  143. $pdf->Cell(172,5,'Inspected By:',1,0,'L');
  144. $pdf->Cell(172,5,'Noted By:',1,1,'L');
  145. $pdf->Cell(350,5,'',0,2,'C');
  146. $pdf->Cell(350,5,'',0,2,'C');
  147. //$pdf->SetFont('Arial','BU',10);
  148. //$pdf->SetX(5);
  149. //$pdf->Cell(172,5,$resulta[0],1,0,'C');
  150. //$pdf->Cell(172,5,$resulta[3],1,1,'C');
  151. //$pdf->SetFont('Arial','B',10);
  152. //$pdf->SetX(5);
  153. //$pdf->Cell(172,5,$resulta[4],1,0,'C');
  154. //$pdf->Cell(172,5,$resulta[7],1,1,'C');
  155. $report_desc='Professional Tax';
  156. include 'report_signatories_footer1.php';
  157. $pdf->Output();
  158. ?>
  159. <?php /*
  160. require_once("lib/ebpls.lib.php");
  161. require_once("lib/ebpls.utils.php");
  162. require_once("ebpls-php-lib/utils/ebpls.search.funcs.php");
  163. //require_once("includes/eBPLS_header.php");
  164. //--- get connection from DB
  165. $dbLink = get_db_connection();
  166. ?>
  167. <?php
  168. echo date("F dS Y h:i:s A");
  169. ?>
  170. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  171. <html>
  172. <head>
  173. <meta http-equiv="Content-Type"
  174. content="text/html; charset=iso-8859-1">
  175. <title>BUSINESS FEE COLLECTION</title>
  176. <meta name="Author" content=" Pagoda, Ltd. ">
  177. <link href="includes/eBPLS.css" rel="stylesheet" type="text/css">
  178. <script language="JavaScript" src="includes/eBPLS.js"></script>
  179. </head>
  180. <body>
  181. <?php
  182. $result=mysql_query("select lgumunicipality, lguprovince, lguoffice from ebpls_buss_preference") or die(mysql_error());
  183. $resulta=mysql_fetch_row($result);
  184. ?>
  185. <h4 align="center"> Republic of the Philippines </h4>
  186. <h4 align="center"> <?php echo $resulta[1]; ?> </h4>
  187. <h4 align="center"> <?php echo $resulta[0]; ?> </h4>
  188. <h4 align="center"> <?php echo $resulta[2]; ?> </h4>
  189. <h4 align="center"><u> BUSINESS FEE COLLECTION </u></h4>
  190. <hr>
  191. <?php
  192. /*
  193. $result=mysql_query("select '0000', '0.00', '0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00' from ebpls_business_enterprise")
  194. or die(mysql_error());
  195. while ($resulta=mysql_fetch_row($result)){
  196. */
  197. /* This is the correct SQL
  198. $result=mysql_query("select a.business_permit_code, a.application_date, b.business_name, b.business_street, a.transaction,
  199. concat(c.owner_first_name, ' ', c.owner_middle_name, ' ', c.owner_last_name), c.owner_gender,
  200. concat(c.owner_street, ' ', c.owner_city_code, ' ', owner_province_code), a.business_permit_id
  201. from ebpls_business_enterprise_permit a, ebpls_business_enterprise b, ebpls_owner c
  202. where a.business_permit_code = '$permit_number' and a.owner_id = b.owner_id and a.owner_id = c.owner_id") or die(mysql_error());
  203. $resulta=mysql_fetch_row($result);
  204. //just for testing
  205. $result=mysql_query("select a.business_permit_code, a.application_date, b.business_name, b.business_street, a.transaction,
  206. concat(c.owner_first_name, ' ', c.owner_middle_name, ' ', c.owner_last_name), c.owner_gender,
  207. concat(c.owner_street, ' ', c.owner_city_code, ' ', owner_province_code), a.business_permit_id,
  208. b.business_tin_reg_no, b.business_dti_reg_no, b.business_type_code
  209. from ebpls_business_enterprise_permit a, ebpls_business_enterprise b, ebpls_owner c
  210. where a.business_permit_id = '$permit_number' and a.owner_id = b.owner_id and a.owner_id = c.owner_id") or die(mysql_error());
  211. $resulta=mysql_fetch_row($result);
  212. ?>
  213. <table border="0" cellpadding="1" cellspacing="1" width="1000">
  214. <tbody>
  215. <tr>
  216. <td width="150"><b> Name of Tax Payer: </b></td>
  217. <td> <b><?php echo $resulta[5]; ?> </td>
  218. <td align="right" width="500"><b> D.T.I. </b></td>
  219. <td align="right"> <b><?php echo $resulta[10]; ?> </td>
  220. </tr>
  221. <tr>
  222. <td width="150"><b> Business Name: </b></td>
  223. <td> <b><?php echo $resulta[2]; ?> </td>
  224. <td align="right" width="500"><b> TIN </b></td>
  225. <td align="right"> <b><?php echo $resulta[9]; ?> </td>
  226. </tr>
  227. <tr>
  228. <td width="150"><b> Address of Business: </b></td>
  229. <td> <b><?php echo $resulta[3]; ?> </td>
  230. <td align="right" width="500"><b> Type of Business: </b></td>
  231. <td align="right"> <b><?php echo $resulta[11]; ?> </td>
  232. </tr>
  233. </tbody>
  234. </table>
  235. <table border="1" cellpadding="1" cellspacing="1" width="1000">
  236. <tbody>
  237. <tr>
  238. <td align="center"><b> Year </b></td>
  239. <td align="center"><b> Annual Gross Income </b></td>
  240. <td align="center"><b> Daily Gross Sales </b></td>
  241. <td align="center"><b> Business Tax </b></td>
  242. <td align="center"><b> Mayor's Permit </b></td>
  243. <td align="center"><b> SAN </b></td>
  244. <td align="center"><b> GAR </b></td>
  245. <td align="center"><b> Business Plate </b></td>
  246. <td align="center"><b> FIRE </b></td>
  247. <td align="center"><b> F/S </b></td>
  248. <td align="center"><b> O.R. No. 1st Qtr. </b></td>
  249. <td align="center"><b> Balance for 2nd Qtr. </b></td>
  250. <td align="center"><b> Balance for 3rd Qtr. </b></td>
  251. <td align="center"><b> Balance for 4th Qtr. </b></td>
  252. </tr>
  253. </tbody>
  254. </table>
  255. <br>
  256. <br>
  257. <br>
  258. <br>
  259. <?php
  260. $result=mysql_query("select sign1, sign2, sign3, sign4, pos1, pos2, pos3, pos4
  261. from permit_templates") or die(mysql_error());
  262. $resulta=mysql_fetch_row($result);
  263. ?>
  264. <table style="width: 1000px" border="0" cellpadding="1" cellspacing="1">
  265. <tbody>
  266. <tr>
  267. <td align="left", width="500"><b> Inspected By: <br> <br> <br> <br> <br> </b></td>
  268. <td align="left", width="500"><b> Noted By: <br> <br> <br> <br> <br> </b></td>
  269. </tr>
  270. <tr>
  271. <td align="center"><u><b> <?php echo $resulta[0]; ?> </u> </b> </td>
  272. <td align="center"> <u><b> <?php echo $resulta[2]; ?> </u> </b> </td>
  273. </tr>
  274. <tr>
  275. <td align="center"> <?php echo $resulta[4]; ?> <br> <br> <br> <br> <br> <br> <br> <br> </td>
  276. <td align="center"> <?php echo $resulta[6]; ?> <br> <br> <br> <br> <br> <br> <br> <br> </td>
  277. </tr>
  278. <tr>
  279. <td align="left", width="500"><b> Approved By: <br> <br> <br> <br> <br> </b></td>
  280. </tr>
  281. <tr>
  282. <td align="center"><b><u> <?php echo $resulta[3]; ?> </b></u> <br> <?php echo $resulta[7]; ?> <br> <br> <br> <br> <br> </td>
  283. </tr>
  284. <tr>
  285. <td align="left"> Date printed: &nbsp; &nbsp; <?php echo date("F d Y"); ?> </td>
  286. </tbody>
  287. </table>
  288. <br>
  289. <br>
  290. <?php
  291. require_once("includes/eBPLS_footer.php");
  292. */
  293. ?>
  294. </body>
  295. </html>