All pastes #833719 Raw Edit

Miscellany

public text v1 · immutable
#833719 ·published 2007-12-27 15:51 UTC
rendered paste body
<table cellspacing="0" cellpadding="0" width="100%" border="0" id="menu">

        <tr align="center">

          <td id="headmenu"><a class="menuHead" href="index.php?id=2">Ajout client</a></td>

          <td class="separator"></td>

          <td id="headmenu" ><a class="menuHead" href="index.php?id=6">Liste client</a></td>

          <td class="separator"></td>

          <td id="headmenu"><a class="menuHead" href="index.php?id=7">Modif info client</a></td>

          <td class="separator"></td>

          <td id="headmenu"><a class="menuHead" href="<{$xoops_url}>/modules/info/index.php?cat=3&id=1">Menu</a></td>

          <td class="separator"></td>

          <td id="headmenu"><a class="menuHead" href="<{$xoops_url}>/modules/contact/index.php">Menu</a></td>

          <td class="separator"></td>

          <td id="headmenu"><a class="menuHead" href="<{$xoops_url}>/admin.php">Menu</a> </td>

        </tr>

   

  </table>



<h1>Liste des clients</h1>

<br>

<?php 



include("config_db.php");//fichier de configuration bdd







$connexion = mysql_connect ("$dbhost", "$dbid", "$dbpass") or die ('Impossible de se connecter à la base de données: ' . mysql_error());//connexion bdd



$db = mysql_select_db("$dbname") or die ("erreur de connexion base"); //selection de la base



$query = ("SELECT DISTINCT id_client, nom, adresse, cp, ville, telephone FROM client ORDER BY nom"); //selection de la table + champs

$result = mysql_query($query);



?>

<table cellspacing='0' cellpadding='0' width='98%' border='1'>



	<tr  class="head" height="18px" valign="bottom">

		<td align='center' width='20%'>Nom du client</td>

		<td align='center' width='30%' >Adresse</td>

		<td align='center' width='15%' >Code Postal</td>

		<td align='center' width='15%' >Ville</td>

		<td align='center' width='15%' >Téléphone</td>

		<td align='center' width='5%'>Détails</td>		

	</tr>



<?php



while( $ligne = mysql_fetch_array($result))



{



extract($ligne);



$num = $ligne["id_client"];





?>



	<tr id='head'>

		<td align='center' class="even" "onmouseover="this.style.backgroundColor='#f6f6f6';"

 onmouseout="this.style.backgroundColor='#eeeeee';"> <?php echo $ligne['nom']; ?> </td>

		<td align='center' class="even" "onmouseover="this.style.backgroundColor='#f6f6f6';"

 onmouseout="this.style.backgroundColor='#eeeeee';"> <?php echo $ligne['adresse']; ?> </td>

		<td align='center' class="even" "onmouseover="this.style.backgroundColor='#f6f6f6';"

 onmouseout="this.style.backgroundColor='#eeeeee';"> <?php echo $ligne['cp']; ?> </td>

<td align='center' class="even" "onmouseover="this.style.backgroundColor='#f6f6f6';"

 onmouseout="this.style.backgroundColor='#eeeeee';"> <?php echo $ligne['ville']; ?> </td>

<td align='center'   class="even"  "onmouseover="this.style.backgroundColor='#f6f6f6';"

 onmouseout="this.style.backgroundColor='#eeeeee';"> <?php echo $ligne['telephone']; ?></td>	

	<td align='center'   class="even" "onmouseover="this.style.backgroundColor='#f6f6f6';"

 onmouseout="this.style.backgroundColor='#eeeeee';"><a href="mod_client.php?num=<?php echo($id_client); ?>">=X=</a></td>

	</tr>	

<?php

}



mysql_close(); // Déconnexion de MySQL

?>

</table>

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


<?php



if(isset($_GET['num']))      $id_client=$_GET['num'];

else      $id_client="";



include("config_db.php");//fichier de configuration bdd







$connexion = mysql_connect ("$dbhost", "$dbid", "$dbpass") or die ('Impossible de se connecter à la base de données: ' . mysql_error());//connexion bdd



$db = mysql_select_db("$dbname") or die ("erreur de connexion base"); //selection de la base

$reponse = mysql_query('SELECT DISTINCT nom, adresse, cp, ville, telephone FROM client WHERE id_client=$id_client');



while ($donnees = mysql_fetch_array($reponse) )

{

?> 

<h1>Formulaire de mise à jour du client</h1>

<br>

<table>

<tr>

<form method="GET" action="index.php?id=8">

<td width='50%' style='padding-left:100px'>Nom du Client</td>

<td width='50%'><input type="text" name="nom" size="40" value="<?php echo $donnees['nom']; ?>" maxlength="35"></td>

</tr>

<tr>

<td width='50%' style='padding-left:100px'>Adresse</td>

<td width='50%'><input type="text" name="adresse" size="40" value="<?php echo $donnees['adresse']; ?>" maxlength="35"></td>

</tr>

<tr>

<td width='50%' style='padding-left:100px'>Code Postal</td>

<td width='50%'><input type="text" name="cp" size="40" value="<?php echo $donnees['cp']; ?>" maxlength="70"></td>

</tr>

<tr>

<td width='50%' style='padding-left:100px'>Ville</td>

<td width='50%'><input type="text" name="ville" size="40" value="<?php echo $donnees['ville']; ?>" maxlength="11"></td>

</tr>

<tr>

<td width='50%' style='padding-left:100px'>Téléphone</td>

<td width='50%'><input type="text" name="telephone" size="40" value="<?php echo $donnees['telephone']; ?>" maxlength="11"></td>

</tr>

<tr>

<td width='50%' align='center'></td>

<td width='50%'>

<input type="submit" value="Mettre à jour  le client" name="Ajouter">

</form>

</td>

</tr>

</table>

<?php

}



mysql_close(); // Déconnexion de MySQL

?>