Location: PHPKode > projects > VIRTUAL.ID > PHP PFE/page_info_personnel.php
<?
session_start();

error_reporting(0);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Administration En Ligne</title>
<style type="text/css">
<!--
.Style1 {
	font-size: 24px;
	font-weight: bold;
	color: #006699;
}
.Style4 {font-size: 14}
.Style7 {
	font-size: 12px;
	color: #000000;
}
.Style8 {
	font-size: 16px;
	color: #CC0000;
}
.Style9 {font-size: 14px}
.Style10 {font-size: 12px}
.Style12 {font-size: 14px; color: #333333; }
.Style14 {font-size: 18px; color: #333333; }
a:link {
	color: #333333;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #333333;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
-->
</style>
</head>
<?php

 if (isset($_POST['password'])) 
{		
$pwd=$_POST["password"];

if($pwd==$_SESSION['u_password'])
{
$_SESSION['page_info']=1;
$_SESSION['listner']=1;
}
else
$_SESSION['page_info']=2;


}


?>


<body>
<table width="1007" height="273" border="0" align="center">
  <tr>
    <td height="155"><div align="center"><img src="img\entete.jpg" width="841" height="136" /></div></td>
  </tr>
  <tr>
    <td><table width="810" border="0" align="center">
      <tr>
        <td><div align="center"><span class="Style1">Vos informations personnelles</span></div></td>
      </tr>
      <tr>
	  
        <td width="804"><div align="center" class="Style1">
		
		  <p>
		 
		  <p class="Style8"><span class="Style14">Bienvenue
              <?php
echo $_SESSION['name_user']." ".$_SESSION['second_name_user']."!"; ?>
            </span></p>
		  <p><span class="Style12"><a href="index.php">D&eacute;connexion</a> --- <a href="Page_services.php">Retour &agrave; la page pr&eacute;c&eacute;dente</a> </span></p>
		     <?php
		
		if($_SESSION['page_info']==0 || $_SESSION['page_info']==2)
		{
		?>
		  <form id="form1" name="form1" method="post" action="">
            <label><span class="Style4"><span class="Style7"><br />
            <span class="Style9">Retapper votre mot de passe:</span>              </span>
            <input type="password" name="password" />
            </span> </label>
            <label>
            <input type="submit" name="Submit" value="Valider" />
            </label>
          </form>
		   <?php
		  }
		  ?>
		  <p>
		   
		  </p>
		  <p><span class="Style8">
		    <?php
		  if($_SESSION['page_info']==2)
		  echo "Mot de passe incorrect!";
		  ?>
		  </span></p>
		  <p class="Style8"><span class="Style10"></p>
		  </div></td>
      </tr>
      <tr>
        <td><div align="center">
		<?php
		if($_SESSION['listner']==1)
		{
		//connexion a l'annuaire
		$ds=ldap_connect("localhost:10389");// or die ("Connection a l'annuaire impossible");
		ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
		$r=ldap_bind($ds,"uid=".$_SESSION['u_user'].",dc=marop,dc=tn",$_SESSION['u_password']);
		
		//rechercher la liste des attributs
		//connexion avec la base mySql
		mysql_connect("localhost","root","codemarop")or die("erreur de connection");
		mysql_select_db("base_user_pfe")or die("erreur au niveau de la base");
		$query="select name_at,name_show_at from attributs where ajout_at=0";
		$result = mysql_query($query);
		
		//code de recherche
		$dn = "dc=marop,dc=tn";
		$filtre="(|(sn=*)(cn=*))";
		$restriction = array();
		$sr=ldap_search($ds, $dn, $filtre, $restriction);
		$info = ldap_get_entries($ds, $sr);
		
		
		//affichage des informations
		echo "<table align=\"center\" border=\"0\" bordercolorlight=\"#000033\" style=\"border-style:inherit\"><tr><td bgcolor=\"#8DA8D8\">Attributs</td><td width=\"500\" bgcolor=\"#8DA8D8\">Informations</td></tr>";
		$i=0;
		while($ln=mysql_fetch_array($result))
		{
		if($i==0)
		{echo "<tr><td>".$ln['name_show_at']."</td><td>".$info[0][strtolower($ln['name_at'])][0]."</td></tr>";
		$i=1;
		}
		
		else
		{echo "<tr><td bgcolor=\"#CCCCCC\">".$ln['name_show_at']."</td><td bgcolor=\"#CCCCCC\">".$info[0][strtolower($ln['name_at'])][0]."</td></tr>";
		$i=0;
		}
		}
		
		echo "</table>";
		}
		?>
		</div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><div align="center"><img src="img\bas.jpg" width="841" height="79" /></div></td>
  </tr>
</table>
</body>
</html>
Return current item: VIRTUAL.ID