<?php
	session_start();
	
	include('../config_inc.php'); 
	
	$_SESSION['database']="public";
	
	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($_POST) && isset($_POST['identifiant']) && isset($_POST['password']) )
			    {                                                                       
       				if( !empty($_POST['identifiant']) && !empty($_POST['password']) )
         			  {
				       extract($_POST);
				       //$connexion = mysql_connect("localhost", "root", "");
					$connexion = mysql_connect($db_host,$db_user,$db_pass); 			
			    	       if(!$connexion)
        	  			 { die('Could not connect: ' . mysql_error());
			            	 }
  
			        	mysql_select_db($db_name, $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;
					  }
        			  
        		   
        		                if($data['password'] == $password) 
                                          {
    						$_SESSION['email'] = $data["email"];
						$_SESSION['identifiant'] = $data["identifiant"];
    						$_SESSION['password'] = $data["password"];
    						$_SESSION['prenom'] = $data["prenom"];
						$_SESSION['id'] = $data["id"];
						$_SESSION['utilisateur_login']= "valide";
			
						//echo '<body onLoad="alert(\'Identification correcte.\')">'; 
					
						//echo $_SESSION['validation_commande'];
					
						if($_SESSION['validation_commande']=="ok")
					  	  { header('Location: ../commande/choix_adresse.php');
					  	  }	
								
			                	if($_SESSION['redirection']== "pilou")
			                  	  { $_SESSION['redirection']= "aucun";
			                     	    header('Location: ../panier/archiver_panier.php');
			                  	  }
			
			
						if($_SESSION['validation_commande']!="ok" )
					          { //echo 'Vous etes bien logué';
       			                            header('Location: compte.php');
       			                          }  
			                 }
			        }
    			
  		             
   			   else {  echo 'Il manque quelque chose ?.'; 
   			        }                                                 
                                                                           
                        }                                   


?>

<!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="../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>




 <div id="section">



			<!-- 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="login.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="../acceuil.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>