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
| <?php
ob_start();
session_start();
define('FPDF_FONTPATH','font/');
include("connection.inc.php");
require('invoice.php');
//Selectionne les produits à mettre dans le pdf
$result=mysql_query("select adress_client,adress_chantier,codepostal_client,codepostal_chantier,civilite,civilite_chantier,tel_client,tel_chantier,fax_client,fax_chantier,interlocuteur_client,interlocuteur_chantier,societe,zone,num_cmd,num_chantier,num_serie,num_contrat,contrat,debut_loc,fin_loc,date,interets,options,prix,qte,conduc,fuel_d,fuel_r,comments from contact ");
$number_of_contact = mysql_numrows($result);
//lier les variables à un tableau
while($row = mysql_fetch_array($result))
{
$adress_client = $row["adress_client"];
$adress_chantier = $row["adress_chantier"];
$codepostal_client
= $row["codepostal_client"];
$codepostal_chantier
= $row["codepostal_chantier"];
$civilite
= $row["civilite"];
$civilite_chantier
= $row["civilite_chantier"];
$tel_client = $row["tel_client"];
$tel_chantier
= $row["tel_chantier"];
$fax_client
= $row["fax_client"];
$fax_chantier
= $row["fax_chantier"];
$interlocuteur_client
= $row["interlocuteur_client"];
$interlocuteur_chantier = $row["interlocuteur_chantier"];
$societe = $row["societe"];
$zone = $row["zone"];
$num_cmd = $row["num_cmd"];
$num_chantier = $row["num_chantier"];
$num_serie = $row["num_serie"];
$num_contrat = $row["num_contrat"];
$contrat = $row["contrat"];
$debut_loc = $row["debut_loc"];
$fin_loc = $row["fin_loc"];
$date
= $row["date"];
$interets
= $row["interets"];
$options
= $row["options"];
$prix
= $row["prix"];
$qte
= $row["qte"];
$conduc
= $row["conduc"];
$fuel_d
= $row["fuel_d"];
$fuel_r
= $row["fuel_r"];
$comments
= $row["comments"];
}
mysql_close();
$pdf = new INVOICE( 'P', 'mm', 'A4' );
$pdf->Open();
$pdf->AddPage();
$pdf->Image("matlock.jpg",10,5,50);
$pdf->addSociete( "",
"blabla\n" .
"blabla\n" .
"blabla\n" .
"blabla\n" );
$pdf->fact_dev( $contrat, "$num_contrat" );
$pdf->temporaire($contrat);
$pdf->addDate($date);
$pdf->addClientAdresse($societe,$adress_client,$codepostal_client);
$pdf->addRefChantier($num_chantier);
$pdf->addPageNumber("1");
$pdf->addChantierAdresse($zone,$adress_chantier,$codepostal_chantier);
$pdf->addInterlocuteur($civilite,$interlocuteur_client,$tel_client,$fax_client);
$pdf->addInterlocuteur1($civilite_chantier,$interlocuteur_chantier,$tel_chantier,$fax_chantier);
$pdf->conducteur($conduc);
$pdf->addNumCOMM($num_cmd);
$pdf->addNumserie($num_serie);
$pdf->addcomm("Materiel livré propre et en état de marche\n" ,
"Materiel livré avec le certificat de conformité\n" );
$pdf->addfuel($fuel_d,$fuel_r);
$pdf->adddebutloc($debut_loc);
$pdf->addfinloc($fin_loc);
$cols=array( "REFERENCE" => 23,
"DESIGNATION" => 78,
"QUANTITE" => 22,
"P.U. HT" => 21,
"REMISE" => 15,
"MONTANT H.T." => 31 );
$pdf->addCols( $cols);
$cols=array( "REFERENCE" => "L",
"DESIGNATION" => "L",
"QUANTITE" => "C",
"P.U. HT" => "R",
"remise" => 15,
"MONTANT H.T." => 31 );
$pdf->addLineFormat( $cols);
$pdf->addLineFormat($cols);
$y = 109;
$line = array( "REFERENCE" => "$num_chantier
$num_chantier
$num_chantier",
"DESIGNATION" => "$interets\n",
"QUANTITE" => "$qte\n",
"P.U. HT" => "$prix\n",
"MONTANT H.T." => "60.00",
"TVA" => "1" );
$size = $pdf->addLine( $y, $line );
$y += $size + 5;
$line = array( "REFERENCE" => "$num_chantier",
"DESIGNATION" => "$options\n",
"QUANTITE" => "1",
"P.U. HT" => "",
"MONTANT H.T." => "60.00",
"TVA" => "1" );
ob_end_clean();
$pdf->Output();
?> |
Partager