--- /dev/null
+<?php
+
+require_once('../config.php');
+require_once('../lib/general.php');
+
+
+function fetch($mask)
+{
+ $sql = sprintf('SELECT id,%s FROM %s WHERE id = %d',
+ implode(',', array_keys($mask['edit'])),
+ $mask['table'], $_POST['id']);
+ error_log($sql);
+ $sth = pg_query($sql);
+}
+
+function format_ajax($data)
+{
+ header('Content-type: application/json; charset=UTF-8');
+ echo json_encode($data);
+ exit;
+}
+
+if (empty($_POST['func']))
+ exit;
+
+if (empty($_POST['mask']))
+ exit;
+
+connect_db();
+if (load_mask($_POST['mask'], '../') === false) exit;
+
+if ($_POST['func'] == 'fetch') {
+ format_ajax(fetch($mask));
+} elseif ($_POST['func'] == 'save') {
+ error_log('save');
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+require_once('config.php');
+require_once('lib/general.php');
+
+$jsfiles = array('lib/json_parse.js');
+$jscode = '';
+$html = process();
+
+$html .= debug_info();
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Kostenleistungsrechnung</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<?=load_js($jsfiles, $jscode);?>
+<link href="stylesheet.css" rel="stylesheet" type="text/css">
+</head>
+<body>
+<?=$html; ?>
+</body>
+</html>