If your fish is swimming on his side, well, it sounds like swim bladder disorder. You could try fasting him for a couple of days and feed him a pea for constipation (nuked, no additives).
Bettatalk:
SYMPTOMS: Bettas with a swim bladder disorder will have difficulty swimming, because their swim bladder (located alongside the spine between the belly and the tail) is either too short (causing them to not be able to swim horizontally) or it is swollen (causing them to float on one side). Double Tail bettas, because they have a shorter body, are especially prone to the “floaters” problem. In the case of a short swim bladder, the bettas will not be able to maneuver and swimming becomes so difficult, they prefer to just lay at the bottom, sliding on their bellies, which is why they are called “belly sliders”. And they do look like a pathetic bunch, at that point.
TREATMENT: Bettas may recover on their own, but since overfeeding induces swimbladder disorders in most cases, the first thing to do is feed a lot less. Brine shrimp and too much of it is the biggest culprit, so if your bettas are bellysliding, stop the brine shrimp for a while and thereafter learn to have a more balanced diet, alternating brine shrimp with microworms or worms (depending on how old your bettas are). Do not kill a betta with a swimbladder disorder. It may recover on its own at any time, and is not suffering. Further more, the ailment is NOT contagious.