is invalid - this is the fallacy of affirming the antecedent. "p implies q" does not imply "q implies p".
The second argument:
p or q / not-q / therefore p
is valid, provided the "or" is understood as inclusive disjunction. Since at least one of the two theses p,q must be true - then, if one is false, the other must be true.