out = mysql_fetch_arraymysql_querySELECT FROM customer where id_customer =id;
output=out[id_customer]. - .out[nama_customer];
Batas file sampe sini html = ob_get_contents; Proses untuk mengambil hasil dari OB..
ob_end_clean; stylesheet = file_get_contents..cssbootstrap.min.css;
Here convert the encode for UTF-8, if you prefer the ISO-8859-1 just change for mpdf- WriteHTMLhtml;
mpdf-WriteHTMLstylesheet,1; mpdf-WriteHTMLutf8_encodehtml;
mpdf-Outputoutput..pdf ,I; exit;
?
4.3.22. Halaman Cetak Laporan Berdasarkan Penjualan Per Sales
Gambar 4. 22 Halaman Cetak Laporan Berdasarkan Penjualan Per Sales
Berikut script dan perintah query yang digunakan untuk cetak laporan berdasarkan penjualan per sales :
?php session_start;
if empty_SESSION[id_petugas] || _SESSION[devisi] = Penjualan { echo scriptwindow.alertAnda belum login. Silahkan melakukan login terlebih dahulu.;
window.location=..index.phpscript; }
include..koneksikoneksi.php; sales = _POST[idsales];
nama_dokumen=sales; Beri nama file PDF hasil. define_MPDF_PATH,MPDF; sesuaikan dengan root folder anda
include_MPDF_PATH . mpdf.php; includekan ke file mpdf mpdf=new mPDFutf-8, A4,timeroman, 15, 15, 10, 15, 1, 1, ; Create new mPDF
Document mpdf-SetFontTimes,,11;
Beginning Buffer to save PHP variables and HTML tags ob_start;
? head
meta http-equiv=Content-Type content=texthtml; charset=iso-8859-1 titleCetak Laporantitle
head body
table width=100 border=0 tr
td width=40 div align=left
img src=imagelogo2.png
alt=a width=293 height=78
div td
td width=47 div align=center
h2PT. Armada International Motorh2 h3Isuzu Armada Mobil Magelangh3
h4Jl. Soekarno Hatta Magelangh4 div
table p align=center
p align=center p align=center
p align=center p align=center
strongLAPORANstrongbr strongPENJUALAN
PER SALESstrongstrongstrongbr
p align=center
pp ?php query= mysql_fetch_arraymysql_querySELECT FROM sales
where id_sales=sales; ? table border=0 cellspacing=0 cellpadding=0 width=567
tr td width=147pID Salesptd
td width=21pstrong:strongptd td
width=398p?php echo
query[id_sales]?ptd tr
tr td width=147pNama Salesptd
td width=21pstrong:strongptd td
width=398p?php echo
query[nama_sales]?ptd tr
table pnbsp;p
table width=100 border=1 tr
tddiv align=centerNo.divtd tddiv align=centerID Mobil divtd
tddiv align=centerTanggal Penjualan divtd tddiv align=centerNo. Plat Mobil divtd
tddiv align=centerNama Varian Mobil divtd tddiv align=centerNama Customer divtd
tr
?php no=0;
query2=mysql_querySELECT FROM customer c, mobil m, varian_mobil v, sales s WHERE s.id_sales = sales AND s.id_sales = m.id_sales AND
m.id_varian = v.id_varian AND c.id_customer = m.id_customer ORDER BY m.id_mobil or diemysql_error;
while r = mysql_fetch_arrayquery2 { no = no + 1;
? tr
td?php echo no ?.td td?php echo r[id_mobil]; ?td
td?php echo r[tgl_jual]; ?td td?php echo r[no_plat]; ?td
td?php echo r[nama_varian]; ?td td?php echo r[nama_customer]; ?td
tr
?php }? table
body html
?php out = mysql_fetch_arraymysql_querySELECT FROM sales where id_sales =idsales;
output=out[id_sales]. - .out[nama_sales];
Batas file sampe sini html = ob_get_contents; Proses untuk mengambil hasil dari OB..
ob_end_clean; stylesheet = file_get_contents..cssbootstrap.min.css;
Here convert the encode for UTF-8, if you prefer the ISO-8859-1 just change for mpdf- WriteHTMLhtml;
mpdf-WriteHTMLstylesheet,1; mpdf-WriteHTMLutf8_encodehtml;
mpdf-Outputoutput..pdf ,I; exit;
?
4.3.23. Halaman Cetak Laporan Berdasarkan Penjualan Per Varian Mobil