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
0923c316
Commit
0923c316
authored
Feb 08, 2019
by
Stephane Crozat
Browse files
Trombinoscope
parents
66ecbcc8
10d1bbf3
Changes
3
Hide whitespace changes
Inline
Side-by-side
api.php
View file @
0923c316
...
...
@@ -16,7 +16,10 @@ else {
$view
->
printHtmlBegin
(
$admin
);
$view
->
printUser
(
$db
->
isResp
(
$_SESSION
[
'utclogin'
]),
$db
->
isAdmin
(
$_SESSION
[
'utclogin'
]));
<<<<<<<
HEAD
=======
>>>>>>>
10
d1bbf37f4ad6b12420efdfcb6831c4670fe24b
$view
->
apiStudents
(
$db
->
apiStudents
(
$_SESSION
[
'utclogin'
],
$_GET
[
'api'
]));
}
...
...
lib/db.php
View file @
0923c316
...
...
@@ -203,17 +203,30 @@ class DB {
}
}
<<<<<<<
HEAD
public
function
apiStudents
(
$utclogin
,
$api
)
{
if
(
$this
->
isAdmin
(
$utclogin
))
{
$sql
=
'SELECT *
FROM vsubscription
WHERE id=:api AND resplogin=:utclogin AND validation
ORDER BY surname, firstname'
;
//TODO donner accès aux admins même si ne sont pas les resp
=======
public
function
apiStudents
(
$utclogin
,
$api
)
{
if
(
$this
->
isAdmin
(
$utclogin
))
{
$sql
=
'SELECT *
FROM vsubscription
WHERE id=:api AND resplogin=:utclogin
ORDER BY surname, firstname'
;
//TODO
>>>>>>>
10
d1bbf37f4ad6b12420efdfcb6831c4670fe24b
}
else
{
$sql
=
'SELECT *
FROM vsubscription
<<<<<<< HEAD
WHERE id=:api AND resplogin=:utclogin AND validation
=======
WHERE id=:api AND resplogin=:utclogin
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
ORDER BY surname, firstname'
;
}
$st
=
$this
->
conn
->
prepare
(
$sql
);
...
...
lib/views.php
View file @
0923c316
...
...
@@ -150,8 +150,12 @@ class Views {
if
(
$api
!=
$sub
[
'id'
])
{
$api
=
$sub
[
'id'
];
echo
'<hr/>'
;
<<<<<<<
HEAD
echo
'<h2>'
.
$this
->
printApi
(
$sub
)
.
'</h2>'
;
echo
"<div><a href='api.php?api=
$api
'>> Trombinoscope</a></div>"
;
=======
echo
'<h2>'
.
$this
->
printApi
(
$sub
)
.
" <a href='api.php?api=
$api
'>*</a></h2>"
;
>>>>>>>
10
d1bbf37f4ad6b12420efdfcb6831c4670fe24b
}
if
(
$sub
[
'utclogin'
])
{
if
(
$sub
[
'validation'
])
{
...
...
@@ -179,18 +183,25 @@ class Views {
public
function
apiStudents
(
$students
)
{
echo
"<hr/>"
;
<<<<<<<
HEAD
if
(
isset
(
$students
[
0
]))
{
echo
'<h2>'
.
$this
->
printApi
(
$students
[
0
])
.
'</h2>'
;
}
else
{
echo
'<h2>Aucun inscrit</h2>'
;
}
=======
>>>>>>>
10
d1bbf37f4ad6b12420efdfcb6831c4670fe24b
foreach
(
$students
as
$s
)
{
echo
"<div class='student'>
<img src='https://demeter.utc.fr/portal/pls/portal30/portal30.get_photo_utilisateur?username=
$s[utclogin]
'
height='100px'
width='100px'/>
<<<<<<< HEAD
<span class='name'>
$s[surname]
$s[firstname]
|
$s[level]
| <a href='mailto:
$s[email]'>$s[email]
</a> (
$s[utclogin]
)</span>
=======
<span class='name'>
$s[surname]
$s[firstname]
|
$s[level]
<a href='mailto:
$s[email]'>[mail]
</a> (
$s[utclogin]
)</span>
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
</div>"
;
}
}
...
...
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