1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| <?php
define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/");
define('tFPDF_FONTPATH','font/');
require('tfpdf.php');
require('mysql_table.php');
class PDF extends PDF_MySQL_Table
{
protected $col = 0; // Colonne courante
protected $y0; // Ordonnée du début des colonnes
function Header()
{
// En-tête
global $titre;
}
}
$pdf=new tFPDF('L','cm','A6');
$pdf=new tFPDF();
$pdf->AddPage();
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
$pdf->SetAutoPageBreak(0,10);
$pdf->SetLeftMargin(10);
$pdf->SetRightMargin(10);
$pdf->ln(20);
include("include/variables.inc.php");
$liendb = mysql_connect($bddserver, $bddlogin, $bddpassword);
mysql_select_db ($bdd);
mysql_set_charset( 'utf8' );
$id = $_POST['id'];
$query=("SELECT
IDNPlace,
NumPlace,
Reférence,
Personnes.IDPersonne,
Personnes.Nom_Personne,
Personnes.Prenom_Personne,
Personnes.Paiement,
Personnes.Motet,
Instruments.Instrument,
Concert.IDconcert,
Concert.titreconcert,
Concert.lieu,
DATE_FORMAT ( Concert.dateconcert, '%d/%m/%Y' ) AS datecon,
Zones.IDZone,
Zones.Zone,
Prix.IDPrix,
Prix.Prix,
SUM(Prix.Prix) AS prixbillets,
COUNT(Prix.Prix) AS nbillets
FROM Tab_NumPlace
INNER JOIN Personnes ON Tab_NumPlace.IDPersonne = Personnes.IDPersonne
INNER JOIN Instruments ON Personnes.IDInstruments = Instruments.IDInstruments
INNER JOIN Concert ON Tab_NumPlace.IDconcert = Concert.IDconcert
INNER JOIN Zones ON Tab_NumPlace.IDZone = Zones.IDZone
INNER JOIN Prix ON Zones.IDPrix = Prix.IDPrix
WHERE Concert.IDconcert = '".$_REQUEST['id']."'
GROUP BY IDPersonne, IDPrix
ORDER BY IDPersonne, IDPrix ");
$resultat=mysql_query($query, $liendb);
while($row=mysql_fetch_array($resultat))
{
include('include/var.inc.php');
$pays = ( PHP_OS == "Windows" ) ? 'fra' : 'fr_FR';
setlocale ( LC_TIME, $pays ) ;
$pdf->ln();
$pdf->SetFont('DejaVu','',14);
$pdf->cell(3,4,$cdd,2,0,'L'); //date concert, nom, prix total
$pdf->ln(6);
$pdf->cell(3,4,$baa,2,0,'L'); // nombre de billets à xxx = xxx
$pdf->ln();
}
$pdf->Output();
?> |
Partager