Simple three tier architecture php