In the framework of the scalar theory of diffraction a surface-pixeled convergent lens for arbitrary amplitude and phase modulation along the depth of focus is introduced. This complex diffractive lens is computer-generated from an exact solution of the inverse focal shaping problem obtained by using the Fresnel diffraction integral. The spatial multiplexing technique of double-phase method is employed to encode the complex diffractive lens into a phase optical element that can be dynamically implemented with a commercial liquid-crystal spatial light modulator. The optical surface of this lens, capable of generating not only a single axial focus but also multiple parallel foci, has neither linear nor rotational symmetry but phase jumps from one pixel to another. In addition to intensity shaping, the introduced lens provides simultaneous control over the phase of light along the depth of focus, which can be very attractive for improving and/or developing photonic applications related to the interaction of coherent laser beams with matter.