<?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->setBareQuery("SELECT id, name, project_num, project_year  FROM project WHERE parent = '".$client."' ORDER BY project_year DESC, project_num DESC");

				$project_id = $database->loadResultArray(0);
		
				$projectname = $database->loadResultArray(1);
				
				$projectnum = $database->loadResultArray(2);
				
				$projectyr = $database->loadResultArray(3);
				
				
				

		


?>

<fieldset>
    
    	<select id="<?=$daycount?>-<?=$day?>-project" class="forms project" >
        
			<option value="default" selected="selected">Izaberi projekat</option>
            
            <?php 

				for($w = 0; $w < count($project_id); $w++): 
				
				if($projectnum[$w] < 100){if($projectnum[$w]<10){$visiblenum = '00'.$projectnum[$w];}else{$visiblenum = '0'.$projectnum[$w];}}
				else {$visiblenum = $projectnum[$w];}
			
			?>
            <option value="<?=$project_id[$w]?>"><?=$projectyr[$w].$visiblenum.' '.$projectname[$w]?></option>
            
            <?php endfor; ?>
            
		</select>  
        
	</fieldset>