<?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;
	
	$year = substr($projectnum, 0, 2);
	
	$projectnum = substr($projectnum, 2, 3)*1;

$database->query("UPDATE project SET name = '".$name."', parent = '".$client."', project_num = '".$projectnum."', project_year = '".$year."', offerno = '".$offerno."' WHERE id = '".$id."'");

if(strlen(mysql_error()) > 0){
	echo mysql_errno().': '.mysql_error();
}
else{
	echo 'success';
}



?>
