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
|
<?php
require('mysql_table.php');
class PDF extends PDF_MySQL_Table
{
function Header()
{
//Titre
$this->SetFont('Arial','',18);
$this->Cell(0,6,'fiche client',0,1,'C');
$this->Ln(10);
//Imprime l'en-tête du tableau si nécessaire
parent::Header();
}
}
//Connexion à la base
include('../inc/inc_connexion.php');
include('../inc/fonction.php');
ob_end_clean();
if(!empty($_GET['numero']))
{
$numero=$_GET['numero'];
$pdf=new PDF();
$pdf->AddPage();
//premier tableau : imprime toutes les colonnes de la requête
$pdf->AddCol('soc_id',14,'soc_id','C');
$pdf->AddCol('soc_societe',50,'soc_societe');
$pdf->AddCol('soc_adherent',50,'soc_adherent','C');
$pdf->AddCol('soc_adressea',30,'soc_adressea','C');
$pdf->AddCol('soc_adresseb',30,'soc_adresseb','C');
$prop=array('HeaderColor'=>array(210,245,255),
'padding'=>2);
$pdf->Table("SELECT soc_id, soc_societe, soc_adherent, soc_adressea, soc_adresseb, soc_postal, soc_ville, soc_region, soc_enseigne, soc_telephone, soc_fax, soc_siret FROM societe where soc_id='$numero'",$prop);
$pdf->ln(4);
//troisieme tableau : définit 1 colonne
$pdf->AddCol('echang_observation',200,'htmlspecialchars_decode(echang_observation)');
$pdf->Table("SELECT echang_id, echang_observation, echang_interlocuteur FROM echange WHERE echang_id='$numero'",$prop);
$pdf->ln(4);
//troisieme tableau : imprime toutes les colonnes de la requête
$pdf->AddCol('fact_facture',14,'fact_facture','C');
$pdf->AddCol('fact_intitule',50,'fact_intitule');
$pdf->AddCol('fact_montant',16,'fact_montant','C');
$pdf->AddCol('fact_date',17,'fact_date','C');
$pdf->AddCol('fact_echeance',17,'fact_echeance','C');
$pdf->Table("SELECT fact_facture, fact_intitule, fact_montant, fact_id, fact_date, fact_echeance, fact_montant, COUNT(DISTINCT rel_facture) AS nb_relances FROM facture, relance
WHERE fact_id='$numero' GROUP BY fact_facture ORDER BY fact_facture",$prop);
$pdf->Output();
}
?> |
Partager