Removed sloppy code.
If there is a calculation where no ratio is needed.
Changed the names of the fields and used the Calculator functions.

Changed var names to be more consistent.
Removed unused queries.
Improved readablility of the queries.
Added scope to the classes and queries. These are equal to the dashboard.
Added more functionality to the html and php files.