Chosen Solution

My iPhone is not charging when is ON, and when OFF is charging normally. Already change the dock connector. Also is not connecting to PC or Mac

Maybe it is a stupid question but you probably try different lightning cables? You can also do a hard reset, hold the lock button and the home button for 15 seconds. If those things not solve your problem you can try an another dock again. Good luck and let me know!