le 21/04/2010 à 11:58
Problème d'affichage avec fieldset
ok je vais essayer ça mais je ne pense pas que ça viens de la.
je vous remercie
je vous remercie
<?php
<?php
include_once ('verif_admin.php');
?>
<?php
session_start();
//error_reporting(E_ALL);
/****************************/
require_once('../config.php');
require_once('../fonctions.php');
$titre_page='Mise à jour de commandes';
include_once('../haut.php');
echo'<link href="../style.css" rel="stylesheet" type="text/css" />';
/****************************/
//$pseudo=formulaires($_POST['pseudo']);
/****************************/
if(!empty($_POST['etat']))
{
print_r($_POST['id']);
}
else
{
// Nous affichons notre tableau des commandes
echo'<form method="post" action="etat_commande.php">';
$entete = array('Client','N° Commande','Date commande','Fichier','Q','Etat','Date livraison','Expédition');
echo'<div align="center" ><r><strong>Liste des clients enregistées - Mettre à jour de l\'état des commandes</strong></r><br />';
echo'<table width="1150" height="40" border="1" align="center" bgcolor=#FF0000>
<colgroup>
<col style="width: 150px">
<col style="width: 120px">
<col style="width: 100px">
<col style="width: 200px">
<col style="width: 60px">
<col style="width: 200px">
<col style="width: 100px">
<col style="width: 220px">
</colgroup>
<tr>
<th scope="col">'.$entete[0].'</th>
<th scope="col">'.$entete[1].'</th>
<th scope="col">'.$entete[2].'</th>
<th scope="col">'.$entete[3].'</th>
<th scope="col">'.$entete[4].'</th>
<th scope="col">'.$entete[5].'</th>
<th scope="col">'.$entete[6].'</th>
<th scope="col">'.$entete[7].'</th>
</tr>
</table>';
$result = mysql_query("SELECT nom, prenom,ref_com, date_com, fichier_com, Q, etat, date_livraison, expedition,id_c FROM commandes ORDER BY id_c DESC") or die ('Impossible de sélectionner une base de donnée.'.mysql_error());
$i=0;
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
/****Modification de la date : Américan vers Europe**********/
$date_comm = $row[3];
$date_liv = $row[7];
$date_comm = preg_replace('!^([0-9]{4})+-([0-9]{2})+-([0-9]{2})$!', '$3/$2/$1', $date_comm); #Modifiation de la date
$date_liv = preg_replace('!^([0-9]{4})+-([0-9]{2})+-([0-9]{2})$!', '$3/$2/$1', $date_liv); #Modifiation de la date
$row[3] = $date_comm ;
$row[7] = $date_liv ;
/***************************************************************/
echo'<table width="1150" height="40" border="1" align="center" >
<colgroup>
<col style="width: 150px">
<col style="width: 120px">
<col style="width: 100px">
<col style="width: 200px">
<col style="width: 60px">
<col style="width: 200px">
<col style="width: 100px">
<col style="width: 220px">
</colgroup>
<tr>
<th scope="col" ><b>'.$row[1].' '.$row[0].'</b></th>
<th scope="col" >'.$row[2].'</th>
<th scope="col" >'.$row[3].'</th>
<th scope="col" >'.$row[4].'</th>
<th scope="col" >'.$row[5].'</th>
<th scope="col" ><b>'.$row[6].'</b>
<select name="etat[]">';
$status = array('NEWS','EN COURS','EXPEDITION','TERMINEE');
foreach ($status as $valeur) {
$selected = ($valeur == $row[6]) ? 'selected="selected"' : '';
echo '<option value="'.$valeur.'" '.$selected.'>'.$valeur.'</option>'; }
echo'</select>
</th>
<th scope="col" >'.$row[7].'</th>
<th scope="col" >'.$row[8].'</th>
</tr>
</table>';
$id[$i++]=$row[9];
}
echo'<br/><label><input type="submit" value="Mettre à jour" /></label></form>';
}
?>
<html>
<head>
<title>xxxx : Mise à jour de commandes</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
r {
color:red;
}
b {
color:blue;
}
-->
</style>
</head>
<body>
<div align="center"><a href="http://xxx/xxxx_admin/membre_admin.php"> Retour</a></div>
<?php
//include_once('../bas.php');
?>
</body>
</html>
?>
<?php
<?php
include_once ('verif_admin.php');
?>
<?php
session_start();
error_reporting(E_ALL);
/****************************/
require_once('../config.php');
require_once('../fonctions.php');
$titre_page='Mise à jour de commandes';
include_once('../haut.php');
echo'<link href="../style.css" rel="stylesheet" type="text/css" />';
/****************************/
//$pseudo=formulaires($_POST['pseudo']);
/****************************/
if(!empty($_POST['etat']))
{
foreach($_POST['etat'] as $val)
{
echo $val,'<br />';
//echo $pseudoo,'<br />';
mysql_query("UPDATE commandes SET etat='$val'") or die ('Impossible de sélectionner une base
de donnée.'.mysql_error());
echo'<div align="center" ><r><strong>L\'état de commande "'.$val.'" à été bien met à jour</strong></r><br />';
}
}
else
{
// Nous affichons notre tableau des commandes
echo'<form method="post" action="etat_commande.php">';
$entete = array('Client','N° Commande','Date commande','Fichier','Q','Etat','Date livraison','Expédition');
echo'<div align="center" ><r><strong>Liste des clients enregistées - Mettre à jour de l\'état des commandes</strong></r><br />';
echo'<table width="1150" height="40" border="1" align="center" bgcolor=#FF0000>
<colgroup>
<col style="width: 150px">
<col style="width: 120px">
<col style="width: 100px">
<col style="width: 200px">
<col style="width: 60px">
<col style="width: 200px">
<col style="width: 100px">
<col style="width: 220px">
</colgroup>
<tr>
<th scope="col">'.$entete[0].'</th>
<th scope="col">'.$entete[1].'</th>
<th scope="col">'.$entete[2].'</th>
<th scope="col">'.$entete[3].'</th>
<th scope="col">'.$entete[4].'</th>
<th scope="col">'.$entete[5].'</th>
<th scope="col">'.$entete[6].'</th>
<th scope="col">'.$entete[7].'</th>
</tr>
</table>';
$result = mysql_query("SELECT nom, prenom,ref_com, date_com, fichier_com, Q, etat, date_livraison, expedition,pseudo_com FROM commandes ORDER BY id_c DESC") or die ('Impossible de sélectionner une base de donnée.'.mysql_error());
$i=0;
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
/****Modification de la date : Américan vers Europe**********/
$date_comm = $row[3];
$date_liv = $row[7];
$date_comm = preg_replace('!^([0-9]{4})+-([0-9]{2})+-([0-9]{2})$!', '$3/$2/$1', $date_comm); #Modifiation de la date
$date_liv = preg_replace('!^([0-9]{4})+-([0-9]{2})+-([0-9]{2})$!', '$3/$2/$1', $date_liv); #Modifiation de la date
$row[3] = $date_comm ;
$row[7] = $date_liv ;
/***************************************************************/
echo'<table width="1150" height="40" border="1" align="center" >
<colgroup>
<col style="width: 150px">
<col style="width: 120px">
<col style="width: 100px">
<col style="width: 200px">
<col style="width: 60px">
<col style="width: 200px">
<col style="width: 100px">
<col style="width: 220px">
</colgroup>
<tr>
<th scope="col" ><b>'.$row[1].' '.$row[0].'</b></th>
<th scope="col" >'.$row[2].'</th>
<th scope="col" >'.$row[3].'</th>
<th scope="col" >'.$row[4].'</th>
<th scope="col" >'.$row[5].'</th>
<th scope="col" ><b>'.$row[6].'</b>
<select name="etat[]">';
$status = array('NEWS','EN COURS','EXPEDITION','TERMINEE');
foreach ($status as $valeur) {
$selected = ($valeur == $row[6]) ? 'selected="selected"' : '';
echo '<option value="'.$valeur.'" '.$selected.'>'.$valeur.'</option>'; }
echo'</select>
</th>
<th scope="col" >'.$row[7].'</th>
<th scope="col" >'.$row[8].'</th>
</tr>
</table>';
$pseudoo=$row[9];
//printf("ID : %s Nom : %s", $row[0], $row[1]);
}
echo'<br/><label><input type="submit" value="Mettre à jour" /></label></form>';
}
/*if (isset($_POST['checkbox'])){
for ($i = 0, $c = count($_POST['checkbox']); $i < $c; $i++) { echo '<br/><b>' .$_POST['checkbox'][$i]. '</b>'; }
}
$tab_quand = $_POST['checkbox']; //$tab_quand est un tableau, attention !!!!
foreach($tab_quand as $checkbox)
{
echo $checkbox.' ';
}*/
?>
<html>
<head>
<title>xxxx : Mise à jour de commandes</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
r {
color:red;
}
b {
color:blue;
}
-->
</style>
</head>
<body>
<div align="center"><a href="http://xxxx/xxx_admin/membre_admin.php"> Retour</a></div>
<?php
include_once('../bas.php');
?>
?>