Smart gas sensor based on photonic crystal for sensing perilous gases: industrial and mining applications