0")); $load = intval($load['l']); if ($load < $study['learn_rate']) { $next_card = mysql_fetch_assoc(sql("SELECT * FROM cards WHERE deck = " . $study['deckid'] . " AND number = " . ($study['last_card'] + 1))); } $filters = array( "what" => array( "level > 0 AND next_review <= CURDATE()" => "study today", "level > 0 AND level < 4" => "learning", "level > 0" => "all except skipped", "level = 0" => "skipped", ), "order" => array( "level" => "level", "number" => "card number", ), "way" => $ord_ways, ); $fdefaults = array( "what" => "level > 0 AND level < 4", "order" => "level", "way" => "ASC", ); $study_cards = array(); $s = sql( "SELECT cards.id AS id, cards.name AS name, cards.text_html AS text, cards.number AS number, ". "card_study.level AS level, card_study.next_review <= CURDATE() AS must_study ". "FROM card_study LEFT JOIN cards ON card_study.card = cards.id WHERE deck_study = $studyid AND " . get_filter("what") . " ORDER BY " . get_filter("order") . " " . get_filter('way')); while ($ss = mysql_fetch_assoc($s)) $study_cards[] = $ss; require("tpl/study/deck.php");