Restart the phone after turning it off and leaving it off for 10 seconds or so. If that doesn't fix it, it has to go into a repair shop.
(You're connected to the router - but the router isn't giving the phone a connection to the internet. There can be a few reasons for that. See Troubleshooting Wi-Fi Connection Problems to start.)