moving inline js out from db_designer.lib.php plus minor bug fixes

Signed-off-by: Smita Kumari <kumarismita62@gmail.com>