Commit 0923c316 authored by Stephane Crozat's avatar Stephane Crozat
Browse files

Trombinoscope

parents 66ecbcc8 10d1bbf3
...@@ -16,7 +16,10 @@ else { ...@@ -16,7 +16,10 @@ else {
$view->printHtmlBegin($admin); $view->printHtmlBegin($admin);
$view->printUser($db->isResp($_SESSION['utclogin']), $db->isAdmin($_SESSION['utclogin'])); $view->printUser($db->isResp($_SESSION['utclogin']), $db->isAdmin($_SESSION['utclogin']));
<<<<<<< HEAD
=======
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
$view->apiStudents($db->apiStudents($_SESSION['utclogin'],$_GET['api'])); $view->apiStudents($db->apiStudents($_SESSION['utclogin'],$_GET['api']));
} }
......
...@@ -203,17 +203,30 @@ class DB { ...@@ -203,17 +203,30 @@ class DB {
} }
} }
<<<<<<< HEAD
public function apiStudents($utclogin, $api) { public function apiStudents($utclogin, $api) {
if ($this->isAdmin($utclogin)) { if ($this->isAdmin($utclogin)) {
$sql = 'SELECT * $sql = 'SELECT *
FROM vsubscription FROM vsubscription
WHERE id=:api AND resplogin=:utclogin AND validation 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 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
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
} }
else { else {
$sql = 'SELECT * $sql = 'SELECT *
FROM vsubscription FROM vsubscription
<<<<<<< HEAD
WHERE id=:api AND resplogin=:utclogin AND validation WHERE id=:api AND resplogin=:utclogin AND validation
=======
WHERE id=:api AND resplogin=:utclogin
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
ORDER BY surname, firstname'; ORDER BY surname, firstname';
} }
$st = $this->conn->prepare($sql); $st = $this->conn->prepare($sql);
......
...@@ -150,8 +150,12 @@ class Views { ...@@ -150,8 +150,12 @@ class Views {
if ($api != $sub['id']) { if ($api != $sub['id']) {
$api = $sub['id']; $api = $sub['id'];
echo '<hr/>'; echo '<hr/>';
<<<<<<< HEAD
echo '<h2>'.$this->printApi($sub).'</h2>'; echo '<h2>'.$this->printApi($sub).'</h2>';
echo "<div><a href='api.php?api=$api'>> Trombinoscope</a></div>"; echo "<div><a href='api.php?api=$api'>> Trombinoscope</a></div>";
=======
echo '<h2>'.$this->printApi($sub)." <a href='api.php?api=$api'>*</a></h2>";
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
} }
if ($sub['utclogin']) { if ($sub['utclogin']) {
if ($sub['validation']) { if ($sub['validation']) {
...@@ -179,18 +183,25 @@ class Views { ...@@ -179,18 +183,25 @@ class Views {
public function apiStudents($students) { public function apiStudents($students) {
echo "<hr/>"; echo "<hr/>";
<<<<<<< HEAD
if (isset($students[0])) { if (isset($students[0])) {
echo '<h2>'.$this->printApi($students[0]).'</h2>'; echo '<h2>'.$this->printApi($students[0]).'</h2>';
} }
else { else {
echo '<h2>Aucun inscrit</h2>'; echo '<h2>Aucun inscrit</h2>';
} }
=======
>>>>>>> 10d1bbf37f4ad6b12420efdfcb6831c4670fe24b
foreach ($students as $s) { foreach ($students as $s) {
echo "<div class='student'> echo "<div class='student'>
<img src='https://demeter.utc.fr/portal/pls/portal30/portal30.get_photo_utilisateur?username=$s[utclogin]' <img src='https://demeter.utc.fr/portal/pls/portal30/portal30.get_photo_utilisateur?username=$s[utclogin]'
height='100px' height='100px'
width='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]'>$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>"; </div>";
} }
} }
......
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