-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dossier.php
executable file
·64 lines (57 loc) · 1.8 KB
/
Dossier.php
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
<?php
$titre = "Détails d'un dossier";
include('entete.php');
// construction de la requete
$requete = ("
SELECT nDossier
FROM LesDossiers
ORDER BY nDossier
");
// analyse de la requete et association au curseur
$curseur = oci_parse ($lien, $requete) ;
// execution de la requete
$ok = @oci_execute ($curseur) ;
// on teste $ok pour voir si oci_execute s'est bien passé
if (!$ok) {
// oci_execute a échoué, on affiche l'erreur
$error_message = oci_error($curseur);
echo "<p class=\"erreur\">{$error_message['message']}</p>";
}
else {
// oci_execute a réussi, on fetch sur le premier résultat
$res = oci_fetch ($curseur);
if (!$res) {
// il n'y a aucun résultat
echo "<p class=\"erreur\"><b>Aucun dossier dans la base de données</b></p>" ;
}
else {
// on affiche le formulaire de sélection
echo ("
<form action=\"Dossier_action.php\" method=\"post\">
<label for=\"sel_nDossier\">Sélectionnez un dossier :</label>
<select id=\"sel_nDossier\" name=\"nDossier\">
");
// création des options
do {
$nDossier = oci_result($curseur, 1);
echo ("<option value=\"$nDossier\">$nDossier</option>");
} while ($res = oci_fetch ($curseur));
echo ("
</select>
<br /><br />
<input type=\"submit\" value=\"Valider\" />
<input type=\"reset\" value=\"Annuler\" />
</form>
");
}
}
// on libère le curseur
oci_free_statement($curseur);
// travail à réaliser
echo ("
<p class=\"work\">
Modifiez cet enchaînement de scripts afin d'afficher pour chaque dossier, en plus des informations déjà fournies, sa date d'émission et pour chacune des places associés, le nom, la forme, la catégorie et la date de l'épreuve'.
</p>
");
include('pied.php');
?>