Side note, I think we can ditch those Juri:root() from assets on /media folder e.g.:
This <link rel="stylesheet" href="<?php echo JUri::root(); ?>/media/jui/css/bootstrap-rtl.css" type="text/css" />
should be the same as this: <link rel="stylesheet" href="/media/jui/css/bootstrap-rtl.css" type="text/css" />
Thanks @dgt41 should all fixed now