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
1c183986
Commit
1c183986
authored
Jun 04, 2019
by
Stephane Crozat
Browse files
Merge branch 'affiche-validation'
parents
3825db5c
b08d6d61
Changes
3
Hide whitespace changes
Inline
Side-by-side
index.php
View file @
1c183986
...
...
@@ -33,9 +33,9 @@ if (isset($_GET['mode'])) {
}
else
{
/** Subscription and unsubscription management **/
if
(
isset
(
$_GET
[
'api'
])
&&
$admin
->
isActive
()
)
{
if
(
isset
(
$_GET
[
'api'
]))
{
if
(
isset
(
$_GET
[
'action'
]))
{
if
(
$_GET
[
'action'
]
==
'sub'
)
{
if
(
$_GET
[
'action'
]
==
'sub'
&&
$admin
->
isActive
()
)
{
$db
->
subToApi
(
$admin
,
$_SESSION
[
'utclogin'
],
$_GET
[
'api'
]);
}
elseif
(
$_GET
[
'action'
]
==
'unsub'
)
{
...
...
lib/db.php
View file @
1c183986
...
...
@@ -104,7 +104,11 @@ class DB {
return
$res
;
}
/** Returns T is subscriptions and unsubscription are allowed **/
/** Returns configuration parameters as:
** openbegin | openend | isactive
** ------------------------+--------------------------+----------
** mercredi 10 avril 2019 | mercredi 31 juillet 2019 | t
**/
public
function
config
()
{
$sql
=
'SELECT * FROM vconfig'
;
$st
=
$this
->
conn
->
prepare
(
$sql
);
...
...
lib/views.php
View file @
1c183986
...
...
@@ -75,7 +75,6 @@ class Views {
}
public
function
printSubList
(
$list
)
{
#KNOWN_BUB #TODO Il est possible de ses déinscrire en utilisant directement l'URL
if
(
$list
)
{
echo
'<hr/>'
;
echo
'<h2>Vos inscriptions</h2>'
;
...
...
@@ -86,13 +85,21 @@ class Views {
echo
"<h3>"
.
$this
->
printWeek
(
$row
)
.
"</h3>"
;
}
echo
'<p>'
;
if
(
$this
->
isActive
())
{
if
(
$row
[
'validation'
])
{
echo
"<span class='validation'>[validé]</span> "
;
// If student has been validated
if
(
$row
[
'validation'
])
{
echo
"<span class='validation'>[validé]</span> "
;
}
else
{
// If it has not been validated and subscription are still opened
if
(
$this
->
isActive
())
{
$msg
=
'désinscription'
;
}
// If it has not been validated and subscription are closed
else
{
echo
"<a href='index.php?action=unsub&api=
$row[id]
' class='unsub'>[désinscription]</a> "
;
echo
"<span class='validation'>[liste d'attente]</span> "
;
$msg
=
'annulation'
;
}
echo
"<a href='index.php?action=unsub&api=
$row[id]
' class='unsub'>[
$msg
]</a> "
;
}
echo
$this
->
printApi
(
$row
);
echo
'</p>'
;
...
...
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