Refactored "tbl_create.php"

Refactored "tbl_create.php", change the code segments into functions for code reuse and future maintenance.