Advertisement
cdsatrian

query 1

Jul 3rd, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. <td bgcolor="#6699ff">JUMLAH</td>
  2. <?php
  3. $sql= <<<QUERY
  4. SELECT
  5.   (
  6.     h_pns.j_panitia+h_pns.j_pengelola+h_nonpns.j_pegawai+h_nonpns.j_pengelola
  7.     +b_pns.jt
  8.     +bbph.j_batk+bbph.j_bale+bbph.j_bpm+bbph.j_bpk+bbph.j_bbb+bbph.j_bbu+bbph.j_bpc+bbph.j_bkk
  9.     +bbm.j_bbpp+bbm.j_bboo+bbm.j_bbk+bbm.j_bbd+bbm.j_bbpb+bbm.j_bpd+bbm.j_bbpk
  10.     +bjk.j_bt+bjk.j_ba+bjk.j_bl+bjk.j_bs+bjk.j_bk+bjk.j_bjm+bjk.j_bjt+bjk.j_bjp
  11.     +bpkb.j_bjs+bpkb.j_bbb
  12.     +bcp.j_bc+bcp.j_bp
  13.     +bssm.j_bd+bssm.j_ba
  14.     +bmm.j_hp+bmm.j_r+bmm.j_t+bmm.j_k
  15.     +bpk.j_p+bpk.j_l
  16.     +bpkht.j_d+bpkht.j_p
  17.     +bpd.j_d+bpd.j_l
  18.     +bp.j_gk+bp.j_pp+bp.j_kj+bp.j_pp+bp.j_al+bp.j_ab+bp.j_aas+bp.j_tp+bp.j_ak+bp.j_as
  19.     +modperlkan.j_tik+modperlkan.j_gen+modperlkan.j_ol
  20.     +tbmodperkan.j_al+tbmodperkan.j_bra+tbmodperkan.j_fil+tbmodperkan.j_ac
  21.   ) As jumlah
  22. FROM
  23.   akun
  24.   JOIN h_pns ON h_pns.id_s=akun.id
  25.   JOIN h_nonpns ON h_nonpns.id_s=akun.id
  26.   JOIN b_pns ON b_pns.id_s=akun.id
  27.   JOIN bbph ON bbph.id_s=akun.id
  28.   JOIN bbm ON bbm.id_s=akun.id
  29.   JOIN bjk ON bjk.id_s=akun.id
  30.   JOIN bpkb ON bpkb.id_s=akun.id
  31.   JOIN bcp ON bcp.id_s=akun.id
  32.   JOIN bssm ON bssm.id_s=akun.id
  33.   JOIN bmm ON bmm.id_s=akun.id
  34.   JOIN bpk ON bpk.id_s=akun.id
  35.   JOIN bpkht ON bpkht.id_s=akun.id
  36.   JOIN bpd ON bpd.id_s=akun.id
  37.   JOIN bp ON bp.id_s=akun.id
  38.   JOIN modperlkan ON modperlkan.id_s=akun.id
  39.   JOIN tbmodperkan ON tbmodperkan.id_s=akun.id
  40. WHERE
  41.   akun.kat='TK'
  42. ORDER BY akun.id ASC
  43. QUERY;
  44.  
  45. $s1=mysql_query($sql);
  46. while($r1=mysql_fetch_array($s1))
  47. {
  48. echo "<td bgcolor='#6699ff'>Rp.{$r1['jumlah']}</td>";
  49. }
  50. ?>
  51. </tr>
  52. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement