31 lines
844 B
PHP
31 lines
844 B
PHP
<?php
|
|
|
|
// ##############################################################
|
|
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
|
|
|
$main_class = 'printCenterPDF';
|
|
|
|
class printCenterPDF
|
|
{
|
|
public function run()
|
|
{
|
|
$id = getVal('ID');
|
|
$set = getVal('set');
|
|
$IDs = getVal('orders');
|
|
|
|
$pdf = ServiceContainer::getService(\KupShop\OrderingBundle\Util\Invoice\PdfGenerator::class);
|
|
$pdf->setPdfTimeout(120);
|
|
if (!empty($id) && $set == 'invoice') {
|
|
return $pdf->printInvoicePDFContent($id);
|
|
} elseif (!empty($IDs) && is_array($IDs) && $set == 'multiplePDF') {
|
|
return $pdf->printMultipleInvoicePDFContent($IDs);
|
|
}
|
|
|
|
if (!empty($_SERVER['HTTP_REFERER'])) {
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
redirect('/admin/');
|
|
}
|
|
}
|