And that file is:
<?php
require('../../../dmxConnectLib/dmxConnect.php');
$app = new \lib\App();
$app->define(<<<'JSON'
{
"meta": {
"options": {},
"$_POST": [
{
"type": "text",
"name": "name"
},
{
"type": "text",
"name": "description"
},
{
"type": "text",
"name": "gallery"
},
{
"type": "text",
"name": "category"
},
{
"type": "text",
"name": "purchased"
},
{
"type": "text",
"name": "sold"
},
{
"type": "text",
"name": "type"
},
{
"type": "text",
"name": "species"
},
{
"type": "text",
"name": "brand"
},
{
"type": "text",
"name": "year"
},
{
"type": "number",
"name": "currentvalue"
},
{
"type": "number",
"name": "estimatedvalue"
},
{
"type": "text",
"name": "material"
},
{
"type": "text",
"name": "nrfb"
},
{
"type": "text",
"name": "unopened"
},
{
"type": "text",
"name": "condition"
},
{
"type": "text",
"name": "orginalbox"
},
{
"type": "text",
"name": "licensedbrand"
}
]
},
"exec": {
"steps": [
"Connections/connection1",
{
"name": "upload_product_image",
"module": "upload",
"action": "upload",
"options": {
"fields": "{{$_POST.gallery}}",
"path": "/images",
"replaceSpace": true,
"replaceDiacritics": true,
"asciiOnly": true
},
"meta": [
{
"name": "name",
"type": "text"
},
{
"name": "path",
"type": "text"
},
{
"name": "url",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "text"
},
{
"name": "error",
"type": "number"
}
],
"outputType": "array"
},
{
"name": "image_loader",
"module": "image",
"action": "load",
"options": {
"path": "{{upload_product_image}}"
},
"outputType": "object",
"meta": [
{
"name": "width",
"type": "number"
},
{
"name": "height",
"type": "number"
}
]
},
{
"name": "",
"module": "image",
"action": "resize",
"options": {
"instance": "image_loader",
"width": 1000
}
},
{
"name": "",
"module": "image",
"action": "crop",
"options": {
"instance": "image_loader",
"x": "center",
"y": "middle",
"width": 700,
"height": 700
}
},
{
"name": "save_product_image",
"module": "image",
"action": "save",
"options": {
"instance": "image_loader",
"path": "/images",
"overwrite": true
},
"output": true
},
{
"name": "insertdollitem",
"module": "dbupdater",
"action": "insert",
"options": {
"connection": "connection1",
"sql": {
"type": "insert",
"values": [
{
"table": "dolls",
"column": "name",
"type": "text",
"value": "{{$_POST.name}}"
},
{
"table": "dolls",
"column": "description",
"type": "text",
"value": "{{$_POST.description}}"
},
{
"table": "dolls",
"column": "gallery",
"type": "text",
"value": "{{save_product_image}}"
},
{
"table": "dolls",
"column": "category",
"type": "text",
"value": "{{$_POST.category}}"
},
{
"table": "dolls",
"column": "purchased",
"type": "text",
"value": "{{$_POST.purchased}}"
},
{
"table": "dolls",
"column": "type",
"type": "text",
"value": "{{$_POST.type}}"
},
{
"table": "dolls",
"column": "species",
"type": "text",
"value": "{{$_POST.species}}"
},
{
"table": "dolls",
"column": "brand",
"type": "text",
"value": "{{$_POST.brand}}"
},
{
"table": "dolls",
"column": "year",
"type": "text",
"value": "{{$_POST.year}}"
},
{
"table": "dolls",
"column": "estimatedvalue",
"type": "text",
"value": "{{$_POST.estimatedvalue}}"
},
{
"table": "dolls",
"column": "material",
"type": "text",
"value": "{{$_POST.material}}"
},
{
"table": "dolls",
"column": "nrfb",
"type": "text",
"value": "{{$_POST.nrfb}}"
},
{
"table": "dolls",
"column": "unopened",
"type": "text",
"value": "{{$_POST.unopened}}"
},
{
"table": "dolls",
"column": "condition",
"type": "text",
"value": "{{$_POST.condition}}"
},
{
"table": "dolls",
"column": "orginalbox",
"type": "text",
"value": "{{$_POST.orginalbox}}"
},
{
"table": "dolls",
"column": "licensedbrand",
"type": "text",
"value": "{{$_POST.licensedbrand}}"
}
],
"table": "dolls",
"query": "INSERT INTO dolls (name, description, gallery, category, purchased, type, species, brand, year, estimatedvalue, material, nrfb, unopened, condition, orginalbox, licensedbrand) VALUES (:$_POST_name, :$_POST_description, :save_product_image, :$_POST_category, :$_POST_purchased, :$_POST_type, :$_POST_species, :$_POST_brand, :$_POST_year, :$_POST_estimatedvalue, :$_POST_material, :$_POST_nrfb, :$_POST_unopened, :$_POST_condition, :$_POST_orginalbox, :$_POST_licensedbrand)",
"params": [
{
"name": "$_POST_name",
"type": "expression",
"value": "{{$_POST.name}}"
},
{
"name": "$_POST_description",
"type": "expression",
"value": "{{$_POST.description}}"
},
{
"name": "save_product_image",
"type": "expression",
"value": "{{save_product_image}}"
},
{
"name": "$_POST_category",
"type": "expression",
"value": "{{$_POST.category}}"
},
{
"name": "$_POST_purchased",
"type": "expression",
"value": "{{$_POST.purchased}}"
},
{
"name": "$_POST_type",
"type": "expression",
"value": "{{$_POST.type}}"
},
{
"name": "$_POST_species",
"type": "expression",
"value": "{{$_POST.species}}"
},
{
"name": "$_POST_brand",
"type": "expression",
"value": "{{$_POST.brand}}"
},
{
"name": "$_POST_year",
"type": "expression",
"value": "{{$_POST.year}}"
},
{
"name": "$_POST_estimatedvalue",
"type": "expression",
"value": "{{$_POST.estimatedvalue}}"
},
{
"name": "$_POST_material",
"type": "expression",
"value": "{{$_POST.material}}"
},
{
"name": "$_POST_nrfb",
"type": "expression",
"value": "{{$_POST.nrfb}}"
},
{
"name": "$_POST_unopened",
"type": "expression",
"value": "{{$_POST.unopened}}"
},
{
"name": "$_POST_condition",
"type": "expression",
"value": "{{$_POST.condition}}"
},
{
"name": "$_POST_orginalbox",
"type": "expression",
"value": "{{$_POST.orginalbox}}"
},
{
"name": "$_POST_licensedbrand",
"type": "expression",
"value": "{{$_POST.licensedbrand}}"
}
]
}
},
"meta": [
{
"name": "identity",
"type": "text"
},
{
"name": "affected",
"type": "number"
}
]
}
]
}
}
JSON
);
?>