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 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
<?php require_once('../Connections/ProgFacture.php'); ?>
<?php
$colname_rsMaterielDuDevis = "-1";
if (isset($_GET['recordID'])) {
$colname_rsMaterielDuDevis = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
}
mysql_select_db($database_ProgFacture, $ProgFacture);
$query_rsMaterielDuDevis = sprintf("SELECT * FROM materiel WHERE DevisId = %s ORDER BY MatDenomination ASC", $colname_rsMaterielDuDevis);
$rsMaterielDuDevis = mysql_query($query_rsMaterielDuDevis, $ProgFacture) or die(mysql_error());
$row_rsMaterielDuDevis = mysql_fetch_assoc($rsMaterielDuDevis);
$totalRows_rsMaterielDuDevis = mysql_num_rows($rsMaterielDuDevis);
?>
<?php
require('../fpdf153/fpdf.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');
//Positionnement à 1,5 cm du bas
//Seconde partie de ma page
mysql_select_db($database_ProgFacture, $ProgFacture);
$query="SELECT * FROM materiel WHERE DevisId = 86 ORDER BY MatDenomination ASC";
$resultat=mysql_query($query);
$pdf->SetXY(0.5,$pdf->GetY()+0);
$pdf->SetFont('Arial','B',6);
$pdf->SetFillColor(96,96,96);
$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=mysql_fetch_array($resultat))
{
$pdf->cell(6,0.5,$row['MatDenomination'],1,0,'L',$fond);
$pdf->cell(2,0.5,$row['MatPvhtva'],1,0,'L',$fond);
$pdf->cell(2,0.5,$row['MatPvtvac'],1,0,'L',$fond);
$pdf->cell(2,0.5,$row['MatQuantity'],1,0,'L',$fond);
$pdf->cell(2,0.5,$row['MatPvttc'],1,0,'L',$fond);
$pdf->cell(6,0.5,$row['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();
}
//Instanciation de la classe dérivée
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
$pdf->Output();
?>
<?php
mysql_free_result($rsMaterielDuDevis);
?> |
Partager