Update result.php into tempalte

it can now accept the json struture in data variable now