<?php 
function formatPDFPositions($positions, $focus) {
	$result = array();
	foreach ($positions as $pos) {
		
		$pos['position'] = intval($pos['position'])+1;
			
		$pos['quantity'] = format_number($pos['quantity'],4,2);
		$pos['price']=format_number($pos['price']);
		$pos['total']=format_number($pos['total']);

		$result[] = $pos;
	}
	
	return $result;
}

function mysql_escape_gpc($dirty)
{
	if (ini_get('magic_quotes_gpc'))
	{
		return $dirty;
	}
	else
	{
		return mysql_real_escape_string($dirty);
	}
}