add functionality addaction save and relation in tables + validations in js and php