<?php
defined('VSIGN') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");

class clockDAO
{
	private $db;
	private $user;

	function __construct(database $db, user $user) 
	{
		$this->db 	=& $db;
		$this->user =& $user;
		
	}
	
	function displayPage() 
	{		
		return false;
	}
	
	function on_page_load() 
	{
		return '';
	}
	
	function echo_page_heading() 
	{
		return true;
	}
	
	/**
	 * Shows the Time Information
	 * @return 
	 */
	function ShowTimeInfo()
	{
		$db				=& $this->db;
		$response		= new ResponseManager();
		$datemanager 	= new DateManager($db);
				
		$output  = '<h3>' . __('System Information') . '</h3>';
		$output .= '<ul>';
		$output .= '<li>' . __('Local Time') . ': ' . $datemanager->GetClock() . '</li>';
		$output .= '<li>' . __('System Time') . ': ' . $datemanager->GetSystemClock() . '</li>';
		$output .= '<li>' . __('Local Date') . ': ' . $datemanager->GetLocalDate('Y-m-d H:i:s') . '</li>';
		$output .= '<li>' . __('System Date') . ': ' . $datemanager->GetSystemDate('Y-m-d H:i:s') . '</li>';
		$output .= '</ul>';
		
		$response->SetFormRequestResponse($output, __('Date / Time Information'), '480px', '240px');
		$response->Respond();
	}
	
	/**
	 * Gets the Time
	 * @return 
	 */
	function GetClock()
	{
		$db				=& $this->db;
		$response		= new ResponseManager();
		$datemanager 	= new DateManager($db);
		
		$output = $datemanager->GetClock();
		
		$response->SetFormRequestResponse($output, __('Date / Time Information'), '480px', '240px');
		$response->clockUpdate 	= true;
		$response->success		= false;
		$response->Respond();
	}
}
?>