0byt3m1n1
Path:
/
home
/
k
/
a
/
s
/
kassiope
/
www
/
administrer
/
[
Home
]
File: all_factures.php
<?php ini_set('display_errors',0); require_once dirname(__FILE__).'/../vendor/autoload.php'; use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Exception\Html2PdfException; use Spipu\Html2Pdf\Exception\ExceptionFormatter; include(__DIR__."/../configuration.inc.php"); /* Charge les détails d'une commande et les affiche */ $order = "a_timestamp"; $sort = "DESC"; $sql = "SELECT * FROM gaia_commandes WHERE numero >0 ORDER BY $order $sort, numero desc"; if ($_GET['id'] != "") { $sql = "SELECT * FROM gaia_commandes WHERE id = '".$_GET['id']."' and numero >0 ORDER BY $order $sort, numero desc"; } if ($_GET['email'] != "") { $sql = "SELECT * FROM gaia_commandes WHERE email like('%".$_GET['email']."%') and numero >0 ORDER BY $order $sort, numero desc"; } if ($_GET['datedeb'] != "" && $_GET['datefin'] != "") { $ddeb = explode('/',$_GET['datedeb']); $datedeb = $ddeb[2].'-'.$ddeb[1].'-'.$ddeb[0]; $dfin = explode('/',$_GET['datefin']); $datefin = $dfin[2].'-'.$dfin[1].'-'.$dfin[0]; $sql = "SELECT * FROM gaia_commandes WHERE a_timestamp between '".$datedeb."' and '".$datefin."' and numero >0 ORDER BY $order $sort, numero desc"; } //$sql .= " limit 0,2 "; $qida = mysql_query_override($sql); $content = ''; try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); $html2pdf->setDefaultFont('Arial'); while ($rf = mysql_fetch_array_override($qida)) { $_GET['timestamp'] = urlencode(($rf['o_timestamp'])); $_GET['id'] = intval($rf['id']); $_GET['mode'] = 'facture'; ob_start(); include dirname(__FILE__).'/../factures/facture_pdf_modele.php'; $content = ob_get_clean(); $html2pdf->writeHTML($content); ob_end_clean(); } $html2pdf->Output(__DIR__.'/factures.pdf'); } catch(HTML2PDF_exception $e) { echo $e; exit; }