Highly integrated programmable metasurface for multifunctions in reflections and transmissions