Skip to content
Snippets Groups Projects
Commit defce51c authored by Rico van Endern's avatar Rico van Endern
Browse files

hotifx for json format

parent b70f6654
No related branches found
No related tags found
No related merge requests found
...@@ -272,16 +272,16 @@ class GERICHT { ...@@ -272,16 +272,16 @@ class GERICHT {
public function toJson($inc_original = true, $inc_short = true, $inc_art = true, $inc_kind = true, $inc_img = true, $inc_stoffe = true, $inc_date = true) { public function toJson($inc_original = true, $inc_short = true, $inc_art = true, $inc_kind = true, $inc_img = true, $inc_stoffe = true, $inc_date = true) {
$json = "{"; $json = "{";
if ($inc_original) { if ($inc_original) {
$json .= '"originalText": "' . $this->originalText; $json .= '"originalText": "' . $this->originalText . '"';
} }
if ($inc_original && ($inc_short || $inc_art || $inc_kind || $inc_img || $inc_stoffe || $inc_date)) { if ($inc_original && ($inc_short || $inc_art || $inc_kind || $inc_img || $inc_stoffe || $inc_date)) {
$json .= '",'; $json .= ',';
} }
if ($inc_short) { if ($inc_short) {
$json .= '"shortText": "' . $this->shortText; $json .= '"shortText": "' . $this->shortText . '"';
} }
if ($inc_short && ($inc_art || $inc_kind || $inc_img || $inc_stoffe || $inc_date)) { if ($inc_short && ($inc_art || $inc_kind || $inc_img || $inc_stoffe || $inc_date)) {
$json .= '",'; $json .= ',';
} }
if ($inc_art) { if ($inc_art) {
$json .= '"rind":' . $this->rind; $json .= '"rind":' . $this->rind;
...@@ -294,22 +294,22 @@ class GERICHT { ...@@ -294,22 +294,22 @@ class GERICHT {
$json .= '",'; $json .= '",';
$json .= '"vegetarisch":' . $this->vegetarisch; $json .= '"vegetarisch":' . $this->vegetarisch;
$json .= '",'; $json .= '",';
$json .= '"vegan":' . $this->vegan; $json .= '"vegan":' . $this->vegan . '"';
} }
if ($inc_art && ($inc_kind || $inc_img || $inc_stoffe || $inc_date)) { if ($inc_art && ($inc_kind || $inc_img || $inc_stoffe || $inc_date)) {
$json .= '",'; $json .= ',';
} }
if ($inc_kind) { if ($inc_kind) {
$json .= '"kinderteller":' . $this->kinderteller; $json .= '"kinderteller":' . $this->kinderteller . '"';
} }
if ($inc_kind && ($inc_img || $inc_stoffe || $inc_date)) { if ($inc_kind && ($inc_img || $inc_stoffe || $inc_date)) {
$json .= '",'; $json .= ',';
} }
if ($inc_img) { if ($inc_img) {
$json .= '"image": "' . $this->image; $json .= '"image": "' . $this->image . '"';
} }
if ($inc_img && ($inc_stoffe || $inc_date)) { if ($inc_img && ($inc_stoffe || $inc_date)) {
$json .= '",'; $json .= ',';
} }
if ($inc_stoffe) { if ($inc_stoffe) {
$json .= '"zusatzStoffe": {' . '"0":' . $this->zusatzStoffe [0] . ',' . '"1":' . $this->zusatzStoffe [1] . ',' . '"2":' . $this->zusatzStoffe [2] . ',' . '"3":' . $this->zusatzStoffe [3] . ',' . '"4":' . $this->zusatzStoffe [4] . ',' . '"5":' . $this->zusatzStoffe [5] . ',' . '"6":' . $this->zusatzStoffe [6] . ',' . '"7":' . $this->zusatzStoffe [7] . ',' . '"8":' . $this->zusatzStoffe [8] . ',' . '"9":' . $this->zusatzStoffe [9] . ',' . '"10":' . $this->zusatzStoffe [10] . ',' . '"11":' . $this->zusatzStoffe [11] . ',' . '"12":' . $this->zusatzStoffe [12] . ',' . '"13":' . $this->zusatzStoffe [13] . ',' . '"14":' . $this->zusatzStoffe [14] . ',' . '"15":' . $this->zusatzStoffe [15] . ',' . '"16":' . $this->zusatzStoffe [16] . ',' . '"17":' . $this->zusatzStoffe [17] . ',' . '"18":' . $this->zusatzStoffe [18] . ',' . '"19":' . $this->zusatzStoffe [19] . ',' . '"20":' . $this->zusatzStoffe [20] . ',' . '"21":' . $this->zusatzStoffe [21] . ',' . '"22":' . $this->zusatzStoffe [22] . ',' . '"23":' . $this->zusatzStoffe [23] . ',' . '"24":' . $this->zusatzStoffe [24] . ',' . '"25":' . $this->zusatzStoffe [25] . ',' . '"26":' . $this->zusatzStoffe [26] . ',' . '"27":' . $this->zusatzStoffe [27] . ',' . '"28":' . $this->zusatzStoffe [28] . ',' . '"29":' . $this->zusatzStoffe [29] . ',' . '"30":' . $this->zusatzStoffe [30] . ',' . '"31":' . $this->zusatzStoffe [31] . ',' . '"32":' . $this->zusatzStoffe [32] . ',' . '"33":' . $this->zusatzStoffe [33] . '}'; $json .= '"zusatzStoffe": {' . '"0":' . $this->zusatzStoffe [0] . ',' . '"1":' . $this->zusatzStoffe [1] . ',' . '"2":' . $this->zusatzStoffe [2] . ',' . '"3":' . $this->zusatzStoffe [3] . ',' . '"4":' . $this->zusatzStoffe [4] . ',' . '"5":' . $this->zusatzStoffe [5] . ',' . '"6":' . $this->zusatzStoffe [6] . ',' . '"7":' . $this->zusatzStoffe [7] . ',' . '"8":' . $this->zusatzStoffe [8] . ',' . '"9":' . $this->zusatzStoffe [9] . ',' . '"10":' . $this->zusatzStoffe [10] . ',' . '"11":' . $this->zusatzStoffe [11] . ',' . '"12":' . $this->zusatzStoffe [12] . ',' . '"13":' . $this->zusatzStoffe [13] . ',' . '"14":' . $this->zusatzStoffe [14] . ',' . '"15":' . $this->zusatzStoffe [15] . ',' . '"16":' . $this->zusatzStoffe [16] . ',' . '"17":' . $this->zusatzStoffe [17] . ',' . '"18":' . $this->zusatzStoffe [18] . ',' . '"19":' . $this->zusatzStoffe [19] . ',' . '"20":' . $this->zusatzStoffe [20] . ',' . '"21":' . $this->zusatzStoffe [21] . ',' . '"22":' . $this->zusatzStoffe [22] . ',' . '"23":' . $this->zusatzStoffe [23] . ',' . '"24":' . $this->zusatzStoffe [24] . ',' . '"25":' . $this->zusatzStoffe [25] . ',' . '"26":' . $this->zusatzStoffe [26] . ',' . '"27":' . $this->zusatzStoffe [27] . ',' . '"28":' . $this->zusatzStoffe [28] . ',' . '"29":' . $this->zusatzStoffe [29] . ',' . '"30":' . $this->zusatzStoffe [30] . ',' . '"31":' . $this->zusatzStoffe [31] . ',' . '"32":' . $this->zusatzStoffe [32] . ',' . '"33":' . $this->zusatzStoffe [33] . '}';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment