cetak_resume_kontrak.php - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of cetak_resume_kontrak.php.php
- <?php error_reporting(0);
- include "../tms_config/tms_koneksi.php";
- include "../library/indotgl.php";
- define('FPDF_FONTPATH','../fpdf16/font/');
- require('../fpdf16/fpdf.php');
- $pdf=new FPDF('P','mm','A4');
- $pdf->Open();
- $pdf->SetAutoPageBreak(false);
- $pdf->SetFont('Arial','',11);
- $pdf->AddPage();
- $pdf->image('../images/Logo_ccm.png',10,10,55,10);
- $co = mysqli_query($connect, "SELECT a.*, b.nm_roomusage FROM list_kontrak a left join t_roomusage b on a.kd_roomusage=b.kd_roomusage WHERE a.nokontrak='$_GET[nokontrak]'");
- $x = mysqli_fetch_array($co);
- $konfirmasi = tgl_indo($x['tgl_konfirmasi']);
- $start = tgl_indo($x['start_rent']);
- $end = tgl_indo($x['end_rent']);
- $te = mysqli_query($connect, "SELECT a.*, b.nmstatus FROM tenant a left join t_status b on a.kdstatus=b.kdstatus WHERE a.idtenant='$_GET[idtenant]'");
- $y = mysqli_fetch_array($te);
- $c1 = substr($x['nokontrak'],0,2);
- $c2 = substr($x['nokontrak'],2,2);
- $c3 = substr($x['nokontrak'],4,2);
- $c4 = substr($x['nokontrak'],6,4);
- $tipe1 = mysqli_query($connect, "SELECT a.type_bisnis, b.uraian FROM list_kontrak a left join t_type_bisnis b on a.type_bisnis=b.type_bisnis WHERE a.nokontrak='$_GET[nokontrak]' and deskripsi='room1'");
- $tipe2 = mysqli_query($connect, "SELECT a.type_bisnis, b.uraian FROM list_kontrak a left join t_type_bisnis b on a.type_bisnis=b.type_bisnis WHERE a.nokontrak='$_GET[nokontrak]' and deskripsi='room2'");
- $tipe3 = mysqli_query($connect, "SELECT a.type_bisnis, b.uraian FROM list_kontrak a left join t_type_bisnis b on a.type_bisnis=b.type_bisnis WHERE a.nokontrak='$_GET[nokontrak]' and deskripsi='room3'");
- $data1= mysqli_fetch_array($tipe1);
- $data2= mysqli_fetch_array($tipe2);
- $data3= mysqli_fetch_array($tipe3);
- $t1 = $data1['uraian'];
- $t2 = $data2['uraian'];
- $t3 = $data3['uraian'];
- if ($t2=='') {
- $kalimat = $t1;
- } else if ($t3=='') {
- $kalimat = $t1.', '.$t2;
- } else {
- $kalimat = $t1.', '.$t2.', '.$t3;
- }
- // header
- $pdf->SetY(20);
- $pdf->SetX(10);
- $pdf->SetFont('Arial','',11);
- $pdf->Cell(190,5,'CONTRACT RESUME',0,1,'C');
- $pdf->SetX(86);
- $pdf->Cell(38,1,'','T',1,'L');
- $pdf->SetX(10);
- $pdf->Cell(190,5,'RESUME KONTRAK',0,1,'C');
- $pdf->SetFont('Arial','',10);
- $pdf->SetXY(10,40);
- $pdf->Cell(60,5,'Contract Number',0,1,'L');
- $pdf->SetXY(10,45);
- $pdf->Cell(60,5,'Confirmation Date',0,1,'L');
- $pdf->SetXY(45,40);
- $pdf->Cell(55,5,': '.$c1.'.'.$c2.'.'.$c3.'.'.$c4,0,1,'L');
- $pdf->SetXY(45,45);
- $pdf->Cell(55,5,': '.$konfirmasi,0,1,'L');
- $pdf->SetXY(10,55);
- $pdf->Cell(60,5,'Tenant Name',0,1,'L');
- $pdf->SetXY(10,60);
- $pdf->Cell(60,5,'Contact Person',0,1,'L');
- $pdf->SetXY(10,65);
- $pdf->Cell(60,5,'Guarantee Person',0,1,'L');
- $pdf->SetXY(10,70);
- $pdf->Cell(60,5,'Bussiness Type',0,1,'L');
- $pdf->SetXY(10,75);
- $pdf->Cell(60,5,'Mail Address',0,1,'L');
- $pdf->SetXY(45,55);
- $pdf->Cell(60,5,': '.$y['nmtenant'],0,1,'L');
- $pdf->SetXY(45,60);
- $pdf->Cell(60,5,': '.$y['contact_person'],0,1,'L');
- $pdf->SetXY(45,65);
- $pdf->Cell(60,5,': '.$y['penjamin'],0,1,'L');
- $pdf->SetXY(45,70);
- $pdf->Cell(60,5,': '.$kalimat,0,1,'L');
- $pdf->SetXY(45,75);
- $pdf->Cell(60,5,': '.$y['mail_addres1'],0,1,'L');
- $pdf->SetXY(45,80);
- $pdf->Cell(60,5,' '.$y['mail_addres2'],0,1,'L');
- $pdf->SetXY(10,90);
- $pdf->Cell(60,5,'Duration',0,1,'L');
- $pdf->SetXY(45,90);
- $pdf->Cell(60,5,': '.$start.' - '.$end.' ('.$x['duration'].' Months)',0,1,'L');
- $pdf->SetFillColor(255,255,255);
- $pdf->SetY(100);
- $pdf->SetX(10);
- $pdf->Cell(8,16,'NO',1,0,'C',1);
- $pdf->Cell(22,16,'ROOM ID',1,0,'C',1);
- $pdf->Cell(20,16,'SPACE',1,0,'C',1);
- $pdf->SetY(100);
- $pdf->SetX(60);
- $pdf->Cell(73,6,'R E N T',1,0,'C',1);
- $pdf->Cell(73,6,'SERVICE CHARGE',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(60);
- $pdf->Cell(18,10,'Listed',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(78);
- $pdf->Cell(18,10,'Discount',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(96);
- $pdf->Cell(18,10,'Actual',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(114);
- $pdf->Cell(19,5,'Monthly','LRT',0,'C',1);
- $pdf->SetY(111);
- $pdf->SetX(114);
- $pdf->Cell(19,5,'Rent','LRB',0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(133);
- $pdf->Cell(18,10,'Listed',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(151);
- $pdf->Cell(18,10,'Discount',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(169);
- $pdf->Cell(18,10,'Actual',1,0,'C',1);
- $pdf->SetY(106);
- $pdf->SetX(187);
- $pdf->Cell(19,5,'Monthly','LRT',0,'C',1);
- $pdf->SetY(111);
- $pdf->SetX(187);
- $pdf->Cell(19,5,'Service','LRB',0,'C',1);
- $result = mysqli_query($connect, "SELECT * from list_kontrak
- WHERE nokontrak='$_GET[nokontrak]' order by roomid");
- $pdf->Ln(5.2);
- $no=1;
- $i = 0;
- while($data = mysqli_fetch_array($result)) {
- $sewa = number_format($data['harga_sewa'],2,',','.');
- $sewa_act = number_format($data['actual_sewa'],2,',','.');
- $service = number_format($data['service'],2,',','.');
- $service_act = number_format($data['actual_service'],2,',','.');
- $diskon_sewa = number_format($data['diskon_sewa'],2,',','.');
- $diskon_service = number_format($data['diskon_service'],2,',','.');
- $rent = $data['luas'] * $data['actual_sewa'];
- $rent_des = number_format($rent,2,',','.');
- $serv = $data['luas'] * $data['actual_service'];
- $serv_des = number_format($serv,2,',','.');
- $pdf->SetX(10);
- $pdf->Cell(8,6,$no,'LR',0,'C',1);
- $pdf->Cell(22,6,$data['lantai'].'.'.$data['kdgd'].'.'.$data['urtlantai'],'LR',0,'L',1);
- $pdf->Cell(20,6,$data['luas'].' M2','LR',0,'R',1);
- $pdf->Cell(18,6,$sewa,'LR',0,'R',1);
- $pdf->Cell(18,6,$diskon_sewa,'LR',0,'R',1);
- $pdf->Cell(18,6,$sewa_act,'LR',0,'R',1);
- $pdf->Cell(19,6,$rent_des,'LR',0,'R',1);
- $pdf->Cell(18,6,$service,'LR',0,'R',1);
- $pdf->Cell(18,6,$diskon_service,'LR',0,'R',1);
- $pdf->Cell(18,6,$service_act,'LR',0,'R',1);
- $pdf->Cell(19,6,$serv_des,'LR',0,'R',1);
- $i++; $no++;
- $pdf->Ln();
- } // tutup jika new page
- $jml = mysqli_query($connect, "SELECT nominal_rate, tax_rate, duration, sum(luas) as luas, sum(luas * actual_sewa) as jrent, sum(luas * actual_service) as jserv from list_kontrak WHERE nokontrak='$_GET[nokontrak]' group by nokontrak");
- $z = mysqli_fetch_array($jml);
- $luas = number_format($z['luas'],2,',','.');
- $jrent = number_format($z['jrent'],2,',','.');
- $jserv = number_format($z['jserv'],2,',','.');
- $total_rent = $z['duration'] * $z['jrent'];
- $total_rent_des = number_format($total_rent,2,',','.');
- $total_serv = $z['duration'] * $z['jserv'];
- $total_serv_des = number_format($total_serv,2,',','.');
- $nominal_rate = number_format($z['nominal_rate'],2,',','.');
- $tax_rate = number_format($z['tax_rate'],2,',','.');
- $pdf->SetX(10);
- $pdf->Cell(8,6,'',1,0,'C',1);
- // $pdf->Cell(22,6,'',1,0,'L',1);
- $pdf->Cell(42,6,$luas.' M2',1,0,'R',1);
- $pdf->Cell(18,6,'',1,0,'R',1);
- $pdf->Cell(18,6,'',1,0,'R',1);
- $pdf->Cell(18,6,'USD','LTB',0,'R',1);
- $pdf->Cell(19,6,$jrent,'RTB',0,'R',1);
- $pdf->Cell(18,6,'',1,0,'R',1);
- $pdf->Cell(18,6,'',1,0,'R',1);
- $pdf->Cell(18,6,'USD','LTB',0,'R',1);
- $pdf->Cell(19,6,$jserv,'RTB',0,'R',1);
- $pdf->Ln(12);
- $pdf->SetX(10);
- $pdf->Cell(40,5,'- Total Rent '.$z['duration'].' Month',0,0,'L',1);
- $pdf->Cell(3,5,':',0,0,'L',1);
- $pdf->Cell(30,5,$jrent.' x '.$z['duration'].' =',0,0,'R',1);
- $pdf->Cell(35,5,$total_rent_des.' USD',0,0,'R',1);
- $pdf->Ln();
- $pdf->SetX(10);
- $pdf->Cell(40,5,'- Total Service Charge',0,0,'L',1);
- $pdf->Cell(3,5,':',0,0,'L',1);
- $pdf->Cell(30,5,$jserv.' x '.$z['duration'].' =',0,0,'R',1);
- $pdf->Cell(35,5,$total_serv_des.' USD',0,0,'R',1);
- $pdf->Ln(8);
- $pdf->SetX(10);
- $pdf->Cell(40,5,'- Nominal Rate',0,0,'L',1);
- $pdf->Cell(3,5,':',0,0,'L',1);
- $pdf->Cell(30,5,$nominal_rate,0,0,'R',1);
- $pdf->Ln();
- $pdf->SetX(10);
- $pdf->Cell(40,5,'- Tax Rate',0,0,'L',1);
- $pdf->Cell(3,5,':',0,0,'L',1);
- $pdf->Cell(30,5,$tax_rate,0,0,'R',1);
- $awal = mysqli_query($connect, "SELECT jadwal_pembayaran from jadwal_pembayaran_service WHERE nokontrak='$_GET[nokontrak]' and ke='01'");
- $xx = mysqli_fetch_array($awal);
- $setar = tgl_indo($xx['jadwal_pembayaran']);
- $pdf->Ln(8);
- $pdf->Cell(190,5,'- Service Charge will be paid on Monthly Basis Starting on : '.$setar,0,1,'L');
- $pdf->Ln(12);
- $pdf->SetX(10);
- $pdf->Cell(55,5,'Pihak Pertama',0,0,'C',1);
- $pdf->Cell(70,5,'',0,0,'L',1);
- $pdf->Cell(55,5,'Pihak Kedua',0,0,'C',1);
- $ttd = mysqli_query($connect, "select penandatangan as nama from list_kontrak where nokontrak='$_GET[nokontrak]'");
- $oke = mysqli_fetch_array($ttd);
- $pdf->Ln(20);
- $pdf->SetX(10);
- $pdf->Cell(55,5,'( '.$y['contact_person'].' )',0,0,'C',1);
- $pdf->Cell(70,5,'',0,0,'L',1);
- $pdf->Cell(55,5,'( '.$oke['nama'].' )',0,0,'C',1);
- $pdf->SetY(-20);
- $pdf->Cell(0,5,'Lampiran - 1.1',0,0,'C',1);
- $pdf->Output();
- ?>