I'm looking for an ad management script which allows advertisers to set up a campaign for either text or banner ads, with the option to target ads based on geographical area (geotargeting) and platform (android,iphone,firefox, etc.)

I don't care to use 3rd party sites which collect a percentage of revenue. I've heard of openx, but I don't know enough about it.

I am interested in a commercial script that does everything and allows me to earn revenue without going through a middle-man.

Thanks for your help and feedback.