From e46efced1b2c19ca0f628207b70b28a30fcbc288 Mon Sep 17 00:00:00 2001 From: nicosomb Date: Tue, 9 Apr 2013 15:05:49 +0200 Subject: =?UTF-8?q?utilisation=20de=20jquery=20pour=20traitement=20ajax=20?= =?UTF-8?q?mise=20en=20page=20de=20la=20grille,=20type=20Masonry=20(m?= =?UTF-8?q?=C3=A9thode=20full=20css).=20cf=20ici=20:=20http://designshack.?= =?UTF-8?q?net/articles/css/masonry/=20r=C3=A9organisation=20des=20fichier?= =?UTF-8?q?s=20avec=20un=20fichier=20d=C3=A9di=C3=A9=20pour=20le=20traitem?= =?UTF-8?q?ent=20des=20actions=20(process.php)=20utilisation=20de=20pictos?= =?UTF-8?q?=20=C3=A0=20la=20place=20des=20codes=20h=C3=A9xas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 process.php (limited to 'process.php') diff --git a/process.php b/process.php new file mode 100644 index 00000000..ef258308 --- /dev/null +++ b/process.php @@ -0,0 +1,38 @@ + + * @copyright 2013 + * @license http://www.wtfpl.net/ see COPYING file + */ + +include dirname(__FILE__).'/inc/config.php'; +$db = new db(DB_PATH); + +$action = (isset ($_GET['action'])) ? htmlspecialchars($_GET['action']) : ''; +$id = (isset ($_GET['id'])) ? htmlspecialchars($_GET['id']) : ''; + + +switch ($action) +{ + case 'toggle_fav' : + $sql_action = "UPDATE entries SET is_fav=~is_fav WHERE id=?"; + $params_action = array($id); + break; + case 'toggle_archive' : + $sql_action = "UPDATE entries SET is_read=~is_read WHERE id=?"; + $params_action = array($id); + break; + default: + break; +} + +# action query +if (isset($sql_action)) +{ + $query = $db->getHandle()->prepare($sql_action); + $query->execute($params_action); +} +?> \ No newline at end of file -- cgit v1.2.3