<?php

			    session_start(); 
				
			    if($_SESSION['database']=="local")
	 		      {
	     			$db_host    = "localhost";
	     			$db_user   = "root";
	     			$db_pass   = "";
 				$db_name   = "boutique";

	 		     }
	
			    if($_SESSION['database']=="public")
	  		      {
  	     			$db_host    = "sql2";
   	     			$db_user   = "analogde";
 	     			$db_pass   = "rainbow";
    	     			//$db_type   = "mysql";
	     			$db_name   = "analogde";
	 		    }	
				

 			    $email = $_SESSION['email'];	
								
		 	    $connexion = mysql_connect($db_host,$db_user,$db_pass);
		 	    mysql_select_db($db_name, $connexion);
			
  		  	    $requete = "SELECT * FROM clients WHERE email='$email' ";
	   		    $result = mysql_query($requete);
		            $adr_facturation=mysql_fetch_array($result);
			
			    if($_SESSION['choix_adresse_livraison'] == 1)
			      {  $requete = "SELECT * FROM clients WHERE email='$email' ";
	   		         $result = mysql_query($requete);
		             $data=mysql_fetch_array($result);
				     $adr_livraison_nom = $data['nom'];
				     $adr_livraison_prenom = $data['prenom'];
				     $adr_livraison_adresse = $data['adresse'];
			  	     $adr_livraison_complement = $data['complement'];
			  	     $adr_livraison_cp = $data['cp'];
			         $adr_livraison_ville = $data['ville'];
			      }	
				  
			
				  if($_SESSION['choix_adresse_livraison'] == 2)
			      {  $requete = "SELECT * FROM adresses_livraison WHERE email='$email' ";
	   		         $result = mysql_query($requete);
		             $data=mysql_fetch_array($result);
				     $adr_livraison_nom = $data['nom1'];
				     $adr_livraison_prenom = $data['prenom1'];
				     $adr_livraison_adresse = $data['adresse1'];
			  	     $adr_livraison_complement = $data['complement1'];
			  	     $adr_livraison_cp = $data['cp1'];
			         $adr_livraison_ville = $data['ville1'];
			      }	
				  	
			       if($_SESSION['choix_adresse_livraison'] == 3)
			      {  $requete = "SELECT * FROM adresses_livraison WHERE email='$email' ";
	   		         $result = mysql_query($requete);
		             $data=mysql_fetch_array($result);
				     $adr_livraison_nom = $data['nom2'];
				     $adr_livraison_prenom = $data['prenom2'];
				     $adr_livraison_adresse = $data['adresse2'];
			  	     $adr_livraison_complement = $data['complement2'];
			  	     $adr_livraison_cp = $data['cp2'];
			         $adr_livraison_ville = $data['ville2'];
			      }	
				
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml" lang="fr"><head>

	
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Patrice Delpyt</title>

<link href="../feuille.css" rel="stylesheet" type="text/css">

<meta http-equiv="content-style-type" content="text/css">
<style type="text/css">
	.AdrSpace { background:url(../images/RecapAdrBg.jpg) no-repeat; height:133px; width:263px; padding-top:13px; text-align:left; color:#3e76ba; }	.AdrSpace h1 { text-transform:uppercase; font-weight:bold; font-size:12px; width:200px; margin:0px; margin-bottom:8px; left:38px; position:relative; color:#B91900; }	.AdrSpace div { left:30px; width:210px; overflow:hidden; position:relative; margin:4px; }	table.path {margin-left: -3px;}	table.path td { margin: 0 0 0 0; padding: 0;}
</style>

        
</head>

<body class="gecko">
				<!-- page -->
		<div style="z-index: 1000; position: relative;" id="page">

			<!-- header -->
			<div id="header">
				<h1><a name="top" href="https://www.materiel.net/">Materiel.net</a></h1>
			</div>

			<!-- nav -->
			<div id="nav">
				<div class="GHeadMenu">

<ul class="nav-line">

<li class=""><a href="../acceuil.php" style="" title="Accueil"><span>Accueil</span></a></li>

<li class="Bonnes affaires"><a href="../catalogue/affaires.php" style="background-image:url(/live/97759.gif);" title="Bonnes affaires"><span>affaires</span></a></li>

<li class="Gros menager"><a href="../catalogue/gros_menager.php" style="background-image:url(/live/97760.gif);" title="Gros menager"><span>Gros Ménager</span></a></li>

<li class="Petit menager"><a href="../catalogue/petit_menager.php" style="background-image:url(/live/97761.gif);" title=" Petit ménager"><span>PEtit Menager</span></a></li>

<li class="Images"><a href="../catalogue/image.php" style="background-image:url(/live/97762.gif);" title="Images"><span>Images</span></a></li>

<li class="Son"><a href="../catalogue/son.php" style="background-image:url(/live/97763.gif);" title="SON"><span>SON</span></a></li>

<li class="Video"><a href="../catalogue/video.php" style="background-image:url(/live/97764.gif);" title="Video"><span>Video</span></a></li>

<li class="Photo et camescope"><a href="../catalogue/photo_camescope.php" style="background-image:url(/live/97769.gif);" title="Photo / cam&eacute;scopes">Photo / cam&eacute;scopes</a></li>

<li class="Telephonie"><a href="../catalogue/telephonie.php" style="background-image:url(/live/97770.gif);" title="T&eacute;l&eacute;phonie">T&eacute;l&eacute;phonie </a></li>

</ul>
<ul class="nav-line">

<li class="art de la table"><a href="../catalogue/art_de_la_table.php" style="background-image:url(/live/97766.gif);" title="Art de la table"><span>Art de la table</span></a></li>

<li class="Accessoires"><a href="../catalogue/accessoires.php" style="background-image:url(/live/97767.gif);" title="Accessoires &amp;Consommables"><span>accessoires &amp;consommables</span></a></li>

<li class="Chauffage & clim"><a href="../catalogue/chauffage_clim.php" style="background-image:url(/live/97768.gif);" title="Chauffage &amp; Clim"><span>chauffage &amp; clim</span></a></li>

<li class="Automobiles"><a href="../catalogue/automobile.php" style="background-image:url(/live/97769.gif);" title="Automobiles"><span>Automobiles</span></a></li>

<li class="GPS"><a href="../catalogue/gps.php" style="background-image:url(/live/97770.gif);" title="GPS"><span> GPS</span></a></li>

<li class="MP3"><a href="../catalogue/mp3.php" style="background-image:url(/live/97771.gif);" title="AUDIO / MP3 / MP4"><span>AUDIO / MP3 / MP4</span></a></li></ul>
			  </div>
				<!--cached-->			</div>




			<!-- section :content -->
			<div id="section">
            
				<script type="text/javascript">
	var LastImgPH = null;

	function BskLineSwitch(Line, ImgID)
	{
		Line.className = 'BsklineHover';
		if (ImgID)
		{
			ImgPH = document.getElementById('BskImgPH' + ImgID);
			if (ImgPH == LastImgPH)
				return;

			ImgPH.style.visibility = '';
			ImgPH.style.position = '';
			if (LastImgPH)
			{
				LastImgPH.style.visibility = 'hidden';
				LastImgPH.style.position = 'absolute';
			}
			LastImgPH = ImgPH;
		}
	}

	function BskLineBack(Line, Class)
	{
		Line.className = Class;
	}
</script>


<div id="pm-resume">

	<div style="padding: 0px; float: left; width: 745px; margin-left: 5px; display: inline;">

		<table class="BskTitle" width="100%" border="0" cellpadding="0" cellspacing="0">
			<tbody><tr>
				<th valign="bottom" width="689" align="left" height="40">
					Récapitulatif de ma commande <img src="../images/PuceBleue.gif" alt="" width="8" height="11">
					<hr>
				</th>
				<td rowspan="2" width="56" align="center"><img src="../images/RecapHeaderIco.gif" alt="" width="41" height="57"></td>
			</tr>
			<tr>
				<td valign="top" height="26"><a href="http://www.materiel.net/home.html">Accueil &gt;</a></td>
			</tr>
		</tbody></table>

		
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>

<td width="50%">
<div class="AdrSpace" style="float: right;">
<h1>Mon adresse de facturation</h1>
<div><?php echo $adr_facturation['prenom']; echo " "; echo $adr_facturation['nom']; ?></div>
<div><?php echo $adr_facturation['adresse'];  ?></div>
<div><?php echo $adr_facturation['complement'];  ?></div>
<div><?php echo $adr_facturation['cp']; echo " "; echo $adr_facturation['ville'];   ?></div>
<div>France Metropolitaine</div>
</div>
</td>

<td width="50%" align="center">
<div class="AdrSpace">
<h1>Mon adresse de livraison</h1>
<div><?php echo $adr_livraison_prenom ; echo " " ;echo $adr_livraison_nom ?></div>
<div><?php echo $adr_livraison_adresse;  ?></div>
<div><?php echo $adr_livraison_complement  ?></div>
<div><?php echo $adr_livraison_cp ; echo " "; echo $adr_livraison_ville;   ?></div>
<div>France Metropolitaine</div>

</div>
</td>
</tr>
</tbody>
</table>
            
			<table class="BskSectionTitle" width="100%" border="0" cellpadding="0" cellspacing="0">
				<tbody><tr>
					<td width="95%" align="left" nowrap="nowrap">Ma commande </td>
					<td width="5%" align="center" nowrap="nowrap">&nbsp;</td>
				</tr>
			</tbody></table>
			<table class="Bsk" width="100%" border="0" cellpadding="0" cellspacing="0">
				<tbody><tr>
                
                
					<td style="border-bottom: 1px solid rgb(56, 56, 56);" valign="middle" width="22%" align="center" height="130">
							<div id="BskImgPH96155" style="overflow: hidden;"><img src="recap_fichiers/96155.jpg" alt="W2363V-WF"></div>
							<script type="text/javascript">LastImgPH = document.getElementById("BskImgPH96155");</script>						<div id="BskImgPH93280" style="overflow: hidden; visibility: hidden; position: absolute;"><img src="recap_fichiers/93280.jpg" alt="Kit Extreme3 2 x 2 Go PC12800 Ripjaws CAS 9"></div>
												&nbsp;</td>
                                                
					<td style="border-left: 1px solid rgb(144, 144, 144); border-bottom: 1px solid rgb(56, 56, 56);" valign="top" width="78%">
					<table width="99%" border="0" cellpadding="0" cellspacing="0">
					<tbody>
                    <tr>
					<th width="75%">Produits</th>
					<th style="text-align: center;" width="10%">Quantité</th>
					<th style="text-align: right;" width="15%">Prix HT </th>
					</tr>
                            
					
                    
<?php

	$total_ttc = 0;
	$total_ht = 0;

	for($i=0;$i<count($_SESSION['panier']['reference']);$i++)
           { $total_ttc = $total_ttc + $_SESSION['panier']['prix_ttc'][$i]*$_SESSION['panier']['qte'][$i]; 
	     $total_ht = $total_ht + $_SESSION['panier']['prix_ht'][$i]*$_SESSION['panier']['qte'][$i];

	     $prix = "prix".$i;
	     $boite ="elem".$i;

         if($i%2 ==0)
           { // echo 'Le nombre entré est pair';
			 echo " <tr class=\"BskLine1\" onmouseover=\"BskLineSwitch(this, '96155');\" onmouseout=\"BskLineBack(this, 'BskLine1');\"> ";
 	       }
     else  { // echo 'le nombre entré est impair';
		     echo " <tr class=\"BskLine2\" onmouseover=\"BskLineSwitch(this, '96155');\" onmouseout=\"BskLineBack(this, 'BskLine2');\"> ";
           }
           
?>		   
			<td height="30"><?php echo $_SESSION['panier']['designation'][$i]; ?></td>
			<td style="text-align: center;" height="30"><span class="Qte"><?php echo $_SESSION['panier']['qte'][$i]; ?></span></td>
			<td style="text-align: right;" height="30"><span class="Price"><?php echo $_SESSION['panier']['prix_ht'][$i]; ?> &#8364;</span></td>
			</tr>
    	   
            
	
<?php    		
	   }
	   
	
	
	$TVA = $total_ttc - $total_ht + ( $_SESSION['frais_livraison_ttc'] -  $_SESSION['frais_livraison_ht']);
	
	$total = $total_ttc +  $_SESSION['frais_livraison_ttc'];
	
	
?>            

			</tbody>
            </table>
 			</td>
			</tr>
			</tbody>
            </table>
            
			<table class="BskAddLine" width="100%" border="0" cellpadding="0" cellspacing="0">
			<tbody><tr>
			<td height="30">&nbsp;</td>
			<td height="30">Montant total hors taxe</td>
			<td style="text-align: right;" height="30"><?php echo $total_ht; ?> &#8364; HT</td>
			</tr>
			
            
            <tr>
			<td colspan="3" align="right"><img src="../images/RecapAddLineSep.gif" alt="" width="568" height="1"></td>
			</tr>
			<tr>
			<td width="22%" height="30">&nbsp;</td>
			<td width="58%" align="left" height="30">Mode de livraison : <?php echo $_SESSION['mode_livraison']; ?></td>
			<td style="text-align: right;" width="20%" height="30"><?php echo $_SESSION['frais_livraison_ht']; ?> &#8364; HT	</td>
			</tr>
			
            <tr>
			<td height="30">&nbsp;</td>
			<td align="left" height="30">TVA</td>
			<td style="text-align: right;" height="30"><?php echo $TVA; ?> &#8364;		</td>
			</tr>
			<tr>
			<td colspan="3" style="text-align: right;"><img src="../images/RecapAddLineSep.gif" alt="" width="568" height="1"></td>
			</tr>
                

			<tr>
			<td colspan="3" style="text-align: right;" height="40">
			<table align="right" border="0" cellpadding="0" cellspacing="0">
			<tbody>
            <tr>
			
            <td class="totbutton1">	TOTAL TTC	</td>
			<td id="total" class="totbutton2"> <?php echo $total; ?> &#8364;	</td>

			<td>
			
            <a href="paiement.php"><img src="../images/btn_passorder.gif" alt="Passez votre commande"></a>
            
            
            
			</td>
			</tr>
			</tbody>
            </table>
   		    </td>
			</tr>
			</tbody>
            </table>
  		    </form>

	</div>

	<!-- Right Side -->
</div>
			</div>

			<!-- aside -->
		
           	<div id="aside">
			<div id="search-bar">

			<form method="get" action="http://www.materiel.net/search.html">
			<input type="text" name="search" title="Recherche"/>
			<input type="submit" value="Rechercher" />
			</form>
			</div>
			

<?php
            
            if(isset($_SESSION['utilisateur_login']))
	          {	
					 
			    if($_SESSION['utilisateur_login']== "valide")
				  {         //echo '<body onLoad="alert(\'Identification par le panel.\')">'; 
							echo "
								<div id=\"account\" class=\"on\">
								<ul>
								<li class=\"icon\"><a href=\"../compte/compte.php\">Mon espace perso</a></li>
								<li class=\"logout\"><a href=\"../compte/logout.php\" title=\"Me d&eacute;connecter\">Me d&eacute;connecter</a></li>
								</ul>
								<div class=\"panel\">
								<ul class=\"buttons\">
								<li class=\"account\"><a href=\"../compte/compte.php\">Mon compte client</a></li>
								<li class=\"orders\"><a href=\"../commande/suivi_commande.php\">Mes commandes</a></li>
								<li class=\"addresses\"><a href=\"../compte/adresse_livraison.php\">Mon carnet d'adresse</a></li>
								<li class=\"repairs\"><a href=\"../compte/sav.html\">Mes retours S.A.V</a></li>
								<li class=\"parrainages\"><a href=\"../compte/parrainage.html\">Mes parrainages</a></li>
								<li class=\"refunds\"><a href=\"../compte/avoir.html\">Mes avoirs</a></li>
								<li class=\"carts\"><a href=\"../panier/shopping_liste.php\">Mes paniers</a></li>
								<li class=\"alertes\"><a href=\"compte/alerte.html\">Mes alertes</a></li>
								</ul>
								</div>
								</div> ";
					
				     }
					 
					 else {
						 		echo "
						 		<div id=\"account\">
								<ul>
								<li class=\"icon\"><a href=\"compte/login.php\">Mon espace perso</a></li>
								</ul>

								<div class=\"panel\">
								<form action=\"../compte/login.php\" method=\"post\">
								<dl>
								<dt><label for=\"login\">Votre nom utilisateur</label></dt>
								<dd><input name=\"login\" id=\"login\" maxlength=\"20\" type=\"text\"></dd>
								<dt><label for=\"pass\">Votre mot de passe</label></dt>
								<dd><input name=\"pass\" id=\"pass\" maxlength=\"10\" type=\"password\"></dd>
								</dl>
								<input value=\"Connexion\" type=\"submit\">
								<hr>
								<ul class=\"buttons\">
								<li class=\"register\"><a href=\"../compte/creation_compte.php\">Créer mon compte</a></li>
								<li class=\"password\"><a href=\"../compte/sendpass.php\">Mot de passe oublié ?</a></li>
								</ul>
								</form>
								</div>
								</div> ";
						 
					      }
					 
			}		 
			 

	$mess1 = $_SESSION['nb_article_panier'] ." " ."article" ; 
        if($_SESSION['nb_article_panier'] >1)
        { $mess1 = $mess1 ."s";
	}

        $mess2 = $total ." &euro";

?>
      
       <div id="basket" class="on">
      <ul>
      <li id="BasketProdCount"><a href="../panier/panier.php"><?php echo $mess1; ?></a></li>  
      <li id="BasketAmount"><?php echo $mess2; ?></li> 
      </ul>
      </div>
      </div> 
        
	<!-- footer -->
	</div>
	</body>
	</html>