We propose a scheme for implementing the CNOT gate in which the photonic qubits encoded on the cavity modes and a four-level atom passes through the cavity. The location of the resonance is predicted from the use of effective three-level Hamiltonian. First, we have theoretically studied the interaction of multi-level atom with multi-mode fields in a cavity by using the shore’s method. Next we have numerically calculated the probability of the state of the interest as well as the fidelity of this scheme. We have also used the wave-function and the density matrix approaches to study theoretically and numerically the effects of decoherence in the implementation of the gate.