<?php
//============================================================+
// File name   : tce_page_timer.php
// Begin       : 2004-04-29
// Last Update : 2006-11-10
// 
// Description : Display timer (date-time + countdown).
//
// Author: Nicola Asuni
//
// (c) Copyright:
//               Tecnick.com S.r.l.
//               Via Ugo Foscolo n.19
//               09045 Quartu Sant'Elena (CA)
//               ITALY
//               www.tecnick.com
//               info@tecnick.com
//
// License: GNU GENERAL PUBLIC LICENSE v.2
//          http://www.gnu.org/copyleft/gpl.html
//============================================================+

/**
 * Display client timer (date-time + countdown).
 * @package com.tecnick.tcexam.shared
 * @author Nicola Asuni
 * @copyright Copyright &copy; 2004-2006, Tecnick.com S.r.l. - Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
 * @link www.tecnick.com
 * @since 2004-04-29
 */

if (!isset($_REQUEST['examtime'])) {
	$_REQUEST['examtime'] = 0; // remaining exam time in seconds
	$enable_countdown = 'false';	
}
else {
	$enable_countdown = 'true';
}

echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" id=\"timerform\">\n";
echo "<div>";
echo "<label for=\"timer\" class=\"timerlabel\">".$l['w_time'].":</label>";
echo "<input type=\"text\" name=\"timer\" id=\"timer\" value=\"\" size=\"29\" maxlength=\"29\" title=\"".$l['w_clock_timer']."\" readonly=\"readonly\"/>\n";
echo "&nbsp;</div>\n";
echo "</form>\n";
echo "<script src=\"".K_PATH_SHARED_JSCRIPTS."timer.js\" type=\"text/javascript\"></script>\n";
echo "<script type=\"text/javascript\">\n";
echo "//<![CDATA[\n";
echo "FJ_start_timer(".$enable_countdown.", ".(time() - $_REQUEST['examtime']).", '".addslashes($l['m_exam_end_time'])."');\n";
echo "//]]>\n";
echo "</script>\n";

//============================================================+
// END OF FILE                                                 
//============================================================+
?>
