<?php

	session_start();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>Impression du devis</title>
<style type="text/css">
body, table { font-family: Verdana, Arial, sans-serif; font-size: 10pt; color: #000; background-color: #FFF }
table.panier { text-align: center; border: solid 2px #000; margin: auto auto }
table.panier th { font-weight: bold; border-bottom: solid 1px #000 }
td.Name { text-align: left }
td.Price { white-space: nowrap; text-align: right }
td.Totaux { text-align: right; font-weight: bold }
td.fieldname { white-space: nowrap }
td.fieldvalue { border-bottom: dashed 1px #808080; width: 80% }
h1 { text-align: center; font-familly: Arial, sans-serif; font-size: 14pt; font-weight: bold }
</style>
</head>
<body>

<div style="float: left">
<img src="../images/logo_site.jpg" alt="Patrice Delpy" width="200" /><br />
Patrice Delpy<br />
1 Rue du Stade<br />
81120 Réalmont - France <br />

Tel : 05 63 45 51 32<br />
Fax : 05 63 45 51 32
</div>

<div style="text-align: center">
<h1>PANIER</h1>

<?php
	$date = date("d-m-Y");
	$heure = date("H:i");

	echo "(édité le " .$date ." à " .$heure .")";

?>

</div>

<div style="clear: both; padding: 15px 5px 15px 5px">
<table style="text-align: left">
	<tr>
		<td class="fieldname">Nom :</td>

		<td class="fieldvalue">&nbsp;</td>
	</tr>
	
	<tr>
		<td class="fieldname">Prénom :</td>

		<td class="fieldvalue">&nbsp;</td>
	</tr>
	
	
	<tr>
		<td class="fieldname">Société :</td>
		<td class="fieldvalue">&nbsp;</td>
	</tr>
	<tr>
		<td class="fieldname">Adresse :</td>

		<td class="fieldvalue">&nbsp;</td>
	</tr>
	<tr>
		<td class="fieldname">Téléphone :</td>
		<td class="fieldvalue">&nbsp;</td>
	</tr>
	<tr>
		<td class="fieldname">Fax :</td>

		<td class="fieldvalue">&nbsp;</td>
	</tr>
	<tr>
		<td class="fieldname">email :</td>
		<td class="fieldvalue">&nbsp;</td>
	</tr>
</table>
</div>

<div style="text-align: center; padding: 15px 5px 15px 5px">

<table class="panier" cellspacing="0" cellpadding="5">
	<tr>
		<th>Code</th>
		<th>Produit</th>
		<th>Quantité</th>
		<th>Prix TTC unit.</th>
		<th>Prix HT unit.</th>
		
	</tr>


<?php


	for($i=0;$i<count($_SESSION['panier']['reference']);$i++)
	   {    $id = $_SESSION['panier']['id_catalogue'][$i];
	   	$designation =  $_SESSION['panier']['designation'][$i];
	   	$quantite = $_SESSION['panier']['qte'][$i];
	   	$prix = $_SESSION['panier']['prix_ttc'][$i];
	   	
	     echo "	
		    <tr>
		    <td>$id</td>
		    <td class=\"Name\">$designation</td>
		    <td>$quantite</td>
  		    <td class=\"Price\">$prix &euro;</td>
		    </tr> ";
		    
		    
	  }

		$tva = 	$_SESSION['total_ttc_panier'] - $_SESSION['total_ht_panier'] ;
		$total_ttc = $_SESSION['total_ttc_panier'];
		$total_ht = $_SESSION['total_ht_panier'];


?>		    
		<tr>
		<td colspan="3" class="Totaux">Total HT :</td>
		<td class="Price"><?php echo $total_ht; ?> &euro;</td>
		</tr>

		<tr>
		<td colspan="3" class="Totaux">TVA (19,6%) :</td>
		<td class="Price"><?php echo $tva; ?> &euro;</td>
		</tr>
	
		<tr>
		<td colspan="3" class="Totaux">Total TTC :<div style="font-weight: normal">(hors frais de port)</div></td>
		<td class="Price" style="vertical-align: top"><?php echo $total_ttc; ?> &euro;</td>
		</tr>


</table>

</div>

<div>
	<strong>Note :</strong> Prix valables au moment de l'édition et modifiables sans préavis, dans la limite des stocks disponibles. Le montant total s'entend hors frais de port.

</div>

</body>
</html>