<?php

	require_once('../libs/Ultraviolet.php');

	require_once('../libs/Database.php');

	require_once('../libs/AdminFunctions.php');
	
	require_once('../libs/SimpleImage.php');
	
	require_once('../libs/FileUpload.php');

	

	$database =& DatabaseConnect::getInstance();

	$functions =& AdminFunctions::getInstance();

	$database->query("SET CHARACTER SET utf8");



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

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

		next($_POST);	

	endfor;
	
	$database->setBareQuery("SELECT id, name, project_num  FROM project WHERE parent = '$parent' ORDER BY SUBSTRING(project_num, 1, 2) DESC, SUBSTRING(project_num, 3)*1 DESC");

	$id = $database->loadResultArray(0);
		
	$name = $database->loadResultArray(1);
	
	$projectnum = $database->loadResultArray(2);
	


?>

<fieldset>

	<select id="project-select-<?=$day?><?=$i?>" class="forms" >
        
			<option value="default" selected="selected">Izaberi projekat</option>
            
            <?php 
			
			for($w = 0; $w < count($id); $w++):
			
			?>
            
            <option value="<?=$id[$w]?>"><?=$projectnum[$w].' '.$name[$w]?></option>
            
            <?php endfor; ?>
            
		</select>  
        
</fieldset>

<fieldset>
        
		<select id="task-select" class="forms" disabled>
        
			<option value="default" selected="selected" disabled="disabled">Zadatak</option>
            
		</select> 
       
	</fieldset> 
    
    <div id="task-duration-holder-<?=$day?><?=$i?>">
        

	<fieldset>       

            <select id="hour-select-<?=$day?><?=$i?>" class="forms-duration">
            
            	<option value="default" selected="selected">H</option>
            
            	<?php for($g = 1; $g < 25; $g++): ?>
        
				<option value="<?=$g?>"><?=$g?></option>
                
                <?php endfor; ?>
            
       		</select>
            
            <span class="left"> sati </span>
       
       		<select id="minute-select-<?=$day?><?=$i?>" class="forms-duration">
            
            	<option value="default" selected="selected">M</option>
        
				<option value="0">0</option>
                
                <option value="30">30</option>
            
       		</select>
            
            <span class="left"> min. </span>
            
            </fieldset> 
            
      </div>	
      