Halaman Tambah Penjualan Mobil Halaman Data Penjualan Mobil Halaman Cetak Laporan Berdasarkan Kepemilikan Mobil

4.3.19. Halaman Tambah Penjualan Mobil

Gambar 4. 19 Halaman Tambah Penjualan Mobil Berikut script dan perintah query yang digunakan untuk menambah penjualan mobil : ?php include dbkoneksi.php; data=mysql_queryselect from tipe_mobil; data1=mysql_queryselect from varian_mobil; kode=_GET[kode]; dt=mysql_queryselect from tipe_mobil where nama_tipe=kode; d=mysql_fetch_arraydt; op=isset_GET[op]?_GET[op]:null; ifop==ambildata{ id = mysql_fetch_arraydata1; idmbl = substrd[id_tipe],0,4; carikode = mysql_queryselect count as jml from varian_mobil where id_mobil like .idmbl. or die mysql_error; datakode = mysql_fetch_arraycarikode; no = datakode[jml] + 1; hasilkode = str_padno, 3, 0, STR_PAD_LEFT; echo d[id_tipe].hasilkode; ambilvarian = mysql_queryselect from varian_mobil where id_tipe = .kode.or diemysql_error; cekdata = mysql_queryselect from varian_mobil where id_tipe = .kode.or diemysql_error; hasilcek = mysql_fetch_arraycekdata; ifhasilcek = { whiledata = mysql_fetch_arrayambilvarian { echo option value=data[nama_varian]data[nama_varian]option; } }else{ echo option varian mobil option; } }elseifop==simpan{ nama=_GET[nama]; nama_tipe=_GET[nama_tipe]; variant=_GET[variant]; dt1=mysql_queryselect from tipe_mobil where nama_tipe=nama_tipe; d1=mysql_fetch_arraydt1; o=mysql_queryselect id_tipe from tipe_mobil where nama_tipe=nama_tipe; tambah=mysql_queryinsert into varian_mobil values nama,variant,.d1[id_tipe]. or diemysql_error; echo o; tambah=mysql_queryinsert into varian_mobil values nama,variant,nama_tipe or diemysql_error; iftambah{ echo sukses; }else{ echo error; } } ?

4.3.20. Halaman Data Penjualan Mobil

Gambar 4. 20 Halaman Data Penjualan Mobil

4.3.21. Halaman Cetak Laporan Berdasarkan Kepemilikan Mobil

Gambar 4. 21 Halaman Cetak Laporan Berdasarkan Kepemilikan Mobil Berikut script dan perintah query yang digunakan untuk cetak laporan berdasarkan kepemilikan mobil : ?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; customer = _POST[idcustomer]; _SESSION[idcustomer] = _POST[idcustomer]; id = _SESSION[idcustomer]; 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 strongKEPEMILIKAN MOBILstrongstrongstrongbr p align=center pp ?php query= mysql_fetch_arraymysql_querySELECT FROM customer where id_customer=customer; ? table border=0 cellspacing=0 cellpadding=0 width=567 tr td width=147pID Customerptd td width=21pstrong:strongptd td width=398p?php echo query[id_customer]?ptd tr tr td width=147pNama Customerptd td width=21pstrong:strongptd td width=398p?php echo query[nama_customer]?ptd tr table pnbsp;p table width=100 border=1 tr tddiv align=centerNo.divtd tddiv align=centerID Mobildivtd tddiv align=centerTanggal Pembeliandivtd tddiv align=centerNo. Plat Mobildivtd tddiv align=centerNama Varian Mobildivtd tddiv align=centerNo. Rangkadivtd tddiv align=centerNo. Mesindivtd tr ?php no=0; query2=mysql_querySELECT FROM customer c, mobil m, varian_mobil v WHERE c.id_customer = customer AND c.id_customer = m.id_customer AND m.id_varian = v.id_varian 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[no_rangka]; ?td td?php echo r[no_mesin]; ?td tr ?php }? table ?php customer = _POST[idcustomer]; 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