<?
session_start();
error_reporting(0);
$m="";
?>
<!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;
}
.Style9 {
color: #333333;
font-weight: bold;
}
.Style10 {color: #990000; font-weight: bold; }
.Style13 {
font-size: 14px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<?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 * from demandes where uid_dem='".$_SESSION['u_user']."'";
$result = mysql_query($query);
while($ln=mysql_fetch_array($result))
{$t_etat=$ln['etat_dem'];}
if(mysql_num_rows($result)!=0)
{
if($t_etat==0)
{
$_SESSION['parent']=0;
echo "<script type=\"text/javascript\">\n";
echo "location.href=\"Page_un.php\";";
echo "</script>\n";
}
if($t_etat==1)
{
$l="ca va";
echo "<script type=\"text/javascript\">\n";
echo "location.href=\"Page_en_cours.php\";";
echo "</script>\n";
}
else if($t_etat==2)
{
echo "<script type=\"text/javascript\">\n";
echo "location.href=\"Page_refus.php\";";
echo "</script>\n";
}
else if($t_etat==3)
{
echo "<script type=\"text/javascript\">\n";
echo "location.href=\"Page_acc.php\";";
echo "</script>\n";
}
}
mysql_close();
?>
<?php
//rec nom et pwd user
$m="";
if (isset($_POST['txt_user_name']) && isset($_POST['txt_pwd_name']) && isset($_POST['txt_nom']) && isset($_POST['txt_prenom']))
{
$user=$_POST['txt_user_name'];
$pwd=$_POST['txt_pwd_name'];
$nom=$_POST['txt_nom'];
$prenom=$_POST['txt_prenom'];
if($user=="" || $pwd=="" || $nom=="" || $prenom=="")
$m="Remplir tous les champs";
else
{
if($user==$_SESSION['u_user'] && $pwd==$_SESSION['u_password'])
{
$concat_name=$prenom." ".$nom;
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="insert into demandes(name_dem,uid_dem,pwd_dem,date_dem) values('".$concat_name."','".$user."','".$pwd."','".date('j/m/Y')."')";
$result = mysql_query($query);
mysql_close();
$m="";
$_SESSION['affiche_demande']=1;
}
else
$m="Login ou Mot de passe Incorrect";
}
}
?>
<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êt universitaire </div></td>
</tr>
<tr>
<td><div align="center" class="Style2"><span class="Style14">Bienvenue <?php
echo $_SESSION['name_user']." ".$_SESSION['second_name_user']."!"; ?></span>
</p>
</div>
<p align="center"><span class="Style4"><a href="index.php">Déconnexion</a> --- <a href="Page_services.php">Retour à la page précédente</a></span></p></td>
</tr></table>
<?php
if($_SESSION['affiche_demande']==0)
{
?>
<table align="center">
<tr>
<td><div align="center" class="Style2">
<p>Entrer les informations ci dessous:</p>
<table width="272" border="0"><form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<tr>
<td width="111"><div align="right" class="Style7">Nom d'utilisateur :</div></td>
<td width="151">
<label>
<input type="text" name="txt_user_name" id="txt_user_name"/>
</label> </td>
</tr>
<tr>
<td><div align="right" class="Style7">Mot de passe :</div></td>
<td><label>
<input type="password" name="txt_pwd_name" id="txt_pwd_name"/>
</label></td>
</tr>
<tr>
<td class="Style7"><div align="right">Prenom :</div></td>
<td><label>
<input type="text" name="txt_prenom" id="txt_prenom"/>
</label></td>
</tr>
<tr>
<td class="Style7"><div align="right">Nom :</div></td>
<td><label>
<input type="text" name="txt_nom" id="txt_nom"/>
</label></td>
</tr>
<tr>
<td><div align="right" class="Style7"></div></td>
<td><label>
<input type="submit" name="Submit" value="Accepter et envoyer" />
</label></td>
</tr>
</form></table>
<p class="Style13"><?php echo $m; ?> </p>
</div>
</td></tr><tr><td><p align="center" class="Style5"> </p>
<p align="center" class="Style8">En acceptant l’envoi de cette demande, vous autorisez un administrateur de voir certaines de vos informations personnelles :</p>
<p align="center" class="Style8">nom, prénom, date de naissance, université, niveau étude, matricule étudiant.</p></td>
</tr>
</table>
<?php
}
?>
<?php
if($_SESSION['affiche_demande']==1)
{
?>
<table align="center">
<tr>
<td><div align="center" class="Style2">
<p>Votre demande est enregistrer le <?php echo date('j/m/Y'); ?>, il faut quÂ’elle soit valider par vos parents !</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>