hafsa_rani
Bonjour tout le monde et désolée pour le dérangement chaque fois..
J'ai une page web où je fait la consultation des données de ma base de données j'ai 2 bouton, un qui redirige vers la page de modification que j'ai indiqué dans l'action du form <form action="edit.php" method="GET">..
l'autre bouton je veux qu'il effectue la suppression d'un enregistrement et au cas où je coche tous les cases je veux qu'un autre bouton effectue la suppression de tous les enregistrements,est ce que quelqu'un peux m'aider??
/**************************Voici le code:****************************/
<?php
//session_start();
$db='ma_database';
$host='localhost';
$user='user';
$mp='pw';
$conn=mysql_connect($host,$user,$mp);
@mysql_select_db($db,$conn);
$page='message.html';
$req=mysql_query("SELECT * FROM revendeurs");
$nbrcol=mysql_num_fields($req);
$nbrart=mysql_num_rows($req);
//$del=mysql_query("DELETE FROM revendeurs WHERE raison_social='".$_POST['raison_social']."'");
?>
<!DOCTYPE html PUBLIC "-//W3C//Dth XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/Dth/xhtml1-strict.dth">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../../../../css/entreprise/entreprise.css" type="text/css" rel="stylesheet" media="all" />
<link href="../css/msg.css" type="text/css" rel="stylesheet" media="all" />
<!--<link type="text/css" rel="stylesheet" href="../css/form_css/boxes1.css" media="all" />-->
<script type="text/javascript" src="../js/controls.js"></script>
<script type="text/javascript" language="javascript">
function ConfirmDeleteMessage(URL)
{
if (confirm("Confirmez-vous la suppression ?"))
{
window.location = URL;
}
}
</script>
<style>
label
{
font-size:11px;
font-weight:normal;
}
th label
{
font-weight:bold;
}
</style>
<title> Base de données Revendeurs </title>
</head>
<body style="padding-top:12px;padding-left:12px;padding-right:12px;overflow:auto" >
<fieldset class="cadremaj">
<legend style="font-style: italic;font-weight:bold;font-size:13px;color:#22475e">Base de Données Revendeurs</legend>
<div class="">
<?php
if (mysql_num_rows($req)==0)
{
echo'Lecture Impossible';
}
Else
{
?>
<!----><form name="list_update" action="./edit.php" method="GET">
<table border="1" class="tab">
<thead> <tr>
<th> </th>
<th><label>ID</label></th>
<th>
<label>Raison sociale</label>
<!--<input type="button" onClick="<?php // $req=mysql_query("SELECT * FROM entreprise_abonnees ORDER BY raison_social DESC");?>" value="Raison Sociale" />-->
</th>
<th style="padding:0 45px;padding-left:82px;">
<label style="margin-left:-50px;">Domaine d'activité</label>
</th>
<th style="padding:0 90px;">
<label>Adresse</label>
</th>
<th style="padding:0 5px;">
<label>Code Postal</label>
</th>
<th>
<label>Ville</label>
</th>
<th style="padding: 0pt 45px;padding-left:82px;">
<label style="margin-left: -40px">Région</label>
</th>
<th style="padding:0 20px;">
<label>Téléphone</label>
</th>
<th style="padding:0 31px;">
<label>Fax</label>
</th>
<th>
<label>Responsable</label>
</th>
<th style="padding:0 20px;">
<label>GSM</label>
</th>
<th style="padding:0 30px;padding-left:72px;">
<label style="margin-left:-50px;">Site Web</label>
</th>
<th>
<label>E-mail</label>
</th>
<th style="padding:0 30px;padding-left:72px">
<label style="margin-left:-50px;">Date de Création</label>
</th>
<th style="padding:0 20px;">
<label >Capital Social</label>
</th>
<th></th>
</tr>
</thead>
<?php
$classesTD = array('#b0dcf8', '#eaf4fb');
$nombre = count($classesTD);
$i= 0;
while ($donnees=mysql_fetch_assoc($req)) {
$i++;
?>
<form name="list_update" action="./edit.php" method="GET" >
<tr style="background-color:<?php echo $donnees['couleur'] ?>">
<td><input type='submit' value='' name='submit' style="background: url(../../../../css/entreprise/images/bn.gif) no-repeat transparent ;border:none;margin:2px;width:24px;height:22px " /></td> <!--<a href='./update/update_BDE.php'><img src='../../../../css/entreprise/images/bn.gif' style='border:none'/></a>-->
<td><label><?php echo $i; ?></label></td>
<td><input class="input" style="background-color:<?php echo $donnees['couleur'] ?>" type="textarea" name="raison_social" value="<?php echo $donnees['raison_social'] ?>" />
<td> <label name="domaine_activ" > <?php echo $donnees['domaine_activite'] ?> </td>
<td> <label name="adress" > <?php echo $donnees['adresse'] ?> </td>
<td> <label name="codep" > <?php echo $donnees['codepostal'] ?> </td>
<td> <label name="ville" > <?php echo $donnees['ville'] ?> </td>
<td> <label name="ville" > <?php echo $donnees['region'] ?> </td>
<td> <label name="tel" > <?php echo $donnees['telephone'] ?> </td>
<td> <label name="fax" > <?php echo $donnees['fax'] ?> </td>
<td> <label name="resp" > <?php echo $donnees['responsable'] ?> </td>
<td> <label name="gsm" > <?php echo $donnees['gsm'] ?> </td>
<td> <label name="site" > <?php echo $donnees['siteweb'] ?> </td>
<td> <label name="mail" > <?php echo $donnees['email'] ?> </td>
<td> <label name="date" > <?php echo $donnees['date_creation'] ?> </td>
<td> <label name="capital" > <?php echo $donnees['capitalsocial'] ?> </td>
<td><input type="checkbox" /></td>
<td><input type="button" name="del" style="background:url(update/delete.png);border:none;width:48px;height:48px" value="" onclick=""/></td>
</tr>
</form>
<?php
} ?>
</table>
<!-- </tbody> --></form>
<?php mysql_close(); }?>
</div>
</fieldset>
</body>
</html>
/******************************Fin*******************************/
autre demande si quelqu'un peut me dire comment je peux afficher chaque ligne en différente couleur et comment les lignes soit cliquable pour accéder à la page edit.php, et comment je peux faire le filtre des données selon chaque colone.
Je sais que j'ai posé beaucoup de question mais j'aime que quelqu'un peut m'aider, merci infiniment à tout le monde. et je souhaite à tout le monde bon courage.