<?php
	function limpiaVal($val)
	{
		$val = str_replace(".","",$val);
		$val = str_replace("€","",$val);
		return $val; 
	}
	
	function limpiaFecha($val)
	{
		$val = str_replace("-","/",$val);
		$val = explode("/",$val);
		$val = "'".$val[2] . "-" . $val[1] . "-" . $val[0]."'";
		return $val;
	}
	
	function muestraVal($val)
	{
		//return "<![CDATA[".number_format($val,0,',','.')." &euro;]]>";
		return "<![CDATA[".number_format($val,0,',','.')."]]>";
	}
	
	function muestraFecha($val)
	{
		if($val)
		{
			$val = str_replace(" 00:00:00","", $val);
			$val = explode("-", $val);
			$val = $val[2]."/".$val[1]."/".$val[0];
		}
		return "<![CDATA[".$val."]]>";
	}
	
	function muestraStr($val)
	{
		return "<![CDATA[".utf8_encode($val)."]]>";
	}
	
	function xmlDoc()
	{
		if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
			header("Content-type: application/xhtml+xml");
		} else {
			header("Content-type: text/xml");
		}		
    	print '<?xml version="1.0" encoding="iso-8859-1"?>'."\n";
	}
?>