salut tous le monde ,
svp j'ai besoin d'aide
je veux afficher un tableau selon deux conditions
je vais expliquer bien
j'ai un formulaire et selon id il va m'afficher la résultat
selon cet algorithme
si je clique sur compte sociéte
if($_GET['compte']==1)
id_agent =1
et on affiche le tableau
si je clique sur compte commenwealth
if($_GET['compte']==2)
id_agent =2
et on affiche le tableau
si je clique sur parametre sociéte
if($_GET['compte']==3)
id_agent =1
et on affiche le formulaire form
et
si je clique sur compte commenwealth
if($_GET['compte']==4)
id_agent =2
et on affiche le formulaire form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<center>
<table cellpadding="1" cellspacing="1"><tr>
<td bgcolor="#CC9900" width=100>
<center><a href="admin.php?fn=gest_compte&compte=1">compte societé</a></center>
</td>
<td bgcolor="#CC9900" width=100>
<center><a href="admin.php?fn=gest_compte&compte=2">compte commenwealth</a></center>
</td>
<td bgcolor="#CC9900" width=100>
<center><a href="admin.php?fn=gest_compte&compte=3">parametre societé</a></center>
<td bgcolor="#CC9900" width=100>
<center><a href="admin.php?fn=gest_compte&compte=4">parametre commenwealth</a></center>
</td>
</tr></table>
</center>
<?php
if(isset($_GET['compte']))
{
if(isset($_POST['submit']))
{
if(is_numeric($_POST['rib']) && is_numeric($_POST['suift']) && is_numeric($_POST['iban']))
{
mysql_query("update compte_agt set nom_agc='".$_POST['nom_agc']."', rib=".$_POST['rib'].", suift=".$_POST['suift'].", iban=".$_POST['iban']." where id_agent=".$id)or die("erreur");
echo "<script>alert('modification reussie');</script>";
}
else
echo "les parametres sont incorrectes";
}
$req=mysql_query("select * from compte_agt where id_agent=".$id);
$res=mysql_fetch_array($req);
?>
<h2>parametre compte</h2>
<form name="form" method="post" class="form">
<table cellpadding="1" cellspacing="1">
<tr>
<td><span class="box2">nom de l'agence:</span></td>
<td><span class="box2"><input type="text" name="nom_agc" class="input" value="<?=$res['nom_agc']; ?>"/></span></td>
</tr>
<tr>
<td><span class="box2">RIB:</span></td>
<td><span class="box2"><input name="rib"class="input" value="<?=$res['rib']; ?>" /></span></td>
</tr>
<tr>
<td><span class="box2">SUIFT:</span></td>
<td><span class="box2"><input name="suift"class="input" value="<?=$res['suift']; ?>" /></span></td>
</tr>
<tr>
<td><span class="box2">IBAN:</span></td>
<td><span class="box2"><input name="iban"class="input" value="<?=$res['iban']; ?>"/></span></td>
</tr>
<tr>
<td></td>
<td><span class="box2">
<input type="submit" value="Enregistrer" name="submit" class="btt"/>
<input name="Reset" type="reset" class="btt" value="Annuler"/>
</span></td>
</tr>
</table>
</form>
<?php
}else
{
$id_compte=libelle("compte_agt","id_agent",$id,"id_compte","_ct");
$sql="select * from lign_compte WHERE id_compte='$id_compte' ";
if(isset($_GET['page']))
$p=$_GET['page'];
else
$p=1;
$limit1=($p-1)*5;
$limit2=5;
$sql.=" limit ".$limit1.",".$limit2;
$req2=mysql_query($sql)or die ('erreur:'.mysql_error());
$nb_page=ceil(mysql_num_rows($req2)/5);
if($nb_page==0)
$nb_page=1;
?>
<table cellpadding="1" cellspacing="1" width="100%">
<tr>
<td><div id="left"><span class="box1">reference</span></div></td>
<td><div id="left"><span class="box1">projet</span></div></td>
<td><div id="left"><span class="box1">commission</span></div></td>
<td><div id="left"><span class="box1">etat commission</span></div></td>
</tr>
<?
if(mysql_num_rows($req2)==0)
echo "<tr bgcolor='#E7EBFE'><td colspan=4><center>aucun enregistrement</center></td></tr>";
else{
while($res2= mysql_fetch_array($req2))
{
?>
<tr bgcolor="#E7EBFE">
<td><div id="left"><span class="box"><?php echo $res2['reference']?></span></div></td>
<td><div id="left"><span class="box"><?php echo libelle("projet","id_projet",$res2['id_projet'],"libelle_prj","_n");?> </span></div></td>
<td><div id="left"><span class="box"><?php echo $res2['commission']?> DT</span></div></td>
<td><div id="left"><span class="box"><?php if($res2['etat_comm']==1){ ?>
<img src="img/wait.jpg" />
<?php }if($res2['etat_comm']==2){?>
<img src="img/valid.png" />
<?php }?>
</span></div></td>
</tr>
<? }} ?>
</table>
<br />
<center>