<?php


session_start();


?>

<!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">




</head>

<body class="gecko">

<div id="pagewidth">

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

			<!-- header -->
			<!-- nav -->
			<!-- section :content -->


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

		<!-- nav -->
			<div id="nav">
				<div class="GHeadMenu">
<ul class="nav-line"><li class=""><a href="http://www.materiel.net/" style="" title="Accueil"><span>Accueil</span></a></li><li class="Composants"><a href="http://www.materiel.net/ctl/Composants/" style="background-image: url(/live/97759.gif);" title="Composants"><span>Composants</span></a></li><li class="PC_de_bureau"><a href="http://www.materiel.net/ctl/PC_de_bureau/" style="background-image: url(/live/97760.gif);" title="PC de bureau"><span>PC de bureau</span></a></li><li class="PC_Portables"><a href="http://www.materiel.net/ctl/PC_Portables/" style="background-image: url(/live/97761.gif);" title="PC Portables"><span>PC Portables</span></a></li><li class="Moniteurs_LCD"><a href="http://www.materiel.net/ctl/Moniteurs_LCD/" style="background-image: url(/live/97762.gif);" title="ÉCRANS LCD"><span>ÉCRANS LCD</span></a></li><li class="Peripheriques"><a href="http://www.materiel.net/ctl/Peripheriques/" style="background-image: url(/live/97763.gif);" title="Périphériques"><span>Périphériques</span></a></li><li class="Reseau_Wifi"><a href="http://www.materiel.net/ctl/Reseau_Wifi/" style="background-image: url(/live/97764.gif);" title="Réseau"><span>Réseau</span></a></li><li class="Logiciels_et_livres"><a href="http://www.materiel.net/ctl/Logiciels_et_livres/" style="background-image: url(/live/97765.gif);" title="Logiciels / livres"><span>Logiciels / livres</span></a></li><li class="Connectique last"><a href="http://www.materiel.net/ctl/Connectique/" style="background-image: url(/live/106422.gif);" title="Connectique"><span>Connectique</span></a></li></ul><ul class="nav-line"><li class="jeux_video"><a href="http://www.materiel.net/ctl/jeux_video/" style="background-image: url(/live/97766.gif);" title="CONSOLES / JEUX"><span>CONSOLES / JEUX</span></a></li><li class="TV_et_videoprojecteurs"><a href="http://www.materiel.net/ctl/TV_et_videoprojecteurs/" style="background-image: url(/live/97767.gif);" title="TV / Vidéoprojection"><span>TV / Vidéoprojection</span></a></li><li class="HiFi_et_HomeCinema"><a href="http://www.materiel.net/ctl/HiFi_et_HomeCinema/" style="background-image: url(/live/97768.gif);" title="Hifi / home cinéma"><span>Hifi / home cinéma</span></a></li><li class="Photo_et_Camescopes"><a href="http://www.materiel.net/ctl/Photo_et_Camescopes/" style="background-image: url(/live/97769.gif);" title="Photo / caméscopes"><span>Photo / caméscopes</span></a></li><li class="Telephonie_GPS"><a href="http://www.materiel.net/ctl/Telephonie_GPS/" style="background-image: url(/live/97770.gif);" title="Téléphonie / GPS"><span>Téléphonie / GPS</span></a></li><li class="MP31"><a href="http://www.materiel.net/ctl/MP31/" style="background-image: url(/live/97771.gif);" title="AUDIO / MP3 / MP4"><span>AUDIO / MP3 / MP4</span></a></li><li class="Geek_zone last"><a href="http://www.materiel.net/ctl/Geek_zone/" style="background-image: url(/live/97772.gif);" title="GEEK ZONE"><span>GEEK ZONE</span></a></li></ul>
</div><!--cached-->			</div>



 <div id="section">

<?php

		if(isset($_SESSION['connexion']))
		  {
		  	if($_SESSION['connexion']== "valide")
		  	  {
		  	  	header('Location: compte.php');
		  	  }	
		  }	


			  if(isset($_POST) && isset($_POST['identifiant']) && isset($_POST['password']) )                                               
                {                                                                       
   	   	
       				if( !empty($_POST['identifiant']) && !empty($_POST['password']) )
         			  {
					  		extract($_POST);
		
							$connexion = mysql_connect("localhost", "root", "");
							
			    	        if(!$connexion)
        	  				  { die('Could not connect: ' . mysql_error());
			            	  }
  
			        	    mysql_select_db("boutique", $connexion);
  		
					  		$sql = "select * from clients where identifiant='".$identifiant."'";
  		
					  		$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
	
			                $data = mysql_fetch_assoc($req);

					  		if($data['password'] != $password) 
					     		{
					    			echo '<p>Mauvais login / password. Merci de recommencer</p>';
					    			exit;
					  		}
        
                else {
    			
    			$_SESSION['email'] = $data["email"];
			$_SESSION['identifiant'] = $data["identifiant"];
    			$_SESSION['password'] = $data["password"];
    			$_SESSION['prenom'] = $data["prenom"];
			$_SESSION['id'] = $data["id"];
			$_SESSION['connexion']= "valide";
			
			
			echo '<body onLoad="alert(\'Identification correcte.\')">'; 
			
			print_r($_SESSION);
			
			if($_SESSION['redirection']== "pilou")
			 {  $_SESSION['redirection']= "aucun";
			    header('Location: ../panier/archiver_panier.php');
			   }
			
			else {
			       if($_SESSION['validation_commande']=="logger")
    			         { header('Location: ../commande/choix_adresse.php');
    			         }
    			          else { echo 'Vous etes bien logué';
       			                 header('Location: compte.php');
			               }
			   }
    			
  		     }    

		

   	 }                      
   	 else {  echo 'Il manque quelque chose ?.'; }                                                 
                                                                           
   }                                   


?>

			<!-- aside -->
			<div id="aside">
				<div id="search-bar">
	<form method="get" action="http://www.materiel.net/search.html">
		<input name="search" title="Recherche" type="text">
		<input value="Rechercher" type="submit">
	</form>
</div>
				<div id="account">
	<ul>
		<li class="icon"><a href="http://www.materiel.net/client/login.html">Mon espace perso</a></li>
	</ul>

	<div class="panel">
		<form action="/client/logincheck.nt.php" method="post">
			<dl>
				<dt><label for="login">Votre nom d'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="http://www.materiel.net/client/register.html">Créer mon compte</a></li>
				<li class="password"><a href="http://www.materiel.net/client/sendpass.html">Mot de passe oublié ?</a></li>
			</ul>
		</form>
	</div>
</div>

<div id="basket">
	<ul>
		<li id="BasketProdCount"><a href="http://www.materiel.net/panier.html">Votre panier est vide</a></li>
		<li id="BasketAmount"></li>
	</ul>
</div>
					</div>


<div id="client" style="overflow: hidden;">
	<div class="SideLeft">
		<table class="CatTitle" width="100%" border="0" cellpadding="0" cellspacing="0">
			<tbody><tr>
				<th style="text-align: left;" width="689" height="40"> Je m'identifie
					<hr>
				</th>
				<td rowspan="2" width="56">
					<img src="AccountHeaderIco.jpg" alt="" width="92" height="56">
				</td>
			</tr>
			<tr>
				<td style="vertical-align: top;" height="26"><a href="../home.php">Accueil &gt;</a></td>
			</tr>
		</tbody></table>
			<div align="center">
			  <table width="575" border="0" cellpadding="0" cellspacing="0">
			    <tbody>
			      <tr>
			        <td style="text-align: right; vertical-align: top;" width="350">

<form action="login.php" method="post">

<table class="ToolBox2" width="350" border="0" cellpadding="0" cellspacing="0">
<tbody>
			              <tr>
<th width="5"><img src="../images/PromoBoxLeft.gif" alt="" width="5" height="22" /></th>
<th width="340" align="left">J'ai d&eacute;j&agrave; un compte <img src="../images/PromoBoxArrow.gif" style="display: inline;" alt="" width="8" height="11" /></th>

<th width="5"><img src="../images/PromoBoxRight.gif" alt="" width="5" height="22" /></th>
		                  </tr>
			              <tr>
<td class="Inner" colspan="3" style="padding: 5px;" height="100" valign="top"><div class="AccBlue">Je m'identifie pour y acc&egrave;der et PUIS C'EST TOUT !</div>

<div class="AccSmall">Mon nom d'utilisateur</div>

<div>
<input name="identifiant" id="identifiant" style="height: 12px; font-size: 10px; width: 150px;" maxlength="20" type="text" />
</div>

<div class="AccSmall">Mon mot de passe</div>

<div>
 <input name="password" id="password" style="height: 12px; font-size: 10px; width: 150px;" maxlength="10" type="password" />
</div>

<div class="AccForget">J'ai oubli&eacute; mon mot de passe : <a href="renvoi_identifiants.php">Cliquez-ici !</a></div></td>
		                  </tr>
		                </tbody>
		              </table>
			          <input autocomplete="off" name="back" value="" type="hidden" />
			          <input name="imageField" src="../images/btn_identify.gif" style="margin-top: 3px;" type="image" />
			          </form></td>
			        <td style="text-align: right;" width="225"><img src="IdentP1.jpg" alt="" width="136" height="200" /></td>
		          </tr>
		        </tbody>
		      </table>
			  <table style="margin-top: 10px;" width="575" border="0" cellpadding="0" cellspacing="0">
			    <tbody>
			      <tr>
			        <td style="text-align: center;" width="201" height="220"><img src="../images/securityBig.png" alt="" width="256" height="256" /></td>
			        <td style="padding-left: 15px; text-align: right; vertical-align: top;" width="350" height="220">

<form action="register.nt.html" method="post">
<table class="ToolBox2" width="350" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<th width="5">
<img src="../images/PromoBoxLeft.gif" alt="" width="5" height="22" /></th>
<th width="340" align="left">Je suis un nouveau client 
<img src="../images/PromoBoxArrow.gif" style="display: inline;" alt="" width="8" height="11" /></th>
<th width="5">
<img src="../images/PromoBoxRight.gif" alt="" width="5" height="22" /></th>
		                  </tr>
			              <tr>
 <td class="Inner" colspan="3" style="padding: 10px; text-align: justify;" align="left" height="100" valign="top">
 
<div class="AccBlue">Je cr&eacute;e un compte utilisateur </div>
<div class="AccSmall"> Bienvenue !<br />

Pour commander et acc&eacute;der &agrave; nos services, il est n&eacute;cessaire de vous
identifier et donc de cr&eacute;er un compte utilisateur qui vous offre une
 multitude d'avantages.<br />

<br />
&eacute;nager.com s'engage &agrave; s&eacute;curiser vos informations et &agrave; les garder strictement confidentielles. </div>
			                  
                              </td>
		                  </tr>
		                </tbody>
		              </table>
                      

<a href="creation_compte.php"> <input src="../images/btn_nextstep.gif" style="margin-top: 3px;" type="image" />
			          
                      </form></td>

		          </tr>
		        </tbody>
		      </table>
	    </div>
			<br>
		<br>
        
	</div>
</div>			</div>

			

			<!-- footer -->
		</div>
	
    </body>
    </html>