Negative refraction in periodic and random photonic crystals