summaryrefslogtreecommitdiff
path: root/tpl/study/lib_sidebar.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:07:29 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:07:29 +0200
commita565e649898c629874ef812a13806b1c384f68e4 (patch)
treeafc03ed12ec7e82ce17bcfff5ba76440ff43eb97 /tpl/study/lib_sidebar.php
parent8d9321225140a3db0b72796d4d0236d6cacfeb8a (diff)
downloadBits-a565e649898c629874ef812a13806b1c384f68e4.tar.gz
Bits-a565e649898c629874ef812a13806b1c384f68e4.zip
Added study program. Yay!
Diffstat (limited to 'tpl/study/lib_sidebar.php')
-rw-r--r--tpl/study/lib_sidebar.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/tpl/study/lib_sidebar.php b/tpl/study/lib_sidebar.php
index 61bb11a..820d0bd 100644
--- a/tpl/study/lib_sidebar.php
+++ b/tpl/study/lib_sidebar.php
@@ -1,18 +1,26 @@
<?php
if ($user['id'] != 0) {
+ $studying_decks = array();
+ $d = sql("SELECT deck_study.id AS id, decks.name AS name, account.login AS username FROM deck_study ".
+ "LEFT JOIN decks ON decks.id = deck_study.deck LEFT JOIN account ON account.id = decks.owner ".
+ "WHERE deck_study.user = ".$user['id']);
+ while($dd = mysql_fetch_assoc($d)) $studying_decks[] = $dd;
+
$my_decks = array();
$d = sql("SELECT id, name FROM decks WHERE owner = " . $user['id']);
while ($dd = mysql_fetch_assoc($d)) $my_decks[] = $dd;
echo '</div><div class="contents-left">';
echo '<h1>Studying decks</h1><ul>';
- //LIST
+ foreach($studying_decks as $deck) {
+ echo '<li><code>'.$deck['username'].':<a href="deck-study-' . $deck['id'] . '">' . $deck['name'] . '</a></code></li>';
+ }
echo '<li><a class="tool_link" href="deck">[+] Show all decks</a></li></ul>';
echo '<h1>My decks</h1><ul>';
foreach($my_decks as $deck) {
- echo '<li><a href="view-deck-' . $deck['id'] . '">' . $deck['name'] . '</a></li>';
+ echo '<li><code><a href="view-deck-' . $deck['id'] . '">' . $deck['name'] . '</a></code></li>';
}
echo '<li><a class="tool_link" href="new-deck">[+] Create deck</a></li></ul>';
}