First of all! NEVER use string concatenation to create a query - this opens up your application to SQL injection...
The problem is you are not handling right the quotes in your query...
values('" +typeoftrans+ ",'"
You are opening a quote before the value but closing it only after the comma...