Salut Mère-teresa
je viens de regarder tes liens mais je pense qu'il ne va pas pouvoir s'intégrer a mon code actuel
Mon Pb actuellement est que j'ai un bouton qui me permet d'enregistrer les données saisies.
J'ai pensés au rechargement auto de la page avec la liste déroulante mais si tu comment je pourrai intégrer un boutton qui me permettrait d'envoyer dans l'url (par ex) le N° dudossier, je suis preneur!!!!!
voila ou j'en suis actuellement:
<?php require_once('../../Connections/ateliermeca.php'); ?>
<?php
mysql_select_db($database_ateliermeca, $ateliermeca);
$query_actionselect = "SELECT ID, NumDossier, Cloture FROM registre WHERE Cloture = 'non' ORDER BY NumDossier ASC";
$actionselect = mysql_query($query_actionselect, $ateliermeca) or die(mysql_error());
$row_actionselect = mysql_fetch_assoc($actionselect);
$totalRows_actionselect = mysql_num_rows($actionselect);
mysql_select_db($database_ateliermeca, $ateliermeca);
$query_actionrealisation = "SELECT * FROM realisations ORDER BY Liste ASC";
$actionrealisation = mysql_query($query_actionrealisation, $ateliermeca) or die(mysql_error());
$row_actionrealisation = mysql_fetch_assoc($actionrealisation);
$totalRows_actionrealisation = mysql_num_rows($actionrealisation);
mysql_select_db($database_ateliermeca, $ateliermeca);
$query_actionintervenant = "SELECT * FROM personnel ORDER BY Nom ASC";
$actionintervenant = mysql_query($query_actionintervenant, $ateliermeca) or die(mysql_error());
$row_actionintervenant = mysql_fetch_assoc($actionintervenant);
$totalRows_actionintervenant = mysql_num_rows($actionintervenant);
mysql_select_db($database_ateliermeca, $ateliermeca);
$query_actionzone = "SELECT * FROM zones ORDER BY Zones ASC";
$actionzone = mysql_query($query_actionzone, $ateliermeca) or die(mysql_error());
$row_actionzone = mysql_fetch_assoc($actionzone);
$totalRows_actionzone = mysql_num_rows($actionzone);
$maxRows_actionaffiche = 10;
$pageNum_actionaffiche = 0;
if (isset($_GET['pageNum_actionaffiche'])) {
$pageNum_actionaffiche = $_GET['pageNum_actionaffiche'];
}
$startRow_actionaffiche = $pageNum_actionaffiche * $maxRows_actionaffiche;
mysql_select_db($database_ateliermeca, $ateliermeca);
$query_actionaffiche = "SELECT actions.Realisation, actions.Intervenants, actions.Duree, actions.Heure FROM actions ORDER BY actions.Realisation";
$query_limit_actionaffiche = sprintf("%s LIMIT %d, %d", $query_actionaffiche, $startRow_actionaffiche, $maxRows_actionaffiche);
$actionaffiche = mysql_query($query_limit_actionaffiche, $ateliermeca) or die(mysql_error());
$row_actionaffiche = mysql_fetch_assoc($actionaffiche);
if (isset($_GET['totalRows_actionaffiche'])) {
$totalRows_actionaffiche = $_GET['totalRows_actionaffiche'];
} else {
$all_actionaffiche = mysql_query($query_actionaffiche);
$totalRows_actionaffiche = mysql_num_rows($all_actionaffiche);
}
$totalPages_actionaffiche = ceil($totalRows_actionaffiche/$maxRows_actionaffiche)-1;
?>
<p class="titrezone">Ajout d'une action: </p>
<?
//*********************************************
if(isset($_POST['numdossier'])){
$action = $_POST['action'];
$numdossier=$_POST['numdossier'];
$real=$_POST['real'];
$inter=$_POST['inter'];
$zone=$_POST['zone'];
$duree=$_POST['duree'];
}
else{
$action = "";
}
switch($action){
case "inserer": //INSERTION DANS LA BASE
/* déclaration de quelques variables */
$host = "localhost";
$user = "root";
$pass = "xxx";
$bdd = "ateliermeca";
$table = "actions";
/* connection avec MySQL */
@mysql_connect($host,$user,$pass) or die("Impossible de se connecter à la base de données"); // Le @ ordonne a php de ne pas afficher de message d'erreur
@mysql_select_db("$bdd") or die("Impossible de se connecter à la base de données");
/* affichage de la selection */
echo "Vous venez d'enregistrer un(e) $real, effectuée par $inter, sur la zone $zone pour une durée de $duree heure(s) concernant le dossier $numdossier";
/* stockage dans la bdd */
$query = "INSERT INTO $table (Numdossier,Realisation,Intervenants,Duree,Zones,Heure) VALUES ('" . $_POST['numdossier'] . "','" . $_POST['real'] . "','" . $_POST['inter'] . "','" . $_POST['duree'] . "','" . $_POST['zone'] . "', NOW())";
$result = mysql_query($query);
/* déconnection avec MySQL */
mysql_close();
break;
default: // FORMULAIRE HTML
?>
<br>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p>Votre numéro de dossier :
<select name="numdossier" id="numdossier">
<?php
do {
?>
<option value="<?php echo $row_actionselect['ID']?>"><?php echo $row_actionselect['NumDossier']?></option>
<?php
} while ($row_actionselect = mysql_fetch_assoc($actionselect));
$rows = mysql_num_rows($actionselect);
if($rows > 0) {
mysql_data_seek($actionselect, 0);
$row_actionselect = mysql_fetch_assoc($actionselect);
}
?>
</select>
<br>
Action effectuée:
<select name="real" id="real">
<?php
do {
?>
<option value="<?php echo $row_actionrealisation['ID']?>"><?php echo $row_actionrealisation['Liste']?></option>
<?php
} while ($row_actionrealisation = mysql_fetch_assoc($actionrealisation));
$rows = mysql_num_rows($actionrealisation);
if($rows > 0) {
mysql_data_seek($actionrealisation, 0);
$row_actionrealisation = mysql_fetch_assoc($actionrealisation);
}
?>
</select>
<br>
Intervenant :
<select name="inter" id="inter">
<?php
do {
?>
<option value="<?php echo $row_actionintervenant['ID']?>"><?php echo $row_actionintervenant['Nom']?></option>
<?php
} while ($row_actionintervenant = mysql_fetch_assoc($actionintervenant));
$rows = mysql_num_rows($actionintervenant);
if($rows > 0) {
mysql_data_seek($actionintervenant, 0);
$row_actionintervenant = mysql_fetch_assoc($actionintervenant);
}
?>
</select>
<br>
Zone concernée:
<select name="zone" id="zone">
<?php
do {
?>
<option value="<?php echo $row_actionzone['ID']?>"><?php echo $row_actionzone['Zones']?></option>
<?php
} while ($row_actionzone = mysql_fetch_assoc($actionzone));
$rows = mysql_num_rows($actionzone);
if($rows > 0) {
mysql_data_seek($actionzone, 0);
$row_actionzone = mysql_fetch_assoc($actionzone);
}
?>
</select>
<br>
Durée de la réalisation:
<input name="duree" type="text" id="duree">
<br>
<br>
<input type="submit" name="Submit" value="Ok">
<input type="hidden" name="action" value="inserer">
</p>
<table border="1">
<tr>
<td><div align="center"><strong>Realisation</strong></div></td>
<td><div align="center"><strong>Intervenants</strong></div></td>
<td><div align="center"><strong>Duree</strong></div></td>
<td><div align="center"><strong>Heure</strong></div></td>
</tr>
<?php do { ?>
<tr>
<td><div align="center"><?php echo $row_actionaffiche['Realisation']; ?></div></td>
<td><div align="center"><?php echo $row_actionaffiche['Intervenants']; ?></div></td>
<td><div align="center"><?php echo $row_actionaffiche['Duree']; ?></div></td>
<td><div align="center"><?php echo $row_actionaffiche['Heure']; ?></div></td>
</tr>
<?php } while ($row_actionaffiche = mysql_fetch_assoc($actionaffiche)); ?>
</table>
</form>
<?
break;
}
?>
est ce que tu as une petiote idée???
en tout cas, merci de ton aide!
FAb