*/
define('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT', 'XHTML');
define('XAJAX_HMTL_CONTROL_DOCTYPE_VERSION', '1.0');
define('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION', 'TRANSITIONAL');
$sBaseFolder = dirname(dirname(dirname(__FILE__)));
$sCoreFolder = '/xajax_core';
$sCtrlFolder = '/xajax_controls';
include $sBaseFolder . $sCoreFolder . '/xajax.inc.php';
$xajax = new xajax();
$xajax->configure('javascript URI', '../../');
include $sBaseFolder . $sCtrlFolder . '/validate_XHTML10TRANSITIONAL.inc.php';
include $sBaseFolder . $sCoreFolder . '/xajaxControl.inc.php';
foreach (array('/document.inc.php', '/structure.inc.php', '/content.inc.php', '/form.inc.php', '/group.inc.php', '/misc.inc.php') as $sFile) {
    include $sBaseFolder . $sCtrlFolder . $sFile;
}
$objDocument = new clsDocument(array('children' => array(new clsDoctype(), new clsHtml(array('attributes' => array('xmlns' => 'http://www.w3.org/1999/xhtml', 'xml:lang' => 'en', 'lang' => 'en'), 'children' => array(new clsHead(array('xajax' => $xajax, 'children' => array(generateTitle(), generateStyle(), generateScript(), generateMeta(), generateLink(), generateBase()))), new clsBody(array('children' => array(generateOrderedList(), generateUnorderedList(), generateDefinitionList(), generateTable(), generateForm(), generateContent(), generateValidation(), generateIframe())))))))));
function generateTitle()
{
    return new clsTitle(array('child' => new clsLiteral('Title')));
}
function generateStyle()
{
    return new clsStyle(array('attributes' => array('type' => 'text/css'), 'child' => new clsLiteral('styleOne { background: #ffdddd; }')));
}
function generateScript()
{
    return new clsScript(array('attributes' => array('type' => 'text/javascript'), 'child' => new clsLiteral('javascriptFunction = function(a, b) { alert(a*b); };')));
}
function generateMeta()
{
    return new clsMeta(array('attributes' => array('name' => 'keywords', 'lang' => 'en-us', 'content' => 'xajax, javascript, php, ajax')));
*/
define('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT', 'HTML');
define('XAJAX_HTML_CONTROL_DOCTYPE_VERSION', '4.01');
define('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION', 'TRANSITIONAL');
$sBaseFolder = dirname(dirname(dirname(__FILE__)));
$sCoreFolder = '/xajax_core';
$sCtrlFolder = '/xajax_controls';
include $sBaseFolder . $sCoreFolder . '/xajax.inc.php';
$xajax = new xajax();
$xajax->configure('javascript URI', '../../');
include $sBaseFolder . $sCtrlFolder . '/validate_HTML401TRANSITIONAL.inc.php';
include $sBaseFolder . $sCoreFolder . '/xajaxControl.inc.php';
foreach (array('/document.inc.php', '/structure.inc.php', '/content.inc.php', '/form.inc.php', '/group.inc.php', '/misc.inc.php') as $sFile) {
    include $sBaseFolder . $sCtrlFolder . $sFile;
}
$objDocument = new clsDocument(array('children' => array(new clsDoctype(), new clsHtml(array('children' => array(new clsHead(array('xajax' => $xajax, 'children' => array(generateTitle(), generateStyle(), generateScript(), generateMeta(), generateLink(), generateBase()))), new clsBody(array('children' => array(generateOrderedList(), generateUnorderedList(), generateDefinitionList(), generateTable(), generateForm(), generateContent(), generateValidation(), generateIframe())))))))));
function generateTitle()
{
    return new clsTitle(array('child' => new clsLiteral('Title')));
}
function generateStyle()
{
    return new clsStyle(array('attributes' => array('type' => 'text/css'), 'child' => new clsLiteral('styleOne { background: #ffdddd; }')));
}
function generateScript()
{
    return new clsScript(array('attributes' => array('type' => 'text/javascript'), 'child' => new clsLiteral('javascriptFunction = function(a, b) { alert(a*b); };')));
}
function generateMeta()
{
    return new clsMeta(array('attributes' => array('name' => 'keywords', 'lang' => 'en-us', 'content' => 'xajax, javascript, php, ajax')));
function retournerOccupations($table, $bdd)
{
    $string = '';
    foreach ($table as $occupation) {
        $Ds = retournerDureeSeconde($occupation);
        $Dm = $Ds / 60;
        $string = $string . '<div class="calendar_event" id="' . $occupation['CodeOccupation'] . '"style="' . generateStyle($occupation) . '">
				<div class="calendar_event_date" id="' . $occupation['CodeOccupation'] . '_date" >
					<span id="' . $occupation['CodeOccupation'] . '_date_debut_heure">' . retournerHeureDebut($occupation) . '</span>:
					<span id="' . $occupation['CodeOccupation'] . '_date_debut_minute">' . retournerMinuteDebut($occupation) . '</span> -
					<span id="' . $occupation['CodeOccupation'] . '_date_fin_heure">' . retournerHeureFin($occupation) . '</span>:
					<span id="' . $occupation['CodeOccupation'] . '_date_fin_minute">' . retournerMinuteFin($occupation) . '</span>
				</div>';
        if ($Dm <= 60) {
            $string = $string . '</div>';
        } else {
            if ($Dm > 60 && $Dm <= 100) {
                $string = $string . '<div class="calendar_event_activite" id="' . $occupation['CodeOccupation'] . '_activite">' . convertCodeToNomActivite($occupation['CodeActivite'], $bdd) . '</div>
				</div>';
            } else {
                if ($Dm > 100 && $Dm <= 140) {
                    $string = $string . '<div class="calendar_event_activite" id="' . $occupation['CodeOccupation'] . '_activite">' . convertCodeToNomActivite($occupation['CodeActivite'], $bdd) . '</div>
				<div class="calendar_event_lieu" id="' . $occupation['CodeOccupation'] . '_lieu">' . convertCodeToNomLieu($occupation['CodeLieux'], $bdd) . '</div>
				</div>';
                } else {
                    if ($Dm > 140 && $Dm <= 180) {
                        $string = $string . '<div class="calendar_event_activite" id="' . $occupation['CodeOccupation'] . '_activite">' . convertCodeToNomActivite($occupation['CodeActivite'], $bdd) . '</div>
				<div class="calendar_event_lieu" id="' . $occupation['CodeOccupation'] . '_lieu">' . convertCodeToNomLieu($occupation['CodeLieux'], $bdd) . '</div>
				<div class="calendar_event_compagnie" id="' . $occupation['CodeOccupation'] . '_compagnie">' . convertCodeToNomCompagnie($occupation['CodeCompagnie'], $bdd) . '</div>
				</div>';
                    } else {
                        $string = $string . '<div class="calendar_event_activite" id="' . $occupation['CodeOccupation'] . '_activite">' . convertCodeToNomActivite($occupation['CodeActivite'], $bdd) . '</div>
				<div class="calendar_event_lieu" id="' . $occupation['CodeOccupation'] . '_lieu">' . convertCodeToNomLieu($occupation['CodeLieux'], $bdd) . '</div>
				<div class="calendar_event_compagnie" id="' . $occupation['CodeOccupation'] . '_compagnie">' . convertCodeToNomCompagnie($occupation['CodeCompagnie'], $bdd) . '</div>
				<div class="calendar_event_dispositif" id="' . $occupation['CodeOccupation'] . '_dispositif">' . convertCodeToNomDispositif($occupation['CodeDispositif'], $bdd) . '</div>
				</div>';
                    }
                }
            }
        }
    }
    return $string;
}