Update javascript data send in ajax, update php logic