"A lot of work' ... well considering your resources (multiple people doing jobs related) then yes, my 'sharing' might seem ancient ... for a single OP who wears all hats in the entire setup of his system - includes Paypal, etc. could have expanded that simple script to do a lot more + setup a Webmin that would provide much more 'automation' as well. Single OP ... mind ya ... wears all hats.
But ... more power to ya ... you need all the automation you can muster sounds like.
Suggest filling out your profile with a description of your system(s). Other folks would be interested!
Good luck finding out why those tables were missing!
'spirit of sharing', Ken