QueryDatabase,php - grey1105/Reports GitHub Wiki

QueryDatabase.php

Summary:

Responsible for rendering the reports server side. Another function here also changes the name from DB column names to regular report names.

Future Updates:

To make this function more robust, ie more polymorphic, we can add a DB and server parameter to have the ability to query another DB on another server.

Edge Cases

I had to change the input query parameter, it used to be a csv string and this specific string 'DATEDIFF(date1,date2)'. Really this was only for my function to change names from a query DB name such as "scan_date" to "Alert Scan Date". I can create a seperate function that converts the csv to a period separated values(psv) and then change the names and store in an array.

Function Calls

Since this is only for rendering reports the only function that calls this API is in ReportScripts.js.

⚠️ **GitHub.com Fallback** ⚠️