You need to be treated for your loose stools. You are getting cramps because you are suffering from electrolyte imbalance
. You are getting dehydrated. Try to re-hydrate yourself by taking rehydrating fluids orally, pure hygienic water and juices. If you think you are getting week, contact your doctor and get into an emergency room. You may need IV fluids to supplement the sodium and potassium loss. You need rest.
You may have to get few blood tests and investigations done. Do co-operate with your treating doctor. Once you are fine, you can continue taking the medicines as advised. Do not worry about the green stool
, it is because of green veggies that you might have taken. If there is any infection it will get treated in time. Do not worry. Have a good day, take care.