Add the function to the ajax page for getting a history table