Pisah server penyimpanan dan update payment gateway
This commit is contained in:
@@ -287,6 +287,8 @@ if (isset($_POST['ganerate'])) {
|
||||
$lainnya = '0';
|
||||
$totalAmount = number_format($invi['total_list']);
|
||||
$terbilang = terbilang($invi['total_list']).' rupiah';
|
||||
|
||||
$filename = 'INV-'.$customerName.'-' . $invoiceNumber . '.pdf';
|
||||
|
||||
// Membuat instance PDF
|
||||
require ("invoice/generate_invoice.php");
|
||||
@@ -305,9 +307,18 @@ if (isset($_POST['ganerate'])) {
|
||||
// Menambahkan pembuat ke PDF
|
||||
$pdf->Pembuat($Pembuat);
|
||||
// Output PDF ke browser
|
||||
$pdf->Output('F', 'invoice/inv_contoh/INV-'.$customerName.'-' . $invoiceNumber . '.pdf');
|
||||
// $pdf->Output('F', 'invoice/inv_contoh/INV-'.$customerName.'-' . $invoiceNumber . '.pdf');
|
||||
|
||||
// Upload ke minio storage
|
||||
require 'controller/uploadMinioFiles.php';
|
||||
$pdfData = $pdf->Output('S');
|
||||
$objectPath = 'invoice_pdf/' . $filename;
|
||||
$uploadResult = uploadToMinioStorageRaw($pdfData, $objectPath);
|
||||
|
||||
$fileOpen = 'https://storage.manjapro.net/files/' . $objectPath;
|
||||
|
||||
echo '<script type="text/javascript">window.open("invoice/inv_contoh/INV-'.$customerName.'-' . $invoiceNumber . '.pdf", "_blank")</script>';
|
||||
// echo '<script type="text/javascript">window.open("invoice/inv_contoh/INV-'.$customerName.'-' . $invoiceNumber . '.pdf", "_blank")</script>';
|
||||
echo '<script type="text/javascript">window.open("'. $fileOpen . '", "_blank")</script>';
|
||||
// // sweetAlert("Data berhasil di simpan", "success");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user