]>
Commit | Line | Data |
---|---|---|
e46efced | 1 | <?php |
2 | /** | |
3 | * poche, a read it later open source system | |
4 | * | |
5 | * @category poche | |
6 | * @author Nicolas Lœuillet <nicolas@loeuillet.org> | |
7 | * @copyright 2013 | |
8 | * @license http://www.wtfpl.net/ see COPYING file | |
9 | */ | |
10 | ||
11 | include dirname(__FILE__).'/inc/config.php'; | |
12 | $db = new db(DB_PATH); | |
13 | ||
14 | $action = (isset ($_GET['action'])) ? htmlspecialchars($_GET['action']) : ''; | |
15 | $id = (isset ($_GET['id'])) ? htmlspecialchars($_GET['id']) : ''; | |
16 | ||
17 | ||
18 | switch ($action) | |
19 | { | |
20 | case 'toggle_fav' : | |
21 | $sql_action = "UPDATE entries SET is_fav=~is_fav WHERE id=?"; | |
22 | $params_action = array($id); | |
23 | break; | |
24 | case 'toggle_archive' : | |
25 | $sql_action = "UPDATE entries SET is_read=~is_read WHERE id=?"; | |
26 | $params_action = array($id); | |
27 | break; | |
28 | default: | |
29 | break; | |
30 | } | |
31 | ||
32 | # action query | |
33 | if (isset($sql_action)) | |
34 | { | |
35 | $query = $db->getHandle()->prepare($sql_action); | |
36 | $query->execute($params_action); | |
37 | } | |
38 | ?> |