How to fix this fence

Is anyone able to give me some advice on whether this can be done as a DIY job? I had a quote but it was much more than I expected.