-Added support to handle creation of Occasion checkboxes
-Created function query_to_array so I don't have to keep rewriting the code to perform the query and then store the results as an associative array.