bjr à tous;
j'ai crée un tableau en php et je voudrais le trier d'une façon dynamique , c'est à dire en cliquant sur la colonne client par exemple il va nous afficher le tableau trié en fonction des nom des clients; et en cliquand sur le num commande , il nous affiche ce tabeau trie par ordre des num des commandes.
merci d'avance pour votre aide
j'ai crée un tableau en php et je voudrais le trier d'une façon dynamique , c'est à dire en cliquant sur la colonne client par exemple il va nous afficher le tableau trié en fonction des nom des clients; et en cliquand sur le num commande , il nous affiche ce tabeau trie par ordre des num des commandes.
mysql_select_db($database_connexion, $connexion);
$query_commandes = sprintf("SELECT * FROM shop_commande ORDER BY id DESC");
$commandes = mysql_query($query_commandes, $connexion) or die(mysql_error());
$row_commandes = mysql_fetch_assoc($commandes);
$totalRows_commandes = mysql_num_rows($commandes);
<table width="100%" cellpadding="5" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#FFFFFF">>Date de Commande </span></th>
<th scope="col"><span class="Style1 Style1">Facture format PDF</span></th>
</tr>
<th scope="col"><span class="Style1 Style1">Numéro de commande </span></th>
<th scope="col"><span class="Style1 Style1">Numéro de facture </span></th>
<th scope="col"><span class="Style1 Style1">Client </span></th>
<th scope="col"><span class="Style1 Style1">Poids </span></th>
<th scope="col"><span class="Style1 Style1">Total TTC </span></th>
<th scope="col"><span class="Style1"
<?php do { ?>
<?php
$date =$row_commandes['date'];
$total_ht =$row_commandes['total_ht'];
$c_total_ttc =$row_commandes['total_ttc'];
$expedition =$row_commandes['expedition'];
$client=$row_commandes['client'];
//$zone = $row_client['zone'];
$date_french= preg_replace("/([0-9].*)-([0-9].*)-([0-9].*)/" ,"\\3-\\2-\\1",$date);
$date_expedition= preg_replace("/([0-9].*)-([0-9].*)-([0-9].*)/" ,"\\3-\\2-\\1",$expedition);
$total_ttc_arrondi= number_format($c_total_ttc, 2, ',', ' ');
$date_explosee = explode("-", $date);
$annee = $date_explosee[0];
$mois = $date_explosee[1];
$jour = $date_explosee[2];
$id =$row_commandes['id'];
$id = 1000+$id;
?>
<tr bgcolor="#FFFFFF">
<td><a href="../account/detail_commande.php?id=<?php echo $row_commandes['id']; ?>" class="Style1 Style1">n°<?php echo $row_commandes['id']; ?></a></td>
<td><div align="center"><span class="Style1 Style1">n°<?php echo $annee; ?>/<?php echo $id; ?></span></div></td>
<td><div align="center"><span class="Style1 Style1"><?php echo $row_commandes['client']; ?></span></div></td>
<td><div align="right"><span class="Style1 Style1"><?php echo $row_commandes['poids']; ?>gr.</span></div></td>
<td><div align="right"><span class="Style1 Style1"><?php echo $total_ttc_arrondi; ?>€</span></div></td>
<td><div align="center"><span class="Style1"><?php echo $date_french; ?></span></div></td>
<td><div align="center"><span class="Style1"><a href="traitementAdmin_facture.php?id=<?php echo $row_commandes['id']; ?>">Facture</a></span></div></td>
</tr>
<?php } while ($row_commandes = mysql_fetch_assoc($commandes)); ?>
</table>
merci d'avance pour votre aide
