<?php
	session_start();
	
	include('../config_inc.php'); 

	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";
	 }

	if(isset($_SESSION['identifiant']) && isset($_SESSION['password']) && isset($_SESSION['prenom'])) 
	     {          $toto = true;
	     }
	else { // page de redirection pour les truand
			
             		 //echo '<meta http-equiv="refresh" content="0;URL=intrusion.htm">'; 
            		 header('Location: ../acceuil.php');

	     }

		$var = $_GET['indice'];
		$supprimer = $_GET['suppression'];
		
		if( ($_POST['ajouter'] == "ajouter")  && ($_POST['sauver'] == "ok") )
  		 { 	    $email = $_SESSION['email'];			 
		 	    $connexion = mysql_connect($db_host,$db_user,$db_pass); 
		 	    mysql_select_db($db_name, $connexion);
			    $requete = "SELECT * FROM adresses_livraison WHERE email='$email' ";
			    $result = mysql_query($requete);
		            $data=mysql_fetch_array($result);
   			    
   			    $titre = $_POST['titre'];
			    $nom = $_POST['nom'];
			    $pre_nom = $_POST['pre_nom'];
			    $adresse = $_POST['adresse'];
		   	    $complement = $_POST['complement'];
			    $cp = $_POST['cp'];
			    $ville = $_POST['ville'];
			  
		            if($data['titre1'] == NULL)
		 	      { echo '<body onLoad="alert(\'ajout adresse 1 \')">'; 
				   				  	
				    $sql = "UPDATE adresses_livraison SET   
				    	    titre1 = '$titre' ,
					    nom1 = '$nom' ,
					    prenom1 = '$pre_nom' ,
					    adresse1 = '$adresse' ,
					    complement1 = '$complement' ,
					    cp1 = '$cp' ,
					    ville1 = '$ville' 
					    WHERE email='$email' ";
					    
					    echo $sql;
				
  				    $requete = mysql_query($sql, $connexion) or die( mysql_error() ) ;	
			      }
				   
			    if( ($data['titre1']!="") && ($data['titre2']== "") )
			      { echo '<body onLoad="alert(\'ajout adresse 2 \')">'; 
				  	
				    $sql = "UPDATE adresses_livraison SET   
				            titre2 = '$titre' ,
					    nom2 = '$nom' ,
					    prenom2 = '$pre_nom' ,
					    adresse2 = '$adresse' ,
					    complement2 = '$complement' ,
					    cp2 = '$cp' ,
					    ville2 = '$ville' 
					    WHERE email='$email' ";
				
  				    $requete = mysql_query($sql, $connexion) or die( mysql_error() ) ;	
			     }
				   
			   if( ($data['titre1']!= "") && ($data['titre2'] != "") )
			     { 	echo '<body onLoad="alert(\'Quota 3 adresses atteint: 1 facturation + 2 supplémentaires \')">'; 
			     }
		 }
		
		
		if( ($_POST['modifier'] == "modifier")  && ($_POST['sauver'] == "ok") )
		  { 
		        echo '<body onLoad="alert(\'Mise à jour réussie. \')">'; 
		        $email = $_SESSION['email'];			 
			
		 	$connexion = mysql_connect($db_host,$db_user,$db_pass); 
		 	mysql_select_db($db_name, $connexion);
		   
			$titre = $_POST['titre'];
			$nom = $_POST['nom'];
			$pre_nom = $_POST['pre_nom'];
			$adresse = $_POST['adresse'];
			$complement = $_POST['complement'];
			$cp = $_POST['cp'];
			$ville = $_POST['ville'];
			
			if($var == "1")
			   { $sql = "UPDATE adresses_livraison SET 
			             titre1 = '$titre' ,
				     nom1 = '$nom' ,
				     prenom1 = '$pre_nom' ,
				     adresse1 = '$adresse' ,
				     complement1 = '$complement' ,
				     cp1 = '$cp' ,
				     ville1 = '$ville' 
				     WHERE email='$email' ";
				
  				     $requete = mysql_query($sql, $connexion) or die( mysql_error() ) ;	
			   }
			if($var == "2")
			   { $sql = "UPDATE adresses_livraison SET   
			            titre2 = '$titre' ,
				    nom2 = '$nom' ,
				    prenom2 = '$pre_nom' ,
				    adresse2 = '$adresse' ,
				    complement2 = '$complement' ,
				    cp2 = '$cp' ,
				    ville2 = '$ville' 
				    WHERE email='$email' ";
				
  				    $requete = mysql_query($sql, $connexion) or die( mysql_error() ) ;	 
			   }
			   
		  }
		
		if($supprimer == "1")
			  {   echo '<body onLoad="alert(\'Supprimer 1\')">'; 
				  $connexion = mysql_connect($db_host,$db_user,$db_pass); 
				  mysql_select_db($db_name, $connexion);
				  $email = $_SESSION['email'];
				  $sql = "UPDATE adresses_livraison SET   
				          titre1 = '' ,
				  	  nom1 = '' ,
					  prenom1 = '' ,
					  adresse1 = '' ,
					  complement1 = '' ,
					  cp1 = '' ,
					  ville1 = '' 
				  	  WHERE email='$email' ";
				
  				$requete = mysql_query($sql, $connexion) or die( mysql_error() ) ;						 
			  }

   		if($supprimer == "2")
			  {   echo '<body onLoad="alert(\'Supprimer 2\')">'; 
				  $connexion = mysql_connect($db_host,$db_user,$db_pass); 
				  mysql_select_db($db_name, $connexion);
				  $email = $_SESSION['email'];
				  $sql = "UPDATE adresses_livraison SET 
				          titre2 = '' ,
				  	  nom2 = '' ,
					  prenom2 = '' ,
					  adresse2 = '' ,
					  complement2 = '' ,
					  cp2 = '' ,
					  ville2 = '' 
				  	  WHERE email='$email' ";
				
  				$requete = mysql_query($sql, $connexion) or die( mysql_error() ) ;	
				
/*			echo '<a href="supprimer.php?id_enreg='.$id_enr.'" onClick="javascript: return confirm(\'Etes vous surs de vouloir supprimer ?\'">Supprimer</A>';*/
				
			  }
			  
			  
			/*if($var == "1")
			 {	echo '<body onLoad="alert(\'selection 1\')">'; 
		 	 }
		 
			if($var == "2")
		 	{	echo '<body onLoad="alert(\'selection 2\')">'; 
		 	} */
 
			  
			// echo '<body onLoad="alert(\'Element 1\')">'; 
        	if($var == "1")
			  {     echo '<body onLoad="alert(\'Element 1\')">'; 
				$email = $_SESSION['email'];
			        $connexion = mysql_connect($db_host,$db_user,$db_pass); 
				mysql_select_db($db_name, $connexion);
		 		$requete = "SELECT * FROM adresses_livraison WHERE email='$email' ";
	   		        $result = mysql_query($requete);
		                $data=mysql_fetch_array($result);
				$titre = $data['titre1'];
				$nom = $data['nom1'];
				$pre_nom = $data['prenom1'];
				$adresse = $data['adresse1'];
			  	$complement = $data['complement1'];
			  	$cp = $data['cp1'];
			        $ville = $data['ville1'];
		  	  }
			//echo '<body onLoad="alert(\'Element 2\')">';
			if($var == "2")
		     {	 echo '<body onLoad="alert(\'Element 2\')">';
			    	$email = $_SESSION['email'];
			        $connexion = mysql_connect($db_host,$db_user,$db_pass); 
				mysql_select_db($db_name, $connexion);
		 		$requete = "SELECT * FROM adresses_livraison WHERE email='$email' ";
	   		    	$result = mysql_query($requete);
		        	$data=mysql_fetch_array($result);
				$titre = $data['titre2'];
				$nom = $data['nom2'];
				$pre_nom = $data['prenom2'];
				$adresse = $data['adresse2'];
			  	$complement = $data['complement2'];
			  	$cp = $data['cp2'];
			    	$ville = $data['ville2'];
		     }
		 
		
		 if($var != "1" && $var != "2" )
		  {       // echo '<body onLoad="alert(\'Pas de selection\')">'; 
		  	  $titre = "";
			  $nom = "";
			  $pre_nom = "";
			  $adresse = "";
		  	  $complement = "";
		  	  $cp = "";
		          $ville = "";

			  $email = $_SESSION['email'];			 
		 	  $connexion = mysql_connect($db_host,$db_user,$db_pass); 
		 	  mysql_select_db($db_name, $connexion);
			  $requete = "SELECT * FROM adresses_livraison WHERE email='$email' ";
			  $result = mysql_query($requete);
		      	  $data=mysql_fetch_array($result);
			  
			  //$data['titre1'];
  			  //$data['titre2'];
		 }


		


?>
	

<!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 Delpy</title>

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

<script type="text/javascript" src="javascript_ajout_adresse.js"></script>

<meta http-equiv="content-style-type" content="text/css">

</head>
            
<body class="gecko">


				
<div id="page">
<div id="header">
<h1><a name="top" href="/">Materiel.net</a></h1>
</div>
            
<?php		
	 include('../menu_site.php'); 

?>	

	<div id="section">
	<div id="client">
	<table class="CatTitle" border="0" cellpadding="0" cellspacing="0" width="100%">
	<tbody><tr>
	<th align="left" height="40">Mon espace perso <img src="../images/BskHeaderArrow.gif" alt="" height="11" width="8">
	<hr>
	</th>
	<td rowspan="2" width="50"><img src="../images/people-icon.png" alt="" height="48" width="48"></td>

	</tr>
	<tr>
	<td style="vertical-align: top;" height="40">

	<a href=".../acceuil.php">Accueil</a> &gt; 
	<a href="compte.php">mon espace perso</a>
 	&gt; mon carnet d'adresses </td>
	</tr>
	</tbody></table>

	<table border="0" cellpadding="0" cellspacing="0" width="950">
	<tbody><tr>
	<td colspan="2"><div class="EpWelcome">
	<h3>Bienvenue <?php echo $_SESSION['prenom']; ?> dans votre espace perso !</h3>
	<div>Gr&acirc;ce &agrave; cet espace qui vous est dédié, vous pourrez 
	gérer votre compte client, vos adresses, consulter la liste et 
	l&#8217;évolution de vos dernières commandes, de vos avoirs, de vos codes de 
	promotions et profiter de bien d&#8217;autres fonctionnalités.</div>
	</div></td>
	</tr>
	<tr>
	
	<td style="vertical-align: top;" width="270"><div class="clientmenu">
	<div style="margin-left: 10px;">
    
	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='compte.php';" width="266">
	<tbody><tr>

	<td style="vertical-align: middle; text-align: center;" width="84"><img src="../images/User_Folder.jpg" alt="Mon compte 
	personnel" border="0" height="64" width="64">
	</td>

	<td width="181">
	<div class="EpTitre">MON COMPTE CLIENT :</div>
	<div class="EpDesc">Consulter ou mettre à jour mon adresse e-mail, mon adresse de facturation, mes abonnements, etc.</div>
	</td>
	</tr>

	</tbody>
	</table>
        
	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='../commande/suivi_commande.php';" width="266">
	<tbody><tr>

	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="../images/Forklift-Containers-64.png" alt="Mon compte personnel" border="0" height="64" width="64"></td>

	<td width="181">
	<div class="EpTitre">SUIVI DE MES COMMANDES :</div>
	<div class="EpDesc">La liste de mes commandes en cours et passées 
	sur le site, leur état de traitement, leur détail, date, etc.</div>

	</td>
	</tr>
	</tbody></table>

	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='adresse_livraison.php';" width="266">
	<tbody>
	<tr style="background: url(../images/EpMenuBg.gif) repeat-x scroll center bottom transparent;">

	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="../images/addressbook_icon.jpg" alt="Mon carnet d'adresse" border="0" height="68" width="68"></td>

	<td width="181">
	<div class="EpTitre">Mon carnet d'adresses :</div>
	<div class="EpDesc">Ajouter, modifier ou supprimer mes adresses de livraison.</div>
	</td>

	</tr>
	</tbody></table>
	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='sav.html';" width="266">
	<tbody><tr>

	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="../images/sav.gif" alt="Service après vente" border="0" height="64" width="64"></td>
	
	<td width="181">
	<div class="EpTitre">Service après vente :</div>
	<div class="EpDesc">Toutes les informations sur le SAV et sur les demandes de retour.</div>
	</td>
	</tr>
	</tbody></table>

	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='parrainage.html';" width="266">
	<tbody><tr>
                
	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="cpte_parrainage_on.gif" alt="Mes parrainages" border="0" height="70" width="64"></td>

	<td width="181">
	<div class="EpTitre">MES PARRAINAGES :</div>
	<div class="EpDesc">Parrainez vos amis et gagnez des crédits 
	d&#8217;achats d&#8217;une valeur de 10&#8364; !</div>
	</td>
	</tr>
	</tbody></table>

	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='avoir.html';" width="266">
	<tbody><tr>
            
	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="../images/100euro_bills_icon.jpg" alt="Mes avoirs" border="0" height="64" width="64"></td>

	<td width="181">
	<div class="EpTitre">MES AVOIRS :</div>
	<div class="EpDesc">Consulter mes avoirs et leurs utilisations.</div>
	</td>
	</tr>
	</tbody></table>

	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='../panier/shopping_liste.php';" width="266">
	<tbody><tr>

	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="../images/shoping_list_128x128.png" alt="Mes avoirs" border="0" height="64" width="64"></td>

	<td width="181">
	<div class="EpTitre">MA SHOPPING LIST:</div>
	<div class="EpDesc">Mes paniers enregistrés, mes achats à venir, ma sélection de cadeaux pour mon anniversaire. </div>
	</td>
	</tr>
	</tbody></table>
	
	<table class="EpMenu" style="cursor: pointer;" onclick="document.location.href='alerte.html';" width="266">
	<tbody><tr>

	<td style="vertical-align: middle; text-align: center;" width="84">
	<img src="EpIcoAlerte.gif" alt="Mes alertes" border="0" height="74" width="63"></td>

	<td width="181">
	<div class="EpTitre">MES ALERTES:</div>
	<div class="EpDesc">Consulter mes alertes. </div>
	</td>
	</tr>
	</tbody></table>
	</div>
	</div></td>
	
	<td style="vertical-align: top;" width="100%">
	<div style="border: 1px solid rgb(154, 154, 154); margin-left: 20px; margin-right: 5px; padding: 12px;">
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tbody><tr>

	<td align="left" width="24%">
	<img src="../images/addressbook_icon.jpg" alt="Gestion de mes adresses de livraison" height="148" width="148"></td>

	<td style="padding: 12px;" width="76%">
	<div class="EpTitre">Gestion de mes adresses de livraison : </div>
	
	<div class="EpDesc">
	<p>Vous souhaitez vous faire livrer à domicile, au bureau ou 
	chez votre grand tante ? Pas de soucis avec votre carnet d&#8217;adresses.<br>
	<span style="color: rgb(185, 25, 0);">Par défaut, votre adresse de livraison est identique à votre adresse de facturation.</span></p>
	</div>
	</td>
	</tr>
	
	</tbody></table>
	<table style="margin-top: 10px;" border="0" cellpadding="0" cellspacing="0" width="100%">
	<tbody><tr>

	<td style="vertical-align: top; background: url(../images/AdrAddrBg.jpg) no-repeat scroll 0% 0% transparent; height: 351px; width: 243px;" width="39%">

	<form name="modification" action="adresse_livraison.php"  method="post" >

	<div class="EpAdrList">
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tbody>
	<tr>
     	<td width="85%"><?php echo($data['titre1']); ?></td>
     	<td style=\"text-align: center;" width="15%">

<?php

	if($data['titre1'] != null)
          {  echo "<input name=\"adresse\" id=\"adr1\" type=\"radio\" value=\"1\" onClick=\"document.location.href = 'adresse_livraison.php?indice=1' \"  ";
     
             if($var ==1) echo " checked=\"checked\"  >" ;
		 
		echo " </td>
		       </tr>
		       <td class=\"Suppr\" style=\"vertical-align: top; border-bottom: 1px solid rgb(204, 204, 204);\" height=\"24\" width=\"85%\">
		      <img src=\"../images/PanelPersoArrow1.gif\" alt=\"\" align=\"absmiddle\" height=\"5\" width=\"9\">
		      <a href=\"adresse_livraison.php?suppression=1\" onclick=\"return confirmation()\"  \">Supprimer</a></td> ";
	        echo "<input type=\"hidden\" name=\"valide\" id=\"valide\" value=\"\"> ";
          }
?> 
          
	</td>
	</tr>

	<tr>
	<tr>

	<td width="85%"><?php echo($data['titre2']); ?></td>
	<td style="text-align: center;" width="15%">
<?php

	if($data['titre2'] != null)
  	  {  echo "<input name=\"adresse\" id=\"adr2\" type=\"radio\" value=\"2\" onClick=\"document.location.href = 'adresse_livraison.php?indice=2' \"  ";
    
             if($var ==2) echo " checked=\"checked\"  >" ;
	  	
	  	echo " </td>
		       </tr>
		       <td class=\"Suppr\" style=\"vertical-align: top; border-bottom: 1px solid rgb(204, 204, 204);\" height=\"24\" width=\"85%\">
		       <img src=\"../images/PanelPersoArrow1.gif\" alt=\"\" align=\"absmiddle\" height=\"5\" width=\"9\">
		       <a href=\"adresse_livraison.php?suppression=2\" onclick=\"return confirmation()\"  \">Supprimer</a></td> ";
	        echo "<input type=\"hidden\" name=\"valide\" id=\"valide\" value=\"\"> ";
																							  
	 }
?>
                                    
	</form>                                    

	<td style="text-align: center; border-bottom: 1px solid rgb(204, 204, 204);" height="24" width="15%">&nbsp;</td>
	</tr>
	<tr>
	<td colspan="2" align="left" height="70" valign="bottom" width="85%">&nbsp;</td>
	</tr>
	</tbody></table>
	</div>
	</td>
	<td valign="top" width="61%">

	<form name="ajout_adresse" action=""  method="post" onsubmit="return traitement();">
        <table class="ToolBox2" border="0" cellpadding="0" cellspacing="0" width="370">
	<tbody><tr>

	<th width="5"><img src="../images/PromoBoxLeft.gif" alt="" height="22" width="5"></th>

	<th align="left" width="720">Mes coordonnées de livraison 
	<img src="../images/PromoBoxArrow.gif" style="display: inline;" alt="" height="11" width="8"></th>

	<th width="5"><img src="../images/PromoBoxRight.gif" alt="" height="22" width="5"></th>
	</tr>
	<tr>
	<td class="Inner" colspan="3" align="center" valign="top" width="730">
										
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tbody><tr>
        <td style="vertical-align: top; padding: 10px;" width="49%">
	
	<div style="text-align: justify;">Si vous êtes un 
	particulier vous avez également la possibilité, si vous le souhaitez, de
 	vous faire livrer sur votre lieu de travail.</div>
 
	<div class="FormMandatory">Titre [ex : A la maison] :</div>

	<div>
	<input name="titre" id="titre" maxlength="30" class="Formfield"  value="<?php echo($titre) ;?>" type="text">
	</div>

	<input type="hidden" name="sauver" id="sauver" value="">

	<div class="FormNormal">Société :</div>

	<div>
	<input name="societe" id="societe" maxlength="60" class="Formfield"  type="text">														</div>

	<div class="FormMandatory">Nom :</div>

	<div>
	<input name="nom" id="nom" maxlength="60" class="Formfield"  value="<?php echo($nom) ;?>" type="text">
	</div>

	<div class="FormMandatory">Prénom :</div>

	<div>
	<input name="pre_nom" id="pre_nom" maxlength="40" class="Formfield" value="<?php echo($pre_nom) ;?>" type="text">														</div>

	<div class="FormMandatory">Destination de ma commande :</div>
	<select name="Pays" id="Pays">
	<option selected="selected" value="33">France Métropolitaine</option>
	<option value="3301">France DOM</option>
	<option value="3302">France TOM</option>
	<option value="32">Belgique</option>
	<option value="377">Monaco</option>
	</select>

	<div style="color: rgb(136, 136, 136); margin-top: 4px;">Il est à noter que le choix des transporteur peut se restreindre en 
        fonction de celle-ci</div>
	
	</td>
	<td style="vertical-align: top; padding: 10px;" width="48%">
	<div class="FormMandatory">Adresse :</div>

	<div>
	<input name="adresse" id="adresse" maxlength="60" class="Formfield" value="<?php echo($adresse) ;?>"type="text">														</div>
	
	<div class="FormNormal">Complément d'adresse :</div>
	
	<div>
	<input name="complement" maxlength="60" class="Formfield" id="complement" value="<?php echo($complement) ;?>" type="text">														</div>
	
	<div class="FormMandatory">Code postal :</div>
	
	<div>
	<input id="cp" name="cp" class="Formfield" maxlength="5" value="<?php echo($cp) ;?>" type="text">														</div>
	
	<div class="FormMandatory">Ville :</div>
	
	<div>
	<input name="ville" maxlength="50" class="Formfield" id="ville" value="<?php echo($ville) ;?>" type="text">														</div>
	
	<div class="FormNormal">Complément d'information  :</div>
	
	<div>
	<input name="Extra" class="Formfield" id="Extra" 
	maxlength="35" style="width: 140px;" type="text">	
	</div>
										
	<div class="FormNormal">
	<input name="Defaut" id="Defaut" value="1" type="checkbox"> 
	<label for="Defaut">Définir comme adresse par défaut</label></div>
	</td>
	</tr>
	</tbody></table>
	</td>
	</tr>
	</tbody></table>

	<input autocomplete="off" name="op" id="op" value="new" type="hidden">
	<input autocomplete="off" name="adr" id="adr" value="0" type="hidden">

	<div style="text-align: right; margin-top: 4px;">

	<input  type="submit" name="ajouter" VALUE="ajouter"> 

	<input src="../images/btn_nextstep.gif" type="image" name="modifier" value="modifier">

	</div>						
	</form>
	
	</td>
	</tr>
	</tbody></table>
	</div>
	</td>
	</tr>
	</tbody></table>
	</div>	
	</div>

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

			<form method="get" action="recherche.html">
			<input type="text" name="search" title="Recherche"/>
			<input type="submit" value="Rechercher" />
			</form>
			</div>
			

<?php
            
            //if(isset($_SESSION['connexion']))
			 
			    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.php\">Mon espace perso</a></li>
								<li class=\"logout\"><a href=\"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.php\">Mon compte client</a></li>
								<li class=\"orders\"><a href=\"../commande/suivi_commande.php\">Mes commandes</a></li>
								<li class=\"addresses\"><a href=\"adresse_livraison.php\">Mon carnet d'adresse</a></li>
								<li class=\"repairs\"><a href=\"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=\"login.php\">Mon espace perso</a></li>
								</ul>

								<div class=\"panel\">
								<form action=\"check.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=\"creation_compte.php\">Créer mon compte</a></li>
								<li class=\"password\"><a href=\"sendpass.php\">Mot de passe oublié ?</a></li>
								</ul>
								</form>
								</div>
								</div> ";
						 
					      }
					 
			
			
	if($_SESSION['nb_article_panier']!=0)
	  {  	
	     $mess1 = $_SESSION['nb_article_panier'] ." " ."article" ; 
             if($_SESSION['nb_article_panier'] >1)
               { $mess1 = $mess1 ."s";
	       }
            $mess2 = $_SESSION['total_ttc_panier'] ." &euro";		
	  	
	    echo "
	  		<div id=\"basket\" class=\"on\">
      			<ul>
      			<li id=\"BasketProdCount\"><a href=\"../panier/panier.php\">$mess1</a></li>  
      			<li id=\"BasketAmount\">$mess2</li> 
      			</ul>
		        </div>
      			</div>  "; 
	  }						 
	else
	{  echo "
		  <div id=\"basket\" >
		  <ul>
		  <li id=\"BasketProdCount\"><a href=\"../panier/panier.php\">Votre panier est vide</a></li>
		  <li id=\"BasketAmount\"></li>
		  </ul>
		  </div>	
  		  </div> ";
	}					 
			 

?>
     
           

	</body>
	</html>