Commit ad4c56e1 authored by Stephane Crozat's avatar Stephane Crozat

fix commit précédent

parent 2efc16f2
......@@ -28,8 +28,9 @@ class DB {
function subList($utclogin) {
$sql = "SELECT *
FROM vSubscription
FROM vsubscription
WHERE utclogin='".$utclogin."'";
echo $sql;
$st = $this->conn->prepare($sql);
$st->execute();
$res = $st->fetchAll(PDO::FETCH_ASSOC);
......@@ -53,7 +54,7 @@ class DB {
function apiList($utclogin, $semester, $year) {
$sql = "SELECT *
FROM vApi
WHERE semester='".$semester."' AND year=".$year.";
WHERE semester='".$semester."' AND year=".$year;
$st = $this->conn->prepare($sql);
$st->execute();
$res = $st->fetchAll(PDO::FETCH_ASSOC);
......@@ -64,13 +65,13 @@ class DB {
echo '<h2>Liste des Api '.$semester.$year.'</h2>';
foreach ($res as $row) {
echo '<p>';
echo ' <a href="index.php?action=sub&api='.$row['code'].'&utclogin='.$utclogin.'">[inscription]</a> ';
echo '<a href="index.php?action=sub&api='.$row['code'].'&utclogin='.$utclogin.'">[inscription]</a> ';
echo $row['code']."-".$row['name'];
echo '</p>';
}
}
else {
echo '<h2>Aucune inscription</h2>';
echo '<h2>Aucune Api</h2>';
}
}
......
......@@ -38,7 +38,7 @@ SELECT ap.code, ap.name, ap.year, ap.semester, TO_CHAR(ap.dbegin,'TMDay FMDD TMM
FROM api ap
ORDER BY ap.year, ap.semester, ap.dbegin, ap.dend, ap.code;
CREATE OR REPLACE VIEW vSubscrition AS
CREATE OR REPLACE VIEW vSubscription AS
SELECT ap.*, TO_CHAR(su.subdate,'DD/MM/YYYY') AS subdate, su.utclogin
FROM subscribe su JOIN vApi ap ON ap.code=su.api
ORDER BY ap.year, ap.semester, ap.dbegin, ap.dend, ap.code, su.utclogin;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment