Recherche un Employe

Tar06 Messages postés 120 Date d'inscription vendredi 27 mars 2015 Statut Membre Dernière intervention 5 juillet 2023 - Modifié par Tar06 le 16/05/2015 à 04:56
Tar06 Messages postés 120 Date d'inscription vendredi 27 mars 2015 Statut Membre Dernière intervention 5 juillet 2023 - 17 mai 2015 à 02:58
Bonjour,
la souci c'est que je veux que quand je saisi le matricule dans la zone de saisi et je tape recherche dans l'image(voi l'image) l'employe s'affiche dans la table en bas du de la zone sans quitter la page ni faire un autre affichage dehors de la page .


Le code de la page affiche_employe.php

<?php
require_once 'connexionBDD.php';


/*echo "<pre> Variables GET : <br>";
print_r($_GET);
echo "</pre>"; */

$sup = isset($_GET['sup']) ? $_GET['sup'] : NULL;
$id = isset($_GET['Id_emp']) ? $_GET['Id_emp'] : NULL;


if($sup=='supprimer' && $id) {

$sql="DELETE FROM employer
WHERE Id_emp='$id' ";
$req = mysql_query($sql) or die('<b>ERREUR !</b><br>'.mysql_error().'<br><b>REQUETE </b><br>'.$sql);

mysql_close();
header('location:Menu.php');

}

?>




<!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" xml:lang="en" lang="en">
<head>
<title>Gestion_Employe</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="author" content="Moctar ould Mohamed" />
<script type="text/javascript">
function affiche(page)
{
$('#divConteneur').load(page);
}
</script>
<link rel="stylesheet" href="design.css" type="text/css" />
</head>
<body>

<div id="left">
<img src="logo.jpg" WIDTH='200%' HEIGHT='150'/>
</div>
<div id="center">


<img src="mau.jpg" WIDTH='800%' HEIGHT='150'/>
</div>
<div id="right">

<img src="logo.jpg" WIDTH='200%' HEIGHT='150'/>
</div>

</div>

<div id="content6">

<fieldset style="background-color:#fff;-webkit-border-radius:.9em;-moz-border-radius:.9em;">

<legend><h3>Liste Des Employes</h3></legend>
<div class="agauche"><li> <h3>Ajouter Un Employe<a onclick="affiche('ajouter_employe.php')"><img src="ima.jpg"></h3></a></li>
<form action="Affiche_employe.php" method="POST">
<input type="text" name="Chercher" />
<a onClick="affiche('recherche_employe.php')"/><input type="submit" value="Chercher" /></a>
</form>

</div>
<table border="4" bordercolor="green" width="100%">

<tr><td>Matricule</td><td>Nom_Prenom</td><td>Adresse</td><td>Direction</td><td>Service</td><td>Division</td><td>Date_Naissance</td><td>Date_Recrutement</td><td>Sexe</td><td>Situation Familiale</td><td>Carte_Identite</td><td>Caisse</td><td>Categorie</td><td>Grade</td><td>Age</td><td>Edit</td></tr>

<?php
require_once 'connexionBDD.php';
$sel="select * from employer";
$lig=mysql_query($sel);
?>
<?php
while($lign=mysql_fetch_array($lig)){
?>
<tr>
<td><?php echo $lign['matricule']; ?></td>
<td><?php echo $lign['nom_prenom']; ?></td>
<td><?php echo $lign['adresse']; ?></td>
<td><?php echo $lign['direction']; ?></td>
<td><?php echo $lign['service']; ?></td>
<td><?php echo $lign['division']; ?></td>
<td><?php echo $lign['date_naissance']; ?></td>
<td><?php echo $lign['date_recrutement']; ?></td>
<td><?php if($lign['sexe']==1){ echo "Homme"; }else echo "Femme"; ?></td>
<td><?php if($lign['situ_famil']==1){ echo "Marie"; }else echo "Celibataire"; ?></td>
<td><?php echo $lign['carte_Identite']; ?></td>
<td><?php echo $lign['caisse']; ?></td>
<td><?php echo $lign['categorie']; ?></td>
<td><?php echo $lign['grade']; ?></td>
<td><?php echo $lign['age']; ?></td>
<td>
<a href = "affiche_employe.php?Id_emp=<?php echo $lign['Id_emp']; ?>&sup=supprimer" onclick= "javascript:return confirm('Vous voulez vraiment supprimer ?')">
<img src="supprimer.gif">

</a>
<?php

$data = array(
'Id_emp'=>$lign['Id_emp']
,'matricule'=>$lign['matricule']
,'nom_prenom'=>$lign['nom_prenom']
,'adresse'=>$lign['adresse']
,'Service'=>$lign['service']
,'date_naissance'=>$lign['date_naissance']
,'date_recrutement'=>$lign['date_recrutement']
,'sexe'=>$lign['sexe']
,'situ_famil'=>$lign['situ_famil']
,'carte_Identite'=>$lign['carte_Identite']
,'categorie'=>$lign['categorie']
,'grade'=>$lign['grade']
,'age'=>$lign['age']
);


$url = "modifier_employer.php?" . http_build_query($data);

//echo "Url => ".$url;

?>
<a onclick="affiche('<?php echo ($url); ?>')">
<img src="icone_modifier.gif" title="modifier"></img>
</a>
</td>
</tr>

<?php } ?>

</fieldset></form>

</table>
<center>

</center>
</div><!-- end content -->
</div><!-- end inner -->
</div><!-- end outer -->

<div id="footer"></div>
</div><!-- end container -->
</body></html>

Cordialement

1 réponse

Tar06 Messages postés 120 Date d'inscription vendredi 27 mars 2015 Statut Membre Dernière intervention 5 juillet 2023
17 mai 2015 à 02:58
Une Idée ou une solution S'il vous plait
Cordialement
0
Rejoignez-nous