    <?php 

	$checkdate = explode(".", $functions->currentDay($day, $week));
	
	if($day == 'saturday'){ 
		$newcheck = explode("/", $checkdate[0]);
		if(date("D") == 'Sat'){ $checkdate[0] = $newcheck[0];}
		if(date("D") == 'Sun'){ $checkdate[0] = $newcheck[1];}
		}

	if($checkdate[2]."-".$checkdate[1]."-".$checkdate[0] <= date("Y-m-d")) {?>

	<div class="<?=$holder?>-font">
    
    <form action="" id="<?=$day?>-form" method="post">

		<div id="<?=$day?>-list-holder"><ul>

<?php

$explode = explode(".", $functions->currentDay($day, $week));


if($day != 'saturday') {
$date = $explode[2]."-".$explode[1]."-".$explode[0];
}

if($day == 'saturday'){
$correction = explode("/", $explode[0]);

$date = $explode[2]."-".$explode[1]."-".$correction[0];

	}


$database->setBareQuery("SELECT id, project, duration, description FROM task WHERE date = '".$date."' AND user = '".$user."'");



$task_id = $database->loadResultArray(0);

$project = $database->loadResultArray(1);

$duration = $database->loadResultArray(2);

$description = $database->loadResultArray(3);

for($i = 0; $i < count($task_id); $i++):


include('pages/selection.php');

endfor; 

$max = $i;




include('pages/adselection.php');






if($day == 'saturday') {

	$hiddenval = $date; 

}

else { $hiddenval = $checkdate[2]."-".$checkdate[1]."-".$checkdate[0]; }



?>
</ul></div>
<input type="hidden" name="<?=$day?>dateval" id="<?=$day?>dateval" value="<?=$hiddenval?>" />

<input type="hidden" name="<?=$day?>max" id="<?=$day?>max" value="<?=$max?>" />

</form>

		
        







<div class="day-buttons">

<div id="calculate-label">Ukupno sati:</div><ul id="time"><li id="minute<?=$day?>"><img src="images/ajax-loader.gif" /></li><li>:</li><li id="hour<?=$day?>"><img src="images/ajax-loader.gif" /></li></ul>

<div class="clear"></div>

</div>

<div class="day-buttons">

<div id="calculate-label">Danas sam: </div><ul class="moods"><li id="1-<?=$day?>" class="good-day mood-day"></li><li id="2-<?=$day?>" class="soso-day mood-day"></li><li id="3-<?=$day?>" class="bad-day mood-day"></li><li id="4-<?=$day?>" class="worse-day mood-day"></li></ul>

<div class="clear"></div>

</div>

<div class="day-buttons">

<div id="finish-<?=$day?>" class="finish-button"></div>

</div>



        </div>
        
        <?php } ?>
