Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- 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
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

Bagaimana membuat file lampiran invoice booking an

edited November 2018 in Diskusi Pemrograman & IT
saya ingin melampirkan detail bookingan seperti ini


pada tutorial yang saya baca, untuk melampirkan file itu penulisannya
<?php
$mail->FromName = $name_pengirim;
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAttachment($letak_file, $nama_file);
?>

klo saya menulisakan
<?php
$mail->FromName = $name_pengirim;
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAttachment($admin, $invoice.php);
?>

bagaimana bisa kondisi query saya terpenuhi. saya memiliki query dengan kondisi
<?php
WHERE email='$email' AND booking.kd_booking='$kd_booking'
?>

invoice.php
<?php
include '../config/connection.php';
include '../pdf/fpdf.php';
 
$pdf = new FPDF("P","mm","A4");
 
$pdf->AddPage();
 
$pdf->Image('../logo/pesonadesa.png',5,10,70,25);
$pdf->SetFont('Arial','',8);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,0);
$pdf->Cell(59,5,"Di cetak pada : ".date("D-d/m/Y"),0,1,'L');
$pdf->SetFont('Arial','B',10);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(189,5,'CUSTOMER DETAIL',0,1,'L');
$pdf->SetFont('Arial','B',8);
$pdf->Cell(0.3,5,'',0,0);
 
$kd_booking = isset($_GET['kd_booking']) ? $_GET['kd_booking'] : '';
$email = isset($_GET['email']) ? $_GET['email'] : '';
$sql = mysqli_query($conn,"SELECT user.id_user,user.nama_user,user.email,user.telepon,paket.kd_paket,paket.nama_paket,paket.detail_paket,paket.harga,booking.kd_booking,booking.tgl_wisata,booking.wkt_wisata,booking.jml_org,detail_booking.total_bayar FROM paket INNER JOIN booking ON paket.kd_paket=booking.kd_paket INNER JOIN user ON user.id_user=booking.id_user INNER JOIN detail_booking ON booking.kd_booking=detail_booking.kd_booking WHERE email='$email' AND booking.kd_booking='$kd_booking'");
while ($data = mysqli_fetch_array($sql)) {
 
$pdf->Cell(15,5,'Nama : ',0,0);
$pdf->Cell(90,5,$data['nama_user'],0,1);
$pdf->Cell(0.3,5,'',0,0);
$pdf->Cell(15,5,'Email : ',0,0);
$pdf->Cell(90,5,$data['email'],0,1);
$pdf->Cell(0.3,5,'',0,0);
$pdf->Cell(15,5,'Contact : ',0,0);
$pdf->Cell(90,5,$data['telepon'],0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(189,5,'DETAIL TRANSAKSI',0,1,'L');
$pdf->SetFont('Arial','B',8);
$pdf->Cell(1.3,5,'',0,0);
$pdf->Cell(30.7,5,'Nama Paket',1,0,'L');
$pdf->Cell(30,5,'Tanggal Wisata',1,0,'L');
$pdf->Cell(30,5,'Waktu Acara',1,0,'L');
$pdf->Cell(25,5,'Jumlah Orang',1,0,'L');
$pdf->Cell(18,5,'Harga',1,0,'L');
$pdf->Cell(18,5,'Total',1,1,'L');
$pdf->SetFont('Arial','',8);
$pdf->Cell(1.3,5,'',0,0);
$pdf->Cell(30.7,5,$data['nama_paket'],1,0,'L');
$pdf->Cell(30,5,$data['tgl_wisata'],1,0,'L');
$pdf->Cell(30,5,$data['wkt_wisata'],1,0,'L');
$pdf->Cell(25,5,$data['jml_org'],1,0,'L');
$pdf->Cell(18,5,$data['harga'],1,0,'L');
$pdf->Cell(18,5,$data['total_bayar'],1,0,'L');
}
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(189,5,'NOTE',0,1,'L');
$pdf->SetFont('Arial','B',20);
$pdf->Cell(5,1,'',0,0);
$pdf->Cell(5,1,'.',0,0);
$pdf->SetFont('Arial','',8);
$pdf->Cell(184,4,'Mohon datang min 1 jam sebelum acara dimulai',0,1);
$pdf->SetFont('Arial','',20);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(130,5,'',0,1);
$pdf->Cell(180,5,'------------------------------------------------------------------------------',0,0);
$pdf->Image('../logo/scissors.png',190,126.5,10,10);
 
ob_end_clean();
$pdf->Output();
?>

Tagged:

Comments

  • $admin di bagian attach itu isinya apa ?

    kalo querinya cuman kurang user.email = '$email'
Sign In or Register to comment.