fetch_array($db->query_db("select * from levels where active=1 order by is_test desc")); $num_of_questions=$db->fetch_array($db->query_db("select level_id,count(id) as counter from questions group by level_id")); $non_question=$db->fetch_array($db->query_db("select id from levels where id not in(select level_id from questions)")); $full_mark=$db->fetch_array($db->query_db("select level_id,sum(mark) as total_mark from questions group by level_id")); $smarty->assign('levels', $levels); $smarty->assign('num_of_questions', $num_of_questions); $smarty->assign('full_mark', $full_mark); $smarty->assign('non_question', $non_question); $smarty->assign('page_title', "الصفحة الرئيسية"); $smarty->display('header.tpl'); $smarty->display('index.tpl'); $smarty->display('footer.tpl'); ?>