<?php

session_start();

    require_once('../libs/Ultraviolet.php');
	
	require_once('../libs/Database.php');
	
	require_once('../libs/AdminFunctions.php');
		
	$database =& DatabaseConnect::getInstance();
	
	$database->query("SET CHARACTER SET utf8");
	
	$functions =& AdminFunctions::getInstance();


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

		${key($_POST)} = $_POST[key($_POST)];

		next($_POST);	

	endfor;

//$database->setQuery("SELECT DISTINCT(SUBSTRING(date, 1, 7)) FROM task ORDER BY id DESC");	

$database->setQuery("SELECT DISTINCT(SUBSTRING(date, 1, 7)) FROM task");	

$result = $database->loadResultArray();





// All of these periods are equivalent.




// By iterating over the DatePeriod object, all of the
// recurring dates within that period are printed.

?>

    	<select id="month" class="" >
        
			<option value="default" selected="selected">Izaberi mesec</option>
            
            <?php 
			
				
				
				for($i = 0; $i < count($result); $i++):
				$visible = explode('-', $result[$i]);
				?>
				<option value="<?=$result[$i]?>"><?=$visible[1].'/'.$visible[0]?></option>
				
				<?php endfor; ?>
    
			</select>  
        


 
