Data to controller

Moving php variables from view (charts) to controller and database