…
require(’…/…/…/dmxConnectLib/dmxConnect.php’);
$app = new \lib\App();
$app->define(<<<‘JSON’
{
“settings”: {
“options”: {}
},
“meta”: {
“options”: {},
“$_GET”: [
{
“type”: “text”,
“name”: “get_id”
}
]
},
“exec”: {
“steps”: [
“Connections/dbh_data”,
“SecurityProviders/user_security”,
{
“name”: “list_report”,
“module”: “dbconnector”,
“action”: “select”,
“options”: {
“connection”: “dbh_data”,
“sql”: {
“type”: “SELECT”,
“columns”: [
{
“table”: “pastor”,
“column”: “district”
},
{
“table”: “pastor”,
“column”: “position”
},
{
“table”: “pastor”,
“column”: “first_name”
},
{
“table”: “pastor”,
“column”: “last_name”
},
{
“table”: “church”,
“column”: “church_city”
},
{
“table”: “church”,
“column”: “church_state”
},
{
“table”: “service”,
“column”: “faith_promise”
},
{
“table”: “service”,
“column”: “service_cancel”
},
{
“table”: “service”,
“column”: “service_cancel_reason”
},
{
“table”: “service”,
“column”: “offering_only”
},
{
“table”: “service”,
“column”: “offering_amount”,
“aggregate”: “SUM”,
“alias”: “offeringAmount”
},
{
“table”: “service”,
“column”: “pim_amount”,
“aggregate”: “SUM”,
“alias”: “pimAmount”
},
{
“table”: “service”,
“column”: “how_many_pims”,
“aggregate”: “SUM”,
“alias”: “howManyPims”
},
{
“table”: “service”,
“column”: “project_amount”,
“aggregate”: “SUM”,
“alias”: “projectAmount”
},
{
“table”: “church”,
“column”: “service_date”,
“aggregate”: “”
},
{
“table”: “service”,
“column”: “field_pim_amount”,
“alias”: “fieldPimAmount”,
“aggregate”: “SUM”
},
{
“table”: “expense”,
“column”: “auto_miles”,
“alias”: “autoMiles”,
“aggregate”: “SUM”
},
{
“table”: “expense”,
“column”: “auto_expense”,
“alias”: “autoExpense”,
“aggregate”: “SUM”
},
{
“table”: “expense”,
“column”: “auto_expense_descript”
},
{
“table”: “expense”,
“column”: “other_expense”,
“alias”: “otherExpense”,
“aggregate”: “SUM”
},
{
“table”: “expense”,
“column”: “other_expense_descript”
},
{
“table”: “pastor”,
“column”: “pastor_id”
},
{
“table”: “church”,
“column”: “pastor_id”
},
{
“table”: “service”,
“column”: “pastor_id”
},
{
“table”: “expense”,
“column”: “pastor_id”
},
{
“table”: “church”,
“column”: “am_pm”
}
],
“table”: {
“name”: “pastor”
},
“joins”: [
{
“table”: “church”,
“column”: “",
“type”: “RIGHT”,
“clauses”: {
“condition”: “AND”,
“rules”: [
{
“table”: “church”,
“column”: “pastor_id”,
“operator”: “equal”,
“value”: {
“table”: “pastor”,
“column”: “pastor_id”
},
“operation”: “=”
}
]
}
},
{
“table”: “service”,
“column”: "”,
“type”: “RIGHT”,
“clauses”: {
“condition”: “AND”,
“rules”: [
{
“table”: “service”,
“column”: “pastor_id”,
“operator”: “equal”,
“value”: {
“table”: “pastor”,
“column”: “pastor_id”
},
“operation”: “=”
}
]
}
},
{
“table”: “expense”,
“column”: “",
“type”: “RIGHT”,
“clauses”: {
“condition”: “AND”,
“rules”: [
{
“table”: “expense”,
“column”: “pastor_id”,
“operator”: “equal”,
“value”: {
“table”: “pastor”,
“column”: “pastor_id”
},
“operation”: “=”
}
]
}
}
],
“wheres”: {
“condition”: “AND”,
“rules”: [
{
“id”: “pastor.itinerary_id”,
“field”: “pastor.itinerary_id”,
“type”: “double”,
“operator”: “equal”,
“value”: “{{$_GET.get_id}}”,
“data”: {
“table”: “pastor”,
“column”: “itinerary_id”,
“type”: “number”
},
“operation”: “=”
}
],
“conditional”: null,
“valid”: true
},
“query”: "SELECT pastor.district, pastor.position, pastor.first_name, pastor.last_name, church.church_city, church.church_state, service.faith_promise, service.service_cancel, service.service_cancel_reason, service.offering_only, SUM(service.offering_amount) AS offeringAmount, SUM(service.pim_amount) AS pimAmount, SUM(service.how_many_pims) AS howManyPims, SUM(service.project_amount) AS projectAmount, church.service_date, SUM(service.field_pim_amount) AS fieldPimAmount, SUM(expense.auto_miles) AS autoMiles, SUM(expense.auto_expense) AS autoExpense, expense.auto_expense_descript, SUM(expense.other_expense) AS otherExpense, expense.other_expense_descript, pastor.pastor_id, church.pastor_id, service.pastor_id, expense.pastor_id, church.am_pm\nFROM pastor\nRIGHT JOIN church ON (church.pastor_id = pastor.pastor_id) RIGHT JOIN service ON (service.pastor_id = pastor.pastor_id) RIGHT JOIN expense ON (expense.pastor_id = pastor.pastor_id)\nWHERE pastor.itinerary_id = :P1 / {{$_GET.get_id}} */\nGROUP BY pastor.district, pastor.position, pastor.first_name, pastor.last_name, church.church_city, church.church_state, service.faith_promise, service.service_cancel, service.service_cancel_reason, service.offering_only, church.service_date, expense.auto_expense_descript, expense.other_expense_descript, pastor.pastor_id, church.pastor_id, service.pastor_id, expense.pastor_id, church.am_pm\nORDER BY church.service_date ASC, church.service_time ASC, church.am_pm ASC”,
“params”: [
{
“operator”: “equal”,
“type”: “expression”,
“name”: “:P1”,
“value”: “{{$_GET.get_id}}”
}
],
“orders”: [
{
“table”: “church”,
“column”: “service_date”,
“direction”: “ASC”,
“recid”: 1
},
{
“table”: “church”,
“column”: “service_time”,
“direction”: “ASC”,
“recid”: 2
},
{
“table”: “church”,
“column”: “am_pm”,
“direction”: “ASC”,
“recid”: 3
}
],
“groupBy”: [
{
“table”: “pastor”,
“column”: “district”
},
{
“table”: “pastor”,
“column”: “position”
},
{
“table”: “pastor”,
“column”: “first_name”
},
{
“table”: “pastor”,
“column”: “last_name”
},
{
“table”: “church”,
“column”: “church_city”
},
{
“table”: “church”,
“column”: “church_state”
},
{
“table”: “service”,
“column”: “faith_promise”
},
{
“table”: “service”,
“column”: “service_cancel”
},
{
“table”: “service”,
“column”: “service_cancel_reason”
},
{
“table”: “service”,
“column”: “offering_only”
},
{
“table”: “church”,
“column”: “service_date”
},
{
“table”: “expense”,
“column”: “auto_expense_descript”
},
{
“table”: “expense”,
“column”: “other_expense_descript”
},
{
“table”: “pastor”,
“column”: “pastor_id”
},
{
“table”: “church”,
“column”: “pastor_id”
},
{
“table”: “service”,
“column”: “pastor_id”
},
{
“table”: “expense”,
“column”: “pastor_id”
},
{
“table”: “church”,
“column”: “am_pm”
}
]
}
},
“output”: true,
“meta”: [
{
“name”: “district”,
“type”: “text”
},
{
“name”: “position”,
“type”: “text”
},
{
“name”: “first_name”,
“type”: “text”
},
{
“name”: “last_name”,
“type”: “text”
},
{
“name”: “church_city”,
“type”: “text”
},
{
“name”: “church_state”,
“type”: “text”
},
{
“name”: “faith_promise”,
“type”: “text”
},
{
“name”: “service_cancel”,
“type”: “text”
},
{
“name”: “service_cancel_reason”,
“type”: “text”
},
{
“name”: “offering_only”,
“type”: “text”
},
{
“name”: “offeringAmount”,
“type”: “number”
},
{
“name”: “pimAmount”,
“type”: “number”
},
{
“name”: “howManyPims”,
“type”: “number”
},
{
“name”: “projectAmount”,
“type”: “number”
},
{
“name”: “service_date”,
“type”: “date”
},
{
“name”: “fieldPimAmount”,
“type”: “number”
},
{
“name”: “autoMiles”,
“type”: “number”
},
{
“name”: “autoExpense”,
“type”: “number”
},
{
“name”: “auto_expense_descript”,
“type”: “text”
},
{
“name”: “otherExpense”,
“type”: “number”
},
{
“name”: “other_expense_descript”,
“type”: “text”
},
{
“name”: “pastor_id”,
“type”: “number”
},
{
“name”: “am_pm”,
“type”: “text”
}
],
“outputType”: “array”
}
]
}
}
JSON
);
…