server view refactor:
1. render the HTML element at once
2. fix HTML and PHP mixture
3. fix code indention