before the raise you were earning 100% of "x", we also know that 6% of "x" is 312, since that is what you've got in the raise, therefore
[tex]\begin{array}{ccll} amount&\%\\ \cline{1-2} x&100\\ 312&6 \end{array}\implies \cfrac{x}{312}=\cfrac{100}{6}\implies \cfrac{x}{312}=\cfrac{50}{3} \\\\\\ 3x=15600\implies x = \cfrac{15600}{3}\implies \boxed{x = 5200}[/tex]