server view refactor:

1. render the HTML element at once
2. fix HTML and PHP mixture
3. fix code indention
4. use $sql_query_form_html for readability