accommodated ajax function in php framework