bagaimana cara membuat attachment invoice bookingan

bagaimana cara membuat attachment file/file lampiran invoice bookingan. saya ingin lapiran file seperti ini

pada tutorial yang saya temukan, untuk membuat attachment file penulisannya


$mail->FromName = $name_pengirim;
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAttachment($letak_file, $nama_file);

jadi kalo saya melampirkan invoice bookingan dengan menuliskan


$mail->AddAttachment($admin, $invoice.php);

bagaimana agar query dengan kondisi WHERE email='$email' AND booking.kd_booking='$kd_booking'")terpenuhi.


$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'");

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();
?>

avatar irya
@irya

59 Kontribusi 13 Poin

Dipost 5 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban