Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
apisub
Commits
ad4c56e1
Commit
ad4c56e1
authored
Nov 06, 2018
by
Stephane Crozat
Browse files
fix commit précédent
parent
2efc16f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/db.php
View file @
ad4c56e1
...
...
@@ -28,8 +28,9 @@ class DB {
function
subList
(
$utclogin
)
{
$sql
=
"SELECT *
FROM v
S
ubscription
FROM v
s
ubscription
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>'
;
}
}
...
...
sql/apisub.sql
View file @
ad4c56e1
...
...
@@ -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
vSubscri
p
tion
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment