7 killed in militant attack in Afghanistan court