Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/09/2014, 18:02
juansemaster
 
Fecha de Ingreso: noviembre-2005
Mensajes: 144
Antigüedad: 18 años, 5 meses
Puntos: 2
Respuesta: como hacer un str_replace al crear un PDF

Despues de revisar los archivos de la classe FPDF, estoy seguro que tengo que insertar mi script para remplazar acentos en el archivo mysql_table.php mas exacto en la function Table, pero no encuentro la variable a utilizar.

Código PHP:
Ver original
  1. function Table($query,$prop=array())
  2. {
  3.     $prop = str_replace ($find, $repl, $prop);
  4.     //Issue query
  5.     $res=mysql_query($query) or die('Error: '.mysql_error()."<BR>Query: $query");
  6.     //Add all columns if none was specified
  7.     if(count($this->aCols)==0)
  8.     {
  9.         $nb=mysql_num_fields($res);
  10.         for($i=0;$i<$nb;$i++)
  11.             $this->AddCol();
  12.     }
  13.     //Retrieve column names when not specified
  14.     foreach($this->aCols as $i=>$col)
  15.     {
  16.         if($col['c']=='')
  17.         {
  18.             if(is_string($col['f']))
  19.                 $this->aCols[$i]['c']=ucfirst($col['f']);
  20.             else
  21.                 $this->aCols[$i]['c']=ucfirst(mysql_field_name($res,$col['f']));
  22.         }
  23.     }
  24.     //Handle properties
  25.     if(!isset($prop['width']))
  26.         $prop['width']=0;
  27.     if($prop['width']==0)
  28.         $prop['width']=$this->w-$this->lMargin-$this->rMargin;
  29.     if(!isset($prop['align']))
  30.         $prop['align']='C';
  31.     if(!isset($prop['padding']))
  32.         $prop['padding']=$this->cMargin;
  33.     $cMargin=$this->cMargin;
  34.     $this->cMargin=$prop['padding'];
  35.     if(!isset($prop['HeaderColor']))
  36.         $prop['HeaderColor']=array();
  37.     $this->HeaderColor=$prop['HeaderColor'];
  38.     if(!isset($prop['color1']))
  39.         $prop['color1']=array();
  40.     if(!isset($prop['color2']))
  41.         $prop['color2']=array();
  42.     $this->RowColors=array($prop['color1'],$prop['color2']);
  43.     //Compute column widths
  44.     $this->CalcWidths($prop['width'],$prop['align']);
  45.     //Print header
  46.     $this->TableHeader();
  47.     //Print rows
  48.     $this->SetFont('Arial','',11);
  49.     $this->ColorIndex=0;
  50.     $this->ProcessingTable=true;
  51.     while($row=mysql_fetch_array($res))
  52.         $this->Row($row);
  53.     $this->ProcessingTable=false;
  54.     $this->cMargin=$cMargin;
  55.     $this->aCols=array();
  56. }