<?
  include "../../mainfile.php";
  include "include/CPCSETTING.php";
  $mypcsys = new CPCSETTING();
?>
<body>
<script>
  function reloadpage(){
    location.reload(true);
  }
  setInterval("reloadpage()", 60000);
</script>
<?
  date_default_timezone_set('Asia/Kuala_Lumpur');
  mb_internal_encoding("UTF-8");
?>
<script>
var currenttime = "<?= date('F d, Y H:i:s')?>";
var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12");
var weekarray=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
var vweekarray=new Array("AHAD","ISNIN","SELASA","RABU","KHAMIS","JUMAAT","SABTU");

var serverdate=new Date(currenttime)

function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}

function getPrefix(hr){
  var output="AM";
  if(hr>11){
    output="PM";
  }
  return output;
}

function getHour(hr){
  var output=hr;
  if(hr>12){
    output=hr-12;
  }
  if(hr==0){
    output=12;
  }
  return output;
}

function displaytime(){
  serverdate.setSeconds(serverdate.getSeconds()+1)
  
  var datestring=padlength(serverdate.getDate()) + "-" + montharray[serverdate.getMonth()] + "-" + serverdate.getFullYear() + "&nbsp;&nbsp;" + weekarray[serverdate.getDay()] + "&nbsp;<font style='font-family:华文楷体; font-size:23px'>"+ vweekarray[serverdate.getDay()] +"</font>"
  var timestring=getHour(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds())+" "+getPrefix(serverdate.getHours())
  
  document.getElementById("showtime").innerHTML="<font style='font-size:25px;' >"+datestring+"</font><br><font style='font-size:70px;'>"+timestring+"</font>";
}

 setInterval("displaytime()", 1000);
</script>

<center>
<div id="showtime" 
     style="background-color:#FFFFFF;
	 color:#000000; 
	 font-family:Arial; 
	 text-align:center;
	 font-weight:bold;
	 font-size:30px;
	 width:500px;
	 height:90px;
	 ">
</div>

</center>
</body>