you should datamine 24/7 for at least one week to get a decent average of MGR/hand and hands/hour for each stake/gametype. You should also include number of players in your asp/php selection criteria (asp and php are not the same language) - MGR is different HU than it is 10 handed, for example.
Thereafter, it is avg_MGR_per_hand_by_stake_handed*RB%*hands/hour*hours*tables - easy