if (isset($data['do_changes'])){
session_start();
$user = R::findOne('users', 'id = ?', [ $_SESSION['logged_user']['id'] ] );
if (!empty($data['new_name']) && $data['new_name'] != $usr->name){
$user->name = $data['new_name'];}
if (!empty($data['new_email']) && $data['new_email'] != $usr->name){
$user->email = $data['new_email'];}
if (!empty($data['new_phone']) && $data['new_phone'] != $usr->name){
$user->phone = $data['new_phone'];}
R::store($user);
}