<?php

    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 MAX(project_num) FROM project WHERE parent = '".$client."' AND project_year = '".date("y")."'"); 
 
 $result = $database->loadResult();
 
 if($result == ''){$result = 1; echo '00'.$result;}
 
 else {

	$result = $result + 1;
	
	if($result < 100){
		
		if($result < 10){ echo '00'.$result;}
		
		else { echo '0'.$result; }
		
		}
		
		else {echo $result;}
	
	
 }
?>