I'm working on scriptcase and managing pdfp to generate reports, but I have a problem.
I try to print the user's data in a single line, for example:
id ------nombre----------------- datos --------------fecha1 -------fecha2
1 ------ david puc poot ---------dato1,dato2,dato3- 15/dic/2016 15/enero/2017
2------ felipe cabrebra santos--- dato1,dato2,dato3,dato4-- 15/dic/2016 15/enero/2017
however I can not do it.
I'm handling this code:
foreach({rs} as $info){
if($estPaciente != $info[0] ){
$estPaciente = $info[0];
$servicio->CellFitScale(15,0,utf8_decode($info[0]),0,0,'L');
$servicio->CellFitScale(125,0,utf8_decode($info[5]),0,0,'L');
$servicio->CellFitScale(20,0,utf8_decode($info[1]),0,0,'L');
$servicio->Cell(20,0,utf8_decode($info[2]),0,0,'L');
$servicio->Ln(5);
}
if($estPaciente == $info[0] ){
$servicio->CellFitScale(100,0,utf8_decode($info[4]),2,0,'L');
$servicio->Ln(5);
$flag = true;
}
}//fin de foreach
with this code I manage to do this
id --------- nombre -------datos--------- fecha1----------- fecha2
1 ----------david puc poot------ 15/dic/2016---- 15/enero/2017
--------------------------dato1
--------------------------dato2
---------------------------dato3
2 ----------Felipe Cabrera------ 15/dic/2016---- 15/enero/2017
--------------------------dato1
--------------------------dato2
---------------------------dato3
I hope you can help me, it must be simple but I can not figure out how.
My SQL throws me this result:
id*********nombre********descripcion*******fecha1***********fecha2
1**********david puc poot*********dato 1*******15/12/2016******17/01/2017
1**********david puc poot*********dato 2******15/12/2016******17/01/2017
1**********david puc poot*********dato 3*******15/12/2016******17/01/2017
2**********felipe cabrera*********dato 1*********15/12/2016******17/01/2017
2**********felipe cabrera*********dato 2***********15/12/2016******17/01/2017
2**********felipe cabrera*********dato 3*********15/12/2016******17/01/2017
2**********felipe cabrera*********dato 4**********15/12/2016******17/01/2017
2**********felipe cabrera*********dato 5**********15/12/2016******17/01/2017
To sort them I must make the descripcion
field concatenate as long as the user is the same,
so that at the moment of printing, only the user and the data of the descripcion
field appear once.