If a known good charger and cable are used, and the issue remains, there could be a few steps you can try, in addition to the above by Curtis, such as:
- You can try to rule out the software as possible reason for the iTunes detection issue by removing the jailbreak (unless you can't give it up).
- Slow charging and quick discharging could be due to the battery dying on you. I would disassemble the phone to take a look at the battery battery using the iFixit guides. A good sign of it going bad would be that it's swollen. But it could be retaining it's flat form and still be bad. You can replace it to make sure.
- You can then try replacing the dock connector, also as mentioned above by Curtis.
- Finally the issue could be due to a set of components on the board that prevent the phone from being detected and/or from charging correctly. This set of components will need a well trained technician to trouble shoot and replace them if needed.
If you try any/all the above and report back with your findings, we may be able to help you more.