forked from LamCiuLoeng/BookShare
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
18 lines (14 loc) · 724 Bytes
/
index.php
File metadata and controls
18 lines (14 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
//session_start();
require_once('util.php');
$smarty = getSmartyInstance();
$qty = 7;
$db = getDBInstance();
$new_books = $db->get_results("select * from books order by create_time desc limit $qty;");
$art_books = $db->get_results("SELECT b.* FROM books b, categories c ,book_category bc where b.id=bc.book_id and c.id=bc.category_id and c.name='art' LIMIT $qty;");
$comic_books = $db->get_results("SELECT b.* FROM books b, categories c ,book_category bc where b.id=bc.book_id and c.id=bc.category_id and c.name='comic' LIMIT $qty;");
$smarty->assign('new_books',$new_books);
$smarty->assign('art_books',$art_books);
$smarty->assign('comic_books',$comic_books);
$smarty->display('index.html');
?>