Adding search for selected data, updating php snippets