diff options
author | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-11-20 13:39:47 +0100 |
---|---|---|
committer | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-11-20 13:39:47 +0100 |
commit | d45c7f14891d951f8a6987cc6492073b97e05b5b (patch) | |
tree | d6467b1202c27f67fd8e894d25fd4aea0085b559 /tpl/study/lib_sidebar.php | |
parent | 4d7e065c2d2ec407b6a7ebfc7569628bac9149d1 (diff) | |
download | Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.tar.gz Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.zip |
Added the bit list study system
Diffstat (limited to 'tpl/study/lib_sidebar.php')
-rw-r--r-- | tpl/study/lib_sidebar.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tpl/study/lib_sidebar.php b/tpl/study/lib_sidebar.php index 820d0bd..c82d0a4 100644 --- a/tpl/study/lib_sidebar.php +++ b/tpl/study/lib_sidebar.php @@ -11,6 +11,16 @@ if ($user['id'] != 0) { $d = sql("SELECT id, name FROM decks WHERE owner = " . $user['id']); while ($dd = mysql_fetch_assoc($d)) $my_decks[] = $dd; + $studying_lists = array(); + $d = sql("SELECT list_study.id AS id, lists.name AS name, account.login AS username FROM list_study ". + "LEFT JOIN lists ON lists.id = list_study.list LEFT JOIN account ON account.id = lists.owner ". + "WHERE list_study.user = " . $user['id']); + while($dd = mysql_fetch_assoc($d)) $studying_lists[] = $dd; + + $my_lists = array(); + $d = sql("SELECT id, name FROM lists WHERE owner = " . $user['id']); + while ($dd = mysql_fetch_assoc($d)) $my_lists[] = $dd; + echo '</div><div class="contents-left">'; echo '<h1>Studying decks</h1><ul>'; foreach($studying_decks as $deck) { @@ -23,4 +33,18 @@ if ($user['id'] != 0) { 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>'; + + + echo '<h1>Studying lists</h1><ul>'; + foreach($studying_lists as $list) { + echo '<li><code>'.$list['username'].':<a href="list-study-' . $list['id'] . '">' . $list['name'] . '</a></code></li>'; + } + echo '<li><a class="tool_link" href="list">[+] Show all lists</a></li></ul>'; + + echo '<h1>My lists</h1><ul>'; + foreach($my_lists as $list) { + echo '<li><code><a href="view-list-' . $list['id'] . '">' . $list['name'] . '</a></code></li>'; + } + echo '<li><a class="tool_link" href="new-list">[+] Create list</a></li></ul>'; + } |