Redo revenue.php and save.php to work with new db structure