From: Joey Schulze Date: Sun, 7 Apr 2013 15:26:24 +0000 (+0000) Subject: Backend for AJAX calls X-Git-Url: https://git.infodrom.org/?p=infodrom.org%2Fservice.infodrom.org;a=commitdiff_plain;h=ec318c0fff9b094ed5d951eaf8ef64e9bc166fb5 Backend for AJAX calls --- diff --git a/src/InfoCon/stempel/index.wml b/src/InfoCon/stempel/index.wml index 3ec1a59..24bdee2 100644 --- a/src/InfoCon/stempel/index.wml +++ b/src/InfoCon/stempel/index.wml @@ -7,6 +7,17 @@ pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!"); + if ($_POST['func'] == 'save') { + $sql = sprintf("UPDATE stempel SET task = '%s' WHERE oid = %d", + pg_escape_string($_POST['task']), + $_POST['oid']); + pg_exec($sql); + + header('Content-type: application/json; charset="UTF-8"'); + echo json_encode(true); + exit; + } + if (isset($_GET['month'])) $month = $_GET['month']; else