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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
| <?php
require('../fpdf153/fpdf.php');
require('../Connections/ProgFacture.php');
class PDF extends FPDF
{
//En-tête
function Header()
{
//Logo
$this->Image('../../Pictures/Logo.jpg',10,8,110);
//Cellule info PcService
$this->SetFont('Arial','B',8);
$this->SetXY(10,35);
$this->MultiCell(62,40,"",1,1,0,'L');
//texte dans cellule info PcService
$this->SetXY(10,35);
$this->Write(4,"Titre");
$this->SetFont('Arial','',8);
$this->SetXY(10,38);
$this->Write(4,"Nom\nRue , Nr\nCP Ville");
$this->SetFont('Arial','B',8);
$this->SetXY(10,50);
$this->Write(4,"Tel: \nMail:\nWeb: \nCompte: \nTVA: ");
//Cellule Devis
$this->SetFont('Arial','B',8);
$this->SetXY(72,35);
$this->MultiCell(62, 5, "DEVIS", 1, "C", 0);
//Cellule pour accord
$this->SetFont('Arial',"BU",8);
$this->SetXY(72,40);
$this->MultiCell(62, 35, "", 1, "C", 0);
$this->SetFont('Arial',"B",8);
$this->SetXY(72,40);
$this->Write(4,"Signature pour accord:");
$this->SetXY(72,45);
$this->Write(4,".................................................................");
//Cellule info Client
$this->SetFont('Arial','B',10);
$this->SetXY(134,35);
$this->MultiCell(62,20,"",1,1,'t');
//Descendre le corps du texte
$this->Ln(30);
}
//Pied de page
function Footer()
{
//Positionnement à 4 cm du bas
$this->SetY(-25);
$this->SetFont('Arial','B', 6);
$this->Cell(0,10,"Toute commande est effective à la reception d'un accompte de 30%. Le solde est payable à la livraison.",0,0,'C');
$this->Ln(2);
$this->Cell(0,10,'Tous nos Items sont garantis deux ans "Pick and Repair".',0,0,'C');
$this->Ln(2);
$this->Cell(0,10,'Le tribunal de commerce de Ville est seul compétent.',0,0,'C');
$this->Ln(2);
$this->Cell(0,10,'Titre.',0,0,'C');
$this->Ln(3);
$this->SetFont('Arial','I', 6);
$this->Cell(0,10,"*L'usage d'une licence est obligatoire pour tout programme.",0,0,'C');
$this->Ln(2);
$this->Cell(0,10,"**Prix valables sous réserve des stocks disponibles.",0,0,'C');
$this->Ln(3);
//Police Arial italique 8
$this->SetFont('Arial','I',6);
//Numéro de page
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}// Fin class
//Seconde partie de ma page
function page($monPDF)
{
}
//Instanciation de la classe dérivée
$pdf=new PDF('P','cm','A4');
$pdf->AliasNbPages();
$pdf->AddPage();
$mysql_select_db($database_ProgFacture, $ProgFacture);
$query_rsMateriel = "SELECT * FROM materiel WHERE DevisId = 81";
$rsMateriel = mysql_query($query_rsMateriel, $ProgFacture) or die(mysql_error());
$row_rsMateriel = mysql_fetch_assoc($rsMateriel);
$totalRows_rsMateriel = mysql_num_rows($rsMateriel);
$PDF->SetXY(0.5,$PDF->GetY()+0);
$PDF->SetFont('Arial','B',6);
$PDF->SetTextColor(255,255,255);
$PDF->Cell(6,0.5,"Dénomination",1,0,'L',1);
$PDF->Cell(2,0.5,'Pv HTVA',1,0,'L',1);
$PDF->Cell(2,0.5,'Pv TVAC',1,0,'L',1);
$PDF->Cell(2,0.5,'Quantité',1,0,'L',1);
$PDF->Cell(2,0.5,'Pv TTC',1,0,'L',1);
$PDF->Cell(6,0.5,'Remarque',1,0,'L',1);
$PDF->SetFillColor(0xdd,0xdd,0xdd);
$PDF->SetTextColor(0,0,0);
$PDF->SetFont('Arial','',6);
$PDF->SetXY(0.5,$PDF->GetY()+0.5);
$fond=0;
while($row_rsMateriel = mysql_fetch_assoc($rsMateriel))
{
$PDF->cell(6,0.5,$row_rsMateriel['MatDenomination'],1,0,'L',$fond);
$PDF->cell(2,0.5,$row_rsMateriel['MatPvhtva'],1,0,'L',$fond);
$PDF->cell(2,0.5,$row_rsMateriel['MatPvtvac'],1,0,'L',$fond);
$PDF->cell(2,0.5,$row_rsMateriel['MatQuantity'],1,0,'L',$fond);
$PDF->cell(2,0.5,$row_rsMateriel['MatPvttc'],1,0,'L',$fond);
$PDF->cell(6,0.5,$row_rsMateriel['MatRemarque'],1,0,'L',$fond);
$PDF->SetXY(0.5,$PDF->GetY()+0.5);
$fond=!$fond;
}
$PDF->SetFont('Arial','B',6);
$PDF->SetFillColor(96,96,96);
$PDF->SetTextColor(255,255,255);
$PDF->Cell(6,0.5,'TOTAL:',1,0,'L',1);
$PDF->Cell(2,0.5,'',1,0,'L',1);
$PDF->Cell(2,0.5,'',1,0,'L',1);
$PDF->Cell(2,0.5,'',1,0,'L',1);
$PDF->Cell(2,0.5,'',1,0,'L',1);
$PDF->Cell(6,0.5,'',1,0,'L',1);
$pdf->Output();
?>
<?php
mysql_free_result($rsMateriel);
?> |
Partager