<?php
require_once('config.php');
require_once('future.php');
+
+function json_return($data)
+{
+ header('Content-type: application/json; charset="UTF-8"');
+ echo json_encode($data);
+ exit();
+}
+
+$backend = new AJAXBackend();
+
+$data = array();
+
+if (strlen($_POST['func'])) {
+ if (method_exists($backend, $_POST['func'])) {
+ $func = $_POST['func'];
+ $data = $backend->$func();
+ } else {
+ $data = array('error' => 'Unbekannte Funktion '.$_POST['func'].'.');
+ }
+}
+
+json_return($data);
+
?>