php and javascript code the create, update, insert, or delete a record