Implementation of quantum controlled phase gate and preparation of multiparticle entanglement in cavity QED