This is called a mixed conditional.
— If John was there, he would've seen the accident.
(John is not there, so he didn't see the accident.)
This involved the present with the past. Sometimes, the choice of verb forms in mixed conditionals depends on the time reference, then the above sentence should be rephrased as:
— If John had been there, he would've seen the accident.
— Had John been there, he would've seen the accident. (Inversion.)
(John wasn't there, so he didn't see the accident.)
An example where the present clause and the past clause work as a mixed conditional is:
— If lived in London, I would've gone to the match.
(I don't live in London, so I didn't go to the match.)
Note that mixed conditionals also work by using if + past perfect, would + base form:
— If you hadn't eaten the last meal, she wouldn't be hungry.
(He ate it, so she is hungry.)
It all depends of the verb choice and time reference.