fixed php and made js display the template