<?
/*
function imagemLista($imagem, $lar=100, $alt=100){
	
	//testar se ja existe
	if ($imagem){
		$path=dirname($imagem) . "/lista/";
		if (!is_dir($path)) mkdir ($path, 777);
		$imagem_lista=$path . basename($imagem);
		//print "$image_name<br>";
		if (!(file_exists($imagem_lista)))
			return thumbnail2( $imagem, $imagem_lista, $lar,$alt);
		return $imagem_lista;
	}	
}

function thumbnail2($orig_file, $dest_file, $new_w, $new_h) { 
	
	$src_img = imagecreatefromjpeg($orig_file);
	
	$old_x=imageSX($src_img); 
	$old_y=imageSY($src_img); 
	if (($old_x<= $new_w) && ($old_y<= $new_h)) return $orig_file;
	
	$ratio_y=$new_h/$old_y;
	$ratio_x=$new_w/$old_x;

	$ratio=min($ratio_x,$ratio_y);
	
	$thumb_w=$old_x*($ratio);
	$thumb_h=$old_y*($ratio);

	$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
	imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);

	//$image_name=dirname($name) . "/thumb/". basename($name);
	//print $dest_file;
	if (imagejpeg($dst_img,$dest_file )) return $dest_file;
	
	return false;
}
*/
function reverseDate($data){
	$d=explode("-",$data);
	return $d[2] ."-". $d[1] ."-". $d[0] ;
}

function formataNumero($number){
	return number_format($number, 2, ',', ' ');
}
?>