Php-pdo-oracle: affichage de la selection de 3 listes déroulantes
Bonjour chère amis , encore moi , je suis débutant en php
je dois faire un formulaire qui utilisent 3 listes déroulantes :
- une liste déroulante : type de vélo
-une liste déroulante : id Equipement
-une liste déroulante : date
-un bouton de validation
Toujours avec une seul table : tmp_trip_data.
je dois afficher le resultat des éléments sélectionner et valider
|
|
|
|
TypeVelo |
|
V140 (TTD_EQUIP_ID) |
|
V120_id (TTD_EQUIP_ID) |
BMX |
|
2358 |
|
2380 |
Vtt |
|
2383 |
|
2381 |
Atala |
|
2389 |
|
2388 |
BTWIN |
|
2386 |
|
2409 |
CERVELO |
|
2385 |
|
2384
|
l'unique table que nous avons : tmp_trip_data:
Table : TMP_TRIP_DATA |
|
libellés |
TTD_EQUIP_ID |
|
Numéro de l’équipement |
TTD_CREATION_DT |
|
Date |
TTD_TYPE_VELO |
|
Type de vélo |
TTD_DISTANCE_PER_DAY |
|
Distance |
TTD_TOTAL_NUMBER_A |
|
Number_Arrival |
TTD_TOTAL_NUMBER_D |
|
Number_Departure |
TTD_TOTAL_NUMBER_T |
|
Number_T |
TTD_GPS_ACC_RATE |
|
Number_of_Alerts |
TTD_GPS_OFFSET_RATE |
|
GPS_availability_per_d |
|
voici le code de mon formulaire : quand , je fais ainsi je vois bien mes 3 listes déroulantes qui contiennent des données mais le gros soucis , je n'arrivent pas à avoir l'affichage de mes données après sélections des 3 données et validation.
chaque liste déroulante que j'ai faite réalise respectivement une requête sur les champs TTD_CREATION_DT , TTD_TYPE_VELO , TTD_DEV_ID
comme infos : mes listes déroulantes affichent bien les informations de TTD_CREATION_DT , TTD_TYPE_VELO , TTD_DEV_ID dans la table TMP_TRIP_DATA.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Liste déroulante test</title>
</head>
<body>
<form method="post" action="traitement20.php">
<label for="tmp_trip_data">quel est le type de velo ?</label><br />
<select name="tmp_trip_data" id="tmp_trip_data">
<?php
require('db_connect_oracle_payd.php');
$reponse = $conn->query('SELECT * FROM tmp_trip_data');
while ($donnees = $reponse->fetch())
{
?>
<option value=" <?php echo $donnees['TTD_TYPE_VELO']; ?>"> <?php echo $donnees['TTD_TYPE_VELO']; ?></option>
<?php
}
$reponse->closeCursor();
?>
</select>
<label for="tmp_trip_data">quel est le type de device ?</label><br />
<select name="tmp_trip_data" id="tmp_trip_data">
<?php
require('db_connect_oracle_payd.php');
$reponse = $conn->query('SELECT * FROM tmp_trip_data');
while ($donnees = $reponse->fetch())
{
?>
<option value=" <?php echo $donnees['TTD_DEV_ID']; ?>"> <?php echo $donnees['TTD_DEV_ID']; ?></option>
<?php
}
$reponse->closeCursor();
?>
</select>
</select>
<label for="tmp_trip_data">quel est la date du FT ?</label><br />
<select name="tmp_trip_data" id="tmp_trip_data">
<?php
require('db_connect_oracle_payd.php');
$reponse = $conn->query('SELECT * FROM tmp_trip_data');
while ($donnees = $reponse->fetch())
{
?>
<option value=" <?php echo $donnees['TTD_CREATION_DT']; ?>"> <?php echo $donnees['TTD_CREATION_DT']; ?></option>
<?php
}
$reponse->closeCursor();
?>
</select>
<p>
<input type="submit" value="Envoyer" />
</p>
</form>
</body>
</html> |
voici mon fichier de traitement :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EQUIPEMENT-VELO-METRIQUES</title>
<style type="text/css">
<!--
.Style2 {
font-size: 36pt;
font-weight: bold;
font-style: italic;
font-family: "Arial Narrow ", Times, serif;
}
-->
</style>
</head>
<body>
<div align="center">
<font color="red"><span class="Style2">MONITORING</span></font>
<p><img src="images/imags25.jpg" alt="" width="800" height="10" /> </p>
</div>
<p align="left"><em><font size="5"> Data of the FT in decreasing order of date:</font></em></p>
<br>
<br>
<table border="10">
<tr>
<th>DAY</th><th>DEVICE_ID</th><th>TYPE_CARS</th>
</tr>
<?php
$DATE = Date("d/m/Y H:i:s");
require('db_connect_oracle_payd.php');
// sélection de la base de données
$msg_erreur = "Erreur. Les champs suivants doivent être obligatoirement remplis :<br/><br/>";
$msg_ok = "Votre demande a bien été prise en compte.";
$message = $msg_erreur;
if (empty($_POST['TTD_TYPE_VELO']))
$message .= "Vos type de cars<br/>";
if (empty($_POST['TTD_DEV_ID']))
$message .= "Vos ID DEVICE<br/>";
if (empty($_POST['TTD_CREATION_DT']))
$message .= "Vos date de creation <br/>";
foreach($conn->query("select * from tmp_trip_data where ttd_dev_id='".$_POST['TTD_DEV_ID']."' and TTD_TYPE_VELO='".$_POST['TTD_TYPE_VELO']."' and TTD_CREATION_DT='".$_POST['TTD_CREATION_DT']."' ") as $row){
?>
<tr>
<td><?php echo $row['TTD_CREATION_DT']; ?></td><td><?php echo $row['TTD_DEV_ID']; ?></td><td><?php echo $row['TTD_TYPE_VELO']; ?></td>
</tr>
<?php } ?>
</table border="10"> |
J'ai une erreur sur la ligne 59 , ou se trouve mon foreach :
Citation:
SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: TTD_DEV_ID in C:\wamp\www\liste_deroulante\traitement20.php on line 59
Call Stack
# Time Memory Function Location
1 0.0489 262080 {main}( ) ..\traitement20.php:0
( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: TTD_TYPE_VELO in C:\wamp\www\liste_deroulante\traitement20.php on line 59
Call Stack
# Time Memory Function Location
1 0.0489 262080 {main}( ) ..\traitement20.php:0