| ini scriptnya teman teman : <?php require('/fpdf/fpdf.php'); $start=0; $xpdf=new FPDF(); $xpdf->AddPage(); $xpdf->SetFont('Arial','B',16); $xpdf->SetFillColor(55,174,200); $host = "localhost"; $user = "root"; $pass = ""; $db = "posko_lebaran"; $koneksi = mysql_connect($host,$user,$pass) or die("Koneksi error : ".mysql_error()); mysql_select_db($db,$koneksi) or die ("Database tidak ditemukan : ".mysql_error());
$xpdf->text(10,30,'BELAJAR PROGRAM MENCETAK DI PHP','center'); $xpdf->text(10,36,'SAYA INI MASIH BELAJAR PHP'); $row=40; $yi = 40; $ya = 70; $xpdf->setFont('Arial','',9); $xpdf->setFillColor(222,222,222); $xpdf->setXY(2,$ya); $xpdf->CELL(22,6,'FLIGTH NO',1,0,'C',1); $xpdf->CELL(20,6,'FIS NO',1,0,'C',1); $xpdf->CELL(18,6,'NO REG',1,0,'C',1); $xpdf->CELL(15,6,'TYPE',1,0,'C',1); $xpdf->CELL(15,6,'LEG',1,0,'C',1); $xpdf->CELL(15,6,'STATUS',1,0,'C',1); $xpdf->CELL(18,6,'TERMINAL',1,0,'C',1); $xpdf->CELL(18,6,'TANGGAL',1,0,'C',1); $xpdf->CELL(15,6,'ACTUAL',1,0,'C',1); $xpdf->CELL(22,6,'DESTINATION',1,0,'C',1); $xpdf->CELL(15,6,'PAX',1,0,'C',1); $ya = $yi + $row;
$sql = mysql_query("select *from db_ats order by fis_number") or die(mysql_error()); $i = 1; $no = 1; $max = 31; $row = 6; while($data = mysql_fetch_array($sql)){
$xpdf->setXY(2,$ya); $xpdf->setFont('arial','',9); $xpdf->setFillColor(255,255,255); $xpdf->cell(22,6,$data['fligth_number'],1,0,'L',1); $xpdf->cell(20,6,$data['fis_number'],1,0,'L',1); $xpdf->CELL(18,6,$data['no_reg'],1,0,'C',1); $xpdf->CELL(15,6,$data['type'],1,0,'C',1); $xpdf->CELL(15,6,$data['leg'],1,0,'C',1); $xpdf->CELL(15,6,$data['status'],1,0,'C',1); $xpdf->CELL(18,6,$data['terminal'],1,0,'C',1); $xpdf->CELL(18,6,$data['tanggal'],1,0,'C',1); $xpdf->CELL(15,6,$data['actual'],1,0,'C',1); $xpdf->CELL(22,6,$data['destination'],1,0,'C',1); $xpdf->CELL(15,6,$data['pax'],1,0,'C',1); $ya = $ya+$row; $no++; $i++;
} $xpdf->text(100,$ya+6,"TANGERANG , "); $xpdf->text(100,$ya+18,"ANGKASA PURA 2 ");
$xpdf->output();
?> |
Tidak ada komentar:
Posting Komentar