Can I get good grades at a bad school?Watch
You will have to do a lot of work on your own terms and in your own time, and make some sacrifices in the amount of time you spend out with friends - don't get me wrong though it is extremely important to go out and have fun sometimes and still have a social life - getting that balance is crucial, but don't get pulled down by peer-pressure, if you want those grades in a school which may not be fantastic you have to be willing to work for it. If you are prepared to do so then you can most definitely get the grades that you want.
Best of luck
And self study is 100x more efficient than school lessons if you do it right.