right before the echo <table>

add

Code
echo <<<GET_TODAY
<script>
var ubbcal=new Date();
var today=ubbcal.getDay();
</script>
GET_TODAY;