Location: PHPKode > projects > VIRTUAL.ID > PHP PFE/Page_un.php
<?
session_start();
$_SESSION['info_affiche']=0;
error_reporting(0);

?>

<?php

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 uid_dem,pwd_dem from demandes where uid_dem='".$_SESSION['u_user']."'";
$result = mysql_query($query);
while($ln=mysql_fetch_array($result))
$pwd=$ln['pwd_dem'];


$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",$pwd);


$dn = "dc=marop,dc=tn";
$filtre="(|(sn=*)(cn=*))";
$restriction = array();
$sr=ldap_search($ds, $dn, $filtre, $restriction);
$info = ldap_get_entries($ds, $sr);

$mort=$info[0][houseidentifier][0];

if($mort=="0")
$_SESSION['info_affiche']=1;
else if($mort=="1")
$_SESSION['info_affiche']=2;
else if($mort=="2")
$_SESSION['info_affiche']=3;

?>

<!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;
}
.Style2 {
	font-size: 18px;
	font-weight: bold;
}
a:link {
	color: #333333;
}
a:visited {
	color: #333333;
}
.Style4 {
	font-weight: bold;
	font-size: 14px;
}
.Style5 {font-size: 14}
.Style7 {font-size: 12px}
.Style8 {
	font-size: 14;
	color: #990000;
	font-weight: bold;
}
.Style13 {
	font-size: 14px;
	color: #FF0000;
}
.Style14 {font-size: 16px}
.Style15 {font-size: 14px}
-->
</style>
</head>

<?php

if($_SESSION['info_affiche']==1)
{
if (isset($_POST['txt_un_name']) && isset($_POST['txt_un_pwd']) && isset($_POST['txt_user_conj']) && isset($_POST['txt_pwd_conj']))
{


$user_un=$_POST['txt_un_name'];
$pwd_un=$_POST['txt_un_pwd'];
$user_cg=$_POST['txt_user_conj'];
$pwd_cg=$_POST['txt_pwd_conj'];

if($user_un=="" || $pwd_un=="" || $user_cg=="" || $pwd_cg=="")
$m="Remplir tous les champs";

else
{

$dn = "dc=marop,dc=tn";
$ds=ldap_connect("localhost:10389");// or die ("Connection a l'annuaire impossible");

ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
if ($ds)
{
$r=ldap_bind($ds,"uid=".$user_un.",dc=marop,dc=tn",$pwd_un);
if ($r)
{

	$r=ldap_bind($ds,"uid=".$user_cg.",dc=marop,dc=tn",$pwd_cg);
	if ($r)
	{
	
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="update demandes set user_un='".$user_un."',pwd_un='".$pwd_un."',user_conjoint='".$user_cg."',pwd_conjoint='".$pwd_cg."',etat_dem=1 where uid_dem='".$_SESSION['u_user']."'";
$result = mysql_query($query);
mysql_close();
$_SESSION['parent']=1;	
	
	}
	else
	$m="Vérifier les informations entrées!";



}
else
$m="Vérifier les informations entrées!";

}
}
}
}

?>


<?php

if($_SESSION['info_affiche']==2)
{
if (isset($_POST['txt_un_name']) && isset($_POST['txt_un_pwd']))
{


$user_un=$_POST['txt_un_name'];
$pwd_un=$_POST['txt_un_pwd'];

if($user_un=="" || $pwd_un=="")
$m="Remplir tous les champs";

else
{

$dn = "dc=marop,dc=tn";
$ds=ldap_connect("localhost:10389");// or die ("Connection a l'annuaire impossible");

ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
if ($ds)
{
$r=ldap_bind($ds,"uid=".$user_un.",dc=marop,dc=tn",$pwd_un);

if ($r)
{
	
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="update demandes set user_un='".$user_un."',pwd_un='".$pwd_un."',user_conjoint='Mort',pwd_conjoint='Mort',etat_dem=1 where uid_dem='".$_SESSION['u_user']."'";
$result = mysql_query($query);
mysql_close();
$_SESSION['parent']=1;
}
else
$m="Vérifier les informations entrées!";

}
}
}
}

?>

<?php

if($_SESSION['info_affiche']==3)
{
	
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="update demandes set user_un='Mort',pwd_un='Mort',user_conjoint='Mort',pwd_conjoint='Mort',etat_dem=1 where uid_dem='".$_SESSION['u_user']."'";
$result = mysql_query($query);
mysql_close();
$_SESSION['parent']=1;
}

?>

<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 width="804"><div align="center" class="Style1">Demande de pr&ecirc;t universitaire </div></td>
      </tr>
      <tr>
        <td><div align="center" class="Style2"><span class="Style14">Bienvenue <?php if(isset($_SESSION['name_user']))
echo $_SESSION['name_user']." ".$_SESSION['second_name_user']."!"; ?></span>
              </p>
        </div>
          <p align="center"><span class="Style4"><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></td>
      </tr></table>
    
	<?php
	if($_SESSION['parent']==0)
	{
	?>
	
	  <?php
	  if($_SESSION['info_affiche']!=3)
	  {
	  ?>
	  <table align="center">
	    <tr>
        <td><div align="center" class="Style2">
          <p class="Style14">Validation des parents: </p>
          <table width="313" border="0"><form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
            <tr>
              <td width="149"><div align="right" class="Style7">Nom d'utilisateur:</div></td>
              <td width="154">
                <label>
                  <input type="text" name="txt_un_name" id="txt_un_name"/>
                  </label>              </td>
            </tr>
            <tr>
              <td><div align="right" class="Style7">Mot de passe :</div></td>
              <td><label>
                <input type="password" name="txt_un_pwd" id="txt_un_pwd"/>
              </label></td>
            </tr>
            <?php
			if($_SESSION['info_affiche']==1)
			{
			?>
			<tr>
              <td><div align="right" class="Style7">
                <p>&nbsp;</p>
                <p class="Style15">Validation du conjoint</p>
                <p class="Style15">&nbsp; </p>
              </div></td>
              <td><label></label></td>
            </tr>
            <tr>
              <td><div align="right" class="Style7">Nom d'utilisateur: </div></td>
              <td><label>
                <input type="text" name="txt_user_conj" id="txt_user_conj"/>
              </label></td>
            </tr>
            <tr>
              <td><div align="right" class="Style7">Mot de passe: </div></td>
              <td><label>
                <input type="password" name="txt_pwd_conj" id="txt_pwd_conj"/>
              </label></td>
            </tr>
			<?php
			}
			?>
            <tr>
              <td>&nbsp;</td>
              <td><input type="submit" name="Submit" value="Accepter et envoyer" /></td>
            </tr>
            
          </form></table>
                  <p class="Style13"><?php echo $m; ?></p>
        </div>
          </td></tr><tr><td><p align="center" class="Style5">&nbsp;</p>
              <p align="center" class="Style8">En validant la demande de votre fils, vous autorisez un  administrateur de&nbsp; voir certaines</p>
              <p align="center" class="Style8">de vos  informations personnelles&nbsp;: nom, pr&eacute;nom, salaire, adresse.</p>
              </td>
          </tr>
    </table>
		<?php
		}
		?>
		
		<?php
		}
		?>
	
	<?php
	if($_SESSION['parent']==1)
	{
	?>
	<table align="center">
	    <tr>
        <td><div align="center" class="Style2">
          <p class="Style14">La demande sera traiter le plus tôt possible.</p></div></td></tr></table>
	<?php
	}
	?>
	</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