Refactor designer HTML into PHP functions

Signed-off-by: Bimal Yashodha <kb.yashodha@gmail.com>
Merge branch 'master' into refactoring

Signed-off-by: Bimal Yashodha <kb.yashodha@gmail.com>
Merge pull request #1315 from kb-yashodha/refactoring

Refactoring