A density functional theory is formulated to study the nematic, smectic A and solid phases and phase transitions of a system of parallel hard spherocylinders (PHSC). For the direct correlation function the analytic expression suggested by Pynn is employed and an effective liquid approach is proposed to calculate the excess free energy of the inhomogeneous (smectic and solid) phases. The nematic-smectic A transition is found to be second order. The first-order nematic-solid and smectic A-solid transitions are calculated. As a function of the elongation of the spherocylinders, the phase behaviour and coexistence data obtained from the theory are in reasonable agreement with the available computer simulation results.