the date function will accept the timestamp for the date. so your function
ingres=date($data_ingres, "Y-m-d");
will not work. what you can do is change it to time stamp after splitting your date string first
$array = explode( "/",$date_ingres);
$timestamp = mktime(0,0,0,$array[mm],$array[dd],$array[yyyy]);
ingres=date($timestamp, "Y-m-d");
just replace the mm,dd.yyy with the respective index depending on the date format.
Hope that helps
steven