Thanks for posting your query.
You are most likely suffering from acute viral upper respiratory tract
infection with secondary bacterial infection and spread of infection to lower respiratory tract.
Presence of green colored phlegm with pain in lower ribs suggests the diagnosis.
You should consult with internal medicine specialist / chest physician.
You should also go for chest x ray
, complete blood count
You should take complete antibiotic course along with muscle relaxants.
Dr. Mayank Bhargava