For ofloxacin to adequately treat chlamydia, and maybe NGU, 7 days is needed.
Nonsexually transmitted UTIs are rare in men under age 40-50. If you are at risk for STDs, you might have NGU instead, especially if you had penile discharge. Some doctors who aren't STD experts don't understand the difference.
Ofloxacin is excellent for real UTI but not the best for any STD. It probably would work for chlamydia and maybe for NGU, but it's unreliable for gonorrhea.