diff --git a/README.md b/README.md
index bcd30ba..3b8fed6 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
-# stattbuchung_php_open
+# FE-StattBuchung
+Frontend PHP-Anwendung zur Anbindung von Stattbuchung an eine eigene Webseite
\ No newline at end of file
diff --git a/ajax.php b/ajax.php
new file mode 100644
index 0000000..a6ec65b
--- /dev/null
+++ b/ajax.php
@@ -0,0 +1,136 @@
+ $postdata['de_stattbuchung_event_Modul'],
+ "anrede"=>$postdata['anrede'],
+ "vorname"=>$postdata['vorname'],
+ "nachname"=>$postdata['nachname'],
+ "strasse"=>$postdata['strasse'],
+ "plz"=>$postdata['plz'],
+ "ort"=>$postdata['ort'],
+ "email"=>$postdata['email'],
+ "telefon"=>$postdata['telefon'],
+ "institution"=>$postdata['institution'],
+ "geburtsdatum"=>$gebdate->format(DateTime::ATOM),
+ "de_bidat_av_Profiltyp_geburtsort"=>$postdata['geburtsort'],
+ "kommentar"=>$postdata['kommentar'],
+ "de_stattbuchung_event_Modul"=>$postdata['de_stattbuchung_event_Modul'],
+ "de_stattbuchung_Kanal"=>$apikey,
+ "de_stattbuchung_Verkaufsstelle"=>$verkaufstelle,
+ "systems_sdw_fi_Zahlungsart"=>$zahlungsart,
+ "systems_sdw_hr_Angestellter"=>$oidang
+ );
+
+ foreach ($postdata as $key => $value) {
+ if(strpos($key, "de_stattbuchung_Teilnehmerart_") === 0) {
+ $params[$key] = $value;
+ }
+ }
+
+ $resp=post($sessionInfo, opcPaymentStepOne, $params, "{}", $debug) ;
+
+
+ return $resp;
+}
+
+
+/**
+ * Main.
+ *
+ */
+
+try {
+ $sessionInfo=login($ini['host'], $ini['user'], $ini['psw'], $debug);
+
+ date_default_timezone_set('Europe/Berlin');
+
+ //$resp=get($sessionInfo, opcObjectlistProdukt, $params, $debug) ;
+
+ $treffpunktid = $_GET['treffpunkt'];
+ $registerid = $_GET['register'];
+ $modulid = $_GET['modul'];
+ $modultermine = $_GET['modultermine'];
+
+ $formid = $_GET['form'];
+ $stichwortkey = $_GET['stichwort'];
+
+ $monat = $_GET['monat'];
+ $jahr = $_GET['jahr'];
+ $maxResult = $_GET['maxResultLength'];
+ $teaser = $_GET['teaser'];
+ $viewStyle = $_GET['style'];
+
+ $verkaufstelle = $ini['de_stattbuchung_Verkaufsstelle'];
+ $zahlungsart = $ini['systems_sdw_fi_Zahlungsart'];
+
+
+
+ if($registerid == 872) {
+
+ $resp = sendAnmeldung($registerid, $sessionInfo, $ini['apikey'], $ini['oid_ang'], $verkaufstelle, $zahlungsart, $_POST);
+
+ if($ini['paypal'] == true) {
+ header('Content-type: application/json');
+ echo json_encode($resp);
+ }
+
+ //renderAnmeldeformular($resp, $sessionInfo, $ini['paypal'], 2);
+
+
+
+ }
+ // Ausloggen nicht vergessen!
+ logoff($sessionInfo, $debug);
+
+} catch (Exception $e) {
+ echo 'Exception: '.$e->getMessage()." code: ".$e->getCode()."
";
+}
+
+
+?>
diff --git a/app.php b/app.php
new file mode 100644
index 0000000..b2c8ff4
--- /dev/null
+++ b/app.php
@@ -0,0 +1,462 @@
+
+
+
+
+
+
+";
+ echo "
Die Suche nach ".$query." ergab ".$resp["items"][0]["resultSetCount"]." Teffer
";
+ $queryresult = $resp["items"];
+
+ foreach ($resp[items][0][items] as $produkt) {
+ echo "
";
+ }
+ echo "
";
+ echo "
";
+
+}
+
+
+function renderAnmeldeformular($resp, $sessionInfo) {
+ echo "
";
+ echo "";
+ echo "";
+
+
+
+ echo "";
+
+
+
+
+}
+
+
+function renderTerminliste($resp, $sessionInfo, $query) {
+ echo "
";
+ echo "Termin | Datum, Uhrzeit | max. Teilnehmer | aktuelle Teilnehmer | verfügbare Plätze | Anmelden |
";
+
+ echo "";
+ date_default_timezone_set('Europe/Berlin');
+
+ foreach ($resp[items][0][items] as $termin) {
+ $von = new DateTime($termin["von"]);
+
+ echo "";
+ echo "";
+ echo"".$termin["produkt_titel"]."";
+ echo " | ";
+
+ echo "";
+ //echo $termin["von"];
+ echo $von->format('j.m.Y \a\b H:i');
+ echo " | ";
+
+ echo "";
+ echo $termin["maxtn"];
+ echo " | ";
+
+ echo "";
+ echo $termin["tn"];
+ echo " | ";
+
+ echo "";
+ echo $termin["maxtn"] - $termin["tn"];
+ echo " | ";
+
+
+ echo "";
+
+ renderAnmeldeButton($termin["maxtn"], $termin["tn"], $termin["oid"]);
+ echo " | ";
+
+
+ echo "
";
+ }
+ echo "";
+ echo "
";
+
+}
+
+function renderAnmeldeButton($maxtn, $tn, $oid) {
+ if($maxtn <= $tn) {
+ echo "Keine Anmeldung möglich";
+ } else {
+ echo "
";
+ }
+}
+
+
+function fetchTermindetail($id, $sessionInfo, $apikey) {
+
+ $params=array(
+ "oid" => $id,
+ "de_stattbuchung_event_Modul"=>$id,
+ "de_stattbuchung_Kanal"=>$apikey
+ );
+ $resp=post($sessionInfo, opcFetchTermindetail, $params, "{}", $debug) ;
+
+
+ return $resp;
+}
+
+function sendAnmeldung($id, $sessionInfo, $apikey, $oidang, $postdata) {
+
+ $params=array(
+ "oid" => $postdata['de_stattbuchung_event_Modul'],
+ "anrede"=>$postdata['anrede'],
+ "vorname"=>$postdata['vorname'],
+ "nachname"=>$postdata['nachname'],
+ "strasse"=>$postdata['strasse'],
+ "plz"=>$postdata['plz'],
+ "ort"=>$postdata['ort'],
+ "email"=>$postdata['email'],
+ "kommentar"=>$postdata['kommentar'],
+ "de_stattbuchung_event_Modul"=>$postdata['de_stattbuchung_event_Modul'],
+ "de_stattbuchung_Kanal"=>$apikey,
+ "systems_sdw_hr_Angestellter"=>$oidang
+ );
+ $resp=post($sessionInfo, opcAddAnmeldung, $params, "{}", $debug) ;
+
+ # echo var_dump($resp);
+
+if($resp['beschreibung'] == 'OK') {
+ echo "
Herzlichen Dank für Ihre Anmeldung
";
+ echo "
Sie sollten in Kürze eine Nachricht über die Adresse ".$postdata['email']." erhalten.
";
+} else {
+ echo "
Ups
";
+ echo "
Bei der Anmeldung ist etwas schief gelaufen, bitte versuchen Sie es erneut
";
+
+ echo "
".$resp['beschreibung']."";
+
+}
+ return $resp;
+}
+
+function fetchTreffpunkt($id, $sessionInfo) {
+ $params=array("oid" => $id);
+ $treffpunkt=post($sessionInfo, opcFetchTreffpunkt, $params, "{}", $debug) ;
+
+ return $treffpunkt;
+}
+
+function renderTerminDetail($resp, $sessionInfo, $showmap, $cssid) {
+ $ep = $resp;
+
+
+ date_default_timezone_set('Europe/Berlin');
+ $von = new DateTime($ep["von"]);
+ $bis = new DateTime($ep["bis"]);
+
+ echo "
";
+
+
+ echo "
";
+ echo "
".$ep["produkt_titel"]."
";
+ echo "";
+ echo "
";
+
+ echo "
".$ep["produkt_beschreibung"]."
";
+
+ echo "
";
+
+ echo "Beginn | ".$von->format('j.m.Y - H:i')." |
";
+ echo "Ende | ".$bis->format('j.m.Y - H:i')." |
";
+ echo "max. Teilnehmer | ".$ep["maxtn"]." |
";
+ echo "aktuelle Teilnehmer | ".$ep["tn"]." |
";
+ echo "verfügbare Plätze | ".($ep["maxtn"]-$ep["tn"])." |
";
+ if ($ep["preis"] >0 )echo "Preis | ".$ep["preis"]." |
";
+
+ echo "Ort | ".$ep["treffpunkt_name"]." |
";
+
+ echo "
";
+
+ renderAnmeldeButton($ep["maxtn"], $ep["tn"], $ep["oid"]);
+
+ echo "
";
+ echo "
";
+
+ if($showmap) echo "
";
+}
+
+function renderTerminDetailListenansicht($resp, $sessioninfo) {
+ echo "
";
+
+ foreach ($resp[items][0][items] as $termin) {
+ renderTerminDetail($termin, $sessionInfo, false, 'bidat_list');
+ }
+ echo "
";
+
+
+}
+
+function renderProduktDetail($resp, $sessionInfo) {
+ $pc = $resp[items][0];
+ echo "
";
+
+ echo "
";
+ echo "
".$pc["name"]."
";
+ echo "
".$pc["untertitel"]."
";
+ $beschreibung = trim($pc["beschreibung"]);
+ if(strlen($beschreibung)<3) $beschreibung = lorem;
+
+ echo "
".$beschreibung."
";
+
+ echo "
";
+
+ echo "
Verfügbare Sprachen
";
+
+ foreach($pc["_sprachen_"]["items"] as $sprache) {
+ echo "- ".$sprache["label"]."
";
+ }
+
+ echo "
";
+
+ echo "
Treffpunkt
";
+ $treffpunkt = fetchTreffpunkt($pc["treffpunkt"]["oid"], $sessionInfo);
+ echo "
".$treffpunkt["name"]."
";
+ echo "
Hinweis zur Erreichbarkeit
";
+ echo "
".$treffpunkt["oepnv"]."
";
+ echo "
";
+
+ echo "
Weitere Infos
";
+ echo "
";
+ echo "
Dauer
";
+ echo "
".$pc["dauer"]." h
";
+ echo "
";
+
+ echo "
";
+ echo "
min TN
";
+ echo "
".$pc["minTN"]."
";
+ echo "
";
+
+ echo "
";
+ echo "
max TN
";
+ echo "
".$pc["maxTN"]."
";
+ echo "
";
+
+
+ echo "
";
+ echo "
";
+ echo "
";
+ echo "
";
+}
+
+/**
+ * Main.
+ *
+ */
+
+try {
+ $sessionInfo=login($ini['host'], 'nfbg', 'bobby', $debug);
+
+
+ //$resp=get($sessionInfo, opcObjectlistProdukt, $params, $debug) ;
+
+ $produktid = $_GET['produkt'];
+ $treffpunktid = $_GET['treffpunkt'];
+ $registerid = $_GET['register'];
+ $modulid = $_GET['modul'];
+ $formid = $_GET['form'];
+ $stichwortkey = $_GET['stichwort'];
+
+ if($produktid >100) {
+
+ $params=array(
+ "systems_sdw_org_Organisation"=>$ini["oid_org"],
+ "systems_sdw_hr_Angestellter"=>$ini['oid_ang'],
+ "de_stattbuchung_Produkt"=>$produktid,
+ "de_stattbuchung_Kanal"=>$ini["apikey"]
+ );
+ $resp=post($sessionInfo, opcLoadProduktContainer, $params, "{}", $debug) ;
+
+ renderProduktDetail($resp, $sessionInfo);
+
+ } else if($treffpunktid > 100) {
+
+ fetchTreffpunkt($treffpunktid, $sessionInfo);
+
+ } else if($registerid == 872) {
+
+ sendAnmeldung($registerid, $sessionInfo, $ini['apikey'], $ini['oid_ang'], $_POST);
+
+ } else if ($modulid > 100) {
+
+ renderTerminDetail(fetchTermindetail($modulid, $sessionInfo, $ini['apikey'], 'eb-event-page'), $sessionInfo);
+
+ } else if ($formid > 100) {
+
+ renderAnmeldeformular(fetchTermindetail($formid, $sessionInfo, $ini['apikey']), $sessionInfo);
+
+ } else if($treffpunktid > 100) {
+
+ renderAnmeldeformular($registerid, $sessionInfo);
+
+ } else {
+ $query =$_GET['query'];
+ $query=htmlspecialchars($query);
+
+ $params=array("oid" => "0",
+ "de_stattbuchung_Kanal"=>$ini["apikey"],
+ "maxResultLength"=>100 );
+ if($query !== '') {$params['muster']=$query;}
+
+ if($stichwortkey != 'NULL') {
+ $params['de_stattbuchung_Stichwort_key'] = $stichwortkey;
+ }
+
+
+ $jsonString ="{oid:0}";
+ $resp=post($sessionInfo, opcCalendarByChannel, $params, $jsonString, $debug) ;
+
+ if(is_null($stichwortkey)) renderTerminliste($resp, $sessionInfo, $query);
+ else renderTerminDetailListenansicht($resp, $sessioninfo);
+
+ }
+
+ // nicht vergessen!
+ logoff($sessionInfo, $debug);
+
+} catch (Exception $e) {
+ echo 'Exception: '.$e->getMessage()." code: ".$e->getCode()."
";
+}
+
+?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/client.php b/client.php
new file mode 100644
index 0000000..a76dc1e
--- /dev/null
+++ b/client.php
@@ -0,0 +1,304 @@
+ 1,
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $url.frontcontroller.'?opc='.opcLogon,
+ CURLOPT_USERAGENT => 'PHP Request '.$sessionId
+ ));
+ // Save SdessionCookie JSESSIONID returned by server
+ curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
+ curl_exec($curl);
+
+ if (curl_errno($curl)) {
+ throw new Exception(curl_error($curl), curl_errno($curl));
+ }
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if ($http_code!=httpOK) {
+ throw new Exception('HTTP-Response STATUS<>200', $http_code);
+ }
+ curl_close($curl);
+
+ // stage 2 : send credentials using sessioncookie
+ $curl = curl_init();
+
+ curl_setopt_array($curl, array(
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $url.loginform,
+ CURLOPT_USERAGENT => 'PHP Request '.$sessionId,
+ CURLOPT_POST => 1,
+ CURLOPT_HTTPHEADER => array(
+ 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
+ 'Connection: Keep-Alive'
+ )
+ ));
+ // Put credentail into postbody invisible in logs
+ curl_setopt($curl, CURLOPT_POSTFIELDS,'j_username='.urlencode($user).'&j_password='.urlencode($pass));
+ // Send SdessionCookie JSESSIONID
+ curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);
+ curl_exec($curl);
+
+ if (curl_errno($curl)) {
+ throw new Exception(curl_error($curl), curl_errno($curl));
+ }
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if ($http_code!=httpMovedTemp && $http_code!=httpMovedTempNew) {
+ throw new Exception('HTTP-Response STATUS<>302 || 303', $http_code);
+ }
+ curl_close($curl);
+
+ // stage 3: call protected ressource again which is now accessible due to 302:moved temporarily
+ $curl = curl_init();
+ curl_setopt_array($curl, array(
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $url.frontcontroller.'?opc='.opcLogon,
+ CURLOPT_USERAGENT => 'PHP Request '.$sessionId
+ ));
+
+ // Send SdessionCookie JSESSIONID
+ curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);
+ // Session has changed after logon due to security issue so save new cookie
+ curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
+
+ $longonInfo=curl_exec($curl);
+
+ if (curl_errno($curl)) {
+ throw new Exception(curl_error($curl), curl_errno($curl));
+ }
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if ($http_code!=httpOK) {
+ throw new Exception('HTTP-Response STATUS<>200', $http_code);
+ }
+ curl_close($curl);
+
+ // convert result from JSON to assoc array and add session infos
+ $sessionInfo=json_decode($longonInfo, true);
+ $sessionInfo ['sessionId'] = $sessionId;
+ $sessionInfo ['cookie'] = $cookie;
+ $sessionInfo ['url'] = $url;
+ $sessionInfo ['user'] = $user;
+ $sessionInfo ['pass'] = "";
+
+ if ($debug) showResponse($sessionInfo);
+
+ return $sessionInfo;
+}
+
+/**
+ * LogOff. Abmelden vom System und dadurch kill der Session.
+ * Ruft nur Get mit dem richtigen Opcode auf
+ * @param {Object} $sessionInfo Assoc Array, wird nach dem erfolgreichen Anmelden erzeugt, siehe login
+ * @param {Boolean} $debug Debug-Flag für Bildschirmausgaben
+ * @returns {Object} Das Ergebnis des requests, ein JOSN-Objekt das als Assoc Array zurückgegeben wird
+ */
+function logoff($sessionInfo, $debug) {
+ return get($sessionInfo, opcLogoff, null, $debug);
+}
+
+/**
+ * Get-Methode im Rahmen der geöffneten Session.
+ *
+ * Wirft Exceptions falls der request schiefläuft. Falls die Session nicht authentifiziert ist wird
+ * der Aufurf vom Tomcat stillschweigend an die Login-Seite verwiesen. Das sollte also nicht passieren.
+ *
+ * @param {Object} $sessionInfo Assoc Array, wird nach dem erfolgreichen Anmelden erzeugt, siehe login
+ * @paeam {OPCODE} $opcode Long. Der Opcode für den request
+ * @param {Object} $params Assoc Array mit Parametern fpr die URL analog zum get-Aufruf
+ * @param {String} $data JSON-Objekt als String, die Payload für den Postbody
+ * @param {Boolean} $debug Debug-Flag für Bildschirmausgaben
+ * @returns {Object} Das Ergebnis des requests, ein JOSN-Objekt das als Assoc Array zurückgegeben wird
+ */
+function get($sessionInfo, $opcode, $params, $debug) {
+
+ $url=$sessionInfo ['url'].frontcontroller.'?opc='.$opcode;
+ if ($params) {
+ foreach ($params as $name => $value) {
+ $url .= "&".urlencode($name)."=".urlencode($value);
+ }
+ }
+
+ $curl = curl_init();
+ curl_setopt_array($curl, array(
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $url,
+ CURLOPT_USERAGENT => 'PHP Request '.$sessionInfo ['sessionId']
+ ));
+
+ // Send SdessionCookie JSESSIONID
+ curl_setopt($curl, CURLOPT_COOKIEFILE, $sessionInfo ['cookie']);
+ // Session has changed et least after logon due to security issue so better save new cookie always
+ curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
+
+ $jsonString=curl_exec($curl);
+
+ if (curl_errno($curl)) {
+ throw new Exception(curl_error($curl), curl_errno($curl));
+ }
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if ($http_code!=httpOK) {
+ throw new Exception('HTTP-Response STATUS<>200', $http_code);
+ }
+ curl_close($curl);
+
+ if ($debug) showResponse(json_decode($jsonString, true));
+
+ return json_decode($jsonString, true);
+}
+
+/**
+ * Post-Methode im Rahmen der geöffneten Session.
+ *
+ * Wirft Exceptions falls der request schiefläuft. Falls die Session nicht authentifiziert ist wird
+ * der Aufurf vom Tomcat stillschweigend an die Login-Seite verwiesen. Das sollte also nicht passieren.
+ *
+ * @param {Object} $sessionInfo Assoc Array, wird nach dem erfolgriechen Anmelden erzeugt, siehe login
+ * @paeam {OPCODE} $opcode Long. Der Opcode für den request
+ * @param {Object} $params Assoc Array mit Parametern fpr die URL analog zum get-Aufruf
+ * @param {String} $data JSON-Objekt als String, die Payload für den Postbody
+ * @param {Boolean} $debug Debug-Flag für Bildschirmausgaben
+ * @returns {Object} Das Ergebnis des requests, ein JOSN-Objekt das als Assoc Array zurückgegeben wird
+ */
+function post($sessionInfo, $opcode, $params, $data, $debug) {
+
+ $url=$sessionInfo ['url'].frontcontroller.'?opc='.$opcode;
+ if ($params) {
+ foreach ($params as $name => $value) {
+ $url .= "&".urlencode($name)."=".urlencode($value);
+ }
+ }
+
+ $curl = curl_init();
+ curl_setopt_array($curl, array(
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $url,
+ CURLOPT_USERAGENT => 'PHP Request '.$sessionInfo ['sessionId'],
+ CURLOPT_POST => 1,
+ CURLOPT_HTTPHEADER => array(
+ 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
+ 'Connection: Keep-Alive'
+ )
+ ));
+
+ // Send SdessionCookie JSESSIONID
+ curl_setopt($curl, CURLOPT_COOKIEFILE, $sessionInfo ['cookie']);
+ // Session has changed et least after logon due to security issue so better save new cookie always
+ curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
+ // Put credentail into postbody invisible in logs
+ curl_setopt($curl, CURLOPT_POSTFIELDS,'data='.urlencode($data));
+ // Send SdessionCookie JSESSIONID
+ $jsonString=curl_exec($curl);
+
+ if (curl_errno($curl)) {
+ throw new Exception(curl_error($curl), curl_errno($curl));
+ }
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if ($http_code!=httpOK) {
+ throw new Exception('HTTP-Response STATUS<>200', $http_code);
+ }
+ curl_close($curl);
+
+ if ($debug) showResponse(json_decode($jsonString, true));
+
+ return json_decode($jsonString, true);
+}
+
+/**
+ * Doemload-Methode im Rahmen der geöffneten Session um ein File herunterzuladen.
+ *
+ * Wirft Exceptions falls der request schiefläuft. Falls die Session nicht authentifiziert ist wird
+ * der Aufurf vom Tomcat stillschweigend an die Login-Seite verwiesen. Das sollte also nicht passieren.
+ *
+ * @param {Object} $sessionInfo Assoc Array, wird nach dem erfolgriechen Anmelden erzeugt, siehe login
+ * @paeam {OPCODE} $opcode Long. Der Opcode für den request
+ * @param {Object} $params Assoc Array mit Parametern fpr die URL analog zum get-Aufruf
+ * @param {File} $file Geöffneter und zum Schreiben bereiter Filhandle im lokalen Dateisystem
+ * @param {Boolean} $debug Debug-Flag für Bildschirmausgaben
+ * @returns {File} Den Filehandel
+ */
+function download($sessionInfo, $opcode, $params, $file, $debug) {
+
+ $url=$sessionInfo ['url'].frontcontroller.'?opc='.$opcode;
+ if ($params) {
+ foreach ($params as $name => $value) {
+ $url .= "&".urlencode($name)."=".urlencode($value);
+ }
+ }
+
+ $curl = curl_init();
+ curl_setopt_array($curl, array(
+ CURLOPT_FILE => $file,
+ CURLOPT_TIMEOUT => 20,
+ CURLOPT_URL => $url,
+ CURLOPT_USERAGENT => 'PHP Request '.$sessionInfo ['sessionId']
+ ));
+
+ // Send SdessionCookie JSESSIONID
+ curl_setopt($curl, CURLOPT_COOKIEFILE, $sessionInfo ['cookie']);
+ // Session has changed et least after logon due to security issue so better save new cookie always
+ curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
+
+ curl_exec($curl);
+
+ if (curl_errno($curl)) {
+ throw new Exception(curl_error($curl), curl_errno($curl));
+ }
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if ($http_code!=httpOK) {
+ throw new Exception('HTTP-Response STATUS<>200', $http_code);
+ }
+ curl_close($curl);
+
+ return $file;
+}
+
+/**
+ * Helper-Methode für Debugzwecke
+ *
+ */
+function showResponse($response) {
+ foreach ($response as $name => $value) {
+ echo "$name = $value"."";
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/config.ini.example.ini b/config.ini.example.ini
new file mode 100644
index 0000000..2fe2152
--- /dev/null
+++ b/config.ini.example.ini
@@ -0,0 +1,13 @@
+[userdata]
+host = https://ej.works/SDW
+user = loginname
+psw = somethingSecret
+templatePath = templates
+apikey = auslesen aus dem Frontend Stattbuchung
+oid_org =
+oid_ang =
+de_stattbuchung_Verkaufsstelle = 00
+systems_sdw_fi_Zahlungsart = 00
+show_searchbox = false
+show_stichwort_selector = true
+seitentitel = Termine ...
diff --git a/fonts/FontAwesome.otf b/fonts/FontAwesome.otf
new file mode 100644
index 0000000..401ec0f
Binary files /dev/null and b/fonts/FontAwesome.otf differ
diff --git a/fonts/fontawesome-webfont.eot b/fonts/fontawesome-webfont.eot
new file mode 100644
index 0000000..e9f60ca
Binary files /dev/null and b/fonts/fontawesome-webfont.eot differ
diff --git a/fonts/fontawesome-webfont.svg b/fonts/fontawesome-webfont.svg
new file mode 100644
index 0000000..855c845
--- /dev/null
+++ b/fonts/fontawesome-webfont.svg
@@ -0,0 +1,2671 @@
+
+
+Sie sollten in Kürze eine Nachricht über die Adresse ".$postdata['email']." erhalten.
";
+ } else {
+ echo "