Tolong pilih kategori sesuai, jenis posting (pertanyaan atau bukan) dan sertakan tag/topik yang sesuai misal komputer, php, mysql, dll.
Promosi atau posting tidak pada tempatnya akan kami hapus.
Klik link berikut untuk informasi cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com

Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

help masalah multicell di fpdf

mau nanya gan cara menggunakan multicell di fpdf gimana ya

<?php
include "../../library/conection.php";
include_once "../../library/inc.library.php";
require('../../assets/fpdf181/fpdf.php');


$a = mysql_query("SELECT * from invoice_perawatan b, client c,bank f where b.id_client = c.id_client and b.kode_bank = f.kode_bank and b.no_invoice = '$_GET[id]'");
$b = mysql_fetch_array($a);

$query = "SELECT (@no:=@no+1 ) no, b.keterangan,a.satuan,a.harga_detail,(a.harga_detail) as total FROM (SELECT @no := 0 ) VARIABLE_URUT, contract_perawatan b,invoice_perawatan a where b.id_contract = a.id_contract and a.no_invoice = '$_GET[id]'";

$sql = mysql_query ($query);
$data = array();
while ($row = mysql_fetch_assoc($sql)) {
array_push($data, $row);
}

$header = array(
array("label"=>"No", "length"=>10, "align"=>"C"),
array("label"=>"Keterangan", "length"=>80, "align"=>"C"),
array("label"=>"Quantity", "length"=>30, "align"=>"C"),
array("label"=>"Harga Satuan", "length"=>45, "align"=>"C"),
array("label"=>"Jumlah", "length"=>29, "align"=>"C"),
);



$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','IU',20);
$pdf->Text(95,10,'INVOICE');
$pdf->SetFont('Arial','U',10);
$pdf->Text(10,17,'No. Kwitansi');
$pdf->SetFont('Arial','',10);
$pdf->Text(35,17,':');
$pdf->SetFont('Arial','U',10);
$pdf->Text(37,17,$b['no_invoice']);
$pdf->SetFont('Arial','U',10);
$pdf->Text(10,23,'Sudah teriman dari');
$pdf->SetFont('Arial','',10);
$pdf->Text(43,23,':');
$pdf->SetFont('Arial','U',10);
$pdf->Text(45,23,$b['nama_client']);
$pdf->SetFont('Arial','U',10);
$pdf->Text(10,29,'Untuk Pembayaran');
$pdf->SetFont('Arial','',10);
$pdf->Text(43,29,':');
$pdf->SetFont('Arial','U',10);
$pdf->Text(45,29,$b['deskripsi']);
$pdf->SetFont('Arial','',10);
$pdf->Text(140,10,'NPWP : 02.867.577.5-005.000');
$pdf->SetFont('Arial','B',12);
$pdf->Text(140,17,'CV.');
$pdf->AddFont('Monotype Corsiva','','MTCORSVA.php');
$pdf->SetFont('Monotype Corsiva','',18); ;
$pdf->Text(148,17,'ROSE');
$pdf->AddFont('Verdana','','verdana.php');
$pdf->SetFont('Verdana','',12); ;
$pdf->Text(165,17,'FLORIST ASRI');
$pdf->SetFont('Arial','',10);
$pdf->Text(140,23,'Penyewaan Tanaman Hias');
$pdf->Text(140,29,'Pembuatan Tanaman Hias');
$pdf->Image('../../assets/images/total.png',152.5,73.7);
$pdf->Text(158,80,'Sub Total');
$pdf->Text(181,80,$b['harga_detail']);
$pdf->Text(165,86,'Total');
$pdf->Text(181,86,$b['harga_detail']);
$pdf->Text(165,91,'Jakarta,');
$pdf->Text(180,91,TanggalIndo2($b['tanggal']));
$pdf->SetFont('Arial','U',10);
$pdf->Text(10,80,'Terbilang');
$pdf->Text(30,80,terbilang($b['harga']));
$pdf->SetFont('Arial','',10);
$pdf->Text(10,85,'Says');
$pdf->Text(30,85,'.....................................................................................................');
$pdf->Text(10,93,'Keterangan');
$pdf->Text(30,93,'Pembayaran transfer via');
$pdf->Text(70,93,$b['nama_bank']." cabang");
$pdf->Text(30,97,$b['alamat_bank']." no rekening ".$b['no_rekening']." a.n ".$b['nama_rekening']);
$pdf->Text(10,103,'Perhatian');
$pdf->Text(30,103,'PEMBAYARAN SAH BILA MENCANTUMKAN NO.INV/KONFIRMASI');
$pdf->Text(10,108,'website : www.rosefloristasri.com ---e-mail : suroso: roseflorist@yahoo.com');
$pdf->Text(10,114,'Jl. Manunggal Raya I No. 37 B - Jakarta Timur 13620 Telp. : (021) 86614224 - 24004822');
$pdf->SetFont('Arial','U',10);
$pdf->Text(175,114,'Syifa Chintya');

/*


$pdf->Text(155,50,': '.$b['tgl_request']);*/

#buat header tabel
$pdf->SetFont('Arial','','10');
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetY(35);
$pdf->SetX(10);

foreach ($header as $kolom) {
$pdf->Cell($kolom['length'], 5, $kolom['label'], 1, '0', $kolom['align'], true);
}
$pdf->Ln();

#tampilkan data tabelnya
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0);
$pdf->SetFont('');
$fill=false;

foreach ($data as $baris) {
$i = 0;
foreach ($baris as $cell) {
$pdf->Cell($header[$i]['length'], 5, $cell, 1, '0', $kolom['align'], $fill);
$i++;
}
$fill = !$fill;
$pdf->Ln();
}

$pdf->Output();
?>



Comments

  • foreach ($data as $baris) {
    $i = 0;
    foreach ($baris as $cell) {
    if($i == 1 ){
    $pdf->MultiCell($header[$i]['length'], 5, $cell, 1, '0', $kolom['align'], $fill);
    }
    else{
    $pdf->Cell($header[$i]['length'], 5, $cell, 1, '0', $kolom['align'], $fill);
    }
    $i++;
    }
  • masih berantakan gan




Sign In or Register to comment.