Kamis, 24 Oktober 2013

PHP Indonesia - Facebook: [ask]

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Geek Squad from Best Buy

Get instant online support. We can fix computers, cameras, car technology and more. Talk to us today.
From our sponsors
[ask] ini error kenapa ya ??..
Oct 24th 2013, 14:06, by Hardian Hartato

Hardian Hartato 2:06pm Oct 24
[ask]
ini error kenapa ya ??..

<?php
require_once("config/koneksi.php");
require_once("fpdf/fpdf.php");

$query=mysql_query("SELECT * FROM ms_barang ORDER BY nama_barang");
$data=array();

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

//setting judul laporan dan header tabel
$judul="LAPORAN DATA BARANG";
$header=array(
array("label"=>"Kode","length"=>20,"align"=>"L"),
array("label"=>"Nama Barang","length"=>50,"align"=>"L"),
array("label"=>"Harga","length"=>20,"align"=>"L"),
array("label"=>"Stock","length"=>10,"align"=>"L"),
array("label"=>"Kategori","length"=>30,"align"=>"L")
);

//sertakan library FPDF dan bentuk objek
$pdf=new FPDF();
$pdf->AddPage();

//tampilkan judul laporan
$pdf->SetFont('times','B','16');
$pdf->Cell(0,20,$judul,'0','C');

//buat header tabel
$pdf->SetFont('times','',10);
$pdf->SetFillColor(128,128,128);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(100,100,100);
foreach($header as $kolom)
{
$pdf->Cell($kolom['length'],5,$kolom['label'],1,'0',$kolom['align'],true);
}
$pdf->Ln();

#buat tampilkan data tabelnya
$pdf->SetFillColor(224,235,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();
}
//output file PDF
$pdf->Output();
?>

Anton Wahyu Pramono 2:26pm Oct 24
array

Repb Adhy Musaad 3:12pm Oct 24
coba ngetes ini letakin paling atas
error_reporting("E_ALL");

William Sutanto 3:36pm Oct 24
paling atas kasih

error_reporting(E_ALL^E_NOTICE);

atau baris ke 50 diganti:

$pdf->Cell(@$header[$i]['length'], 5, $cell, 1, '0', $kolom['align'], $fill);

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar