This is a lot of calculation.
So we know that the sum of angles for any heptagon is 900, because heptagon can be divided into five non-overlapping triangles and sum of angles of each triangle is 180.
Now you just add up all angles and simplify the equation:
900 = (6x - 8) + 120 + (7x - 64) + (5x - 4) + 135 + (3x + 31) + (4x + 15)
900 = 25x + 225
Now it's just regular algebra equation. You can solve for x:
675 = 25x
x = 27
So the value of x is 27