Hello everyone.
I’m new developing modules for dolibarr. I made some easy modules before for my own use, just to set up some functions to adapt dolibarr to my country. Right now. I’m a little stuck with showing some data on my PDF.
I made a module for internal control and I also made a dictionary for it but I cannot show the content of the dictionary on the PDF.
This is my code for the column to get dictionary info to the card.php
‘fk_variable’ => array(‘type’=>‘sellist:variable:l abel:code::active=1’, ‘label’=>‘VariableLang’, ‘enabled’=>‘1’, ‘position’=>23, ‘notnull’=>1, ‘visible’=>1,),
So if I but the code below on the PDF I could get the Integer value
$pdf->SetXY($posx +2,$posy+17);
$pdf->SetFont(’’,‘b’,8);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell($widthrecbox, 2, ‘RESULT’.": ".$object->fk_variable, 0, ‘L’);
then if I use this query directly to MySQL I could get the value I want to display
“SELECT m.variable, me.label as result FROM llx_mymodule m, llx_mydictionarie as me WHERE m.variable = me.code”
So I made a mysql_query on pdf to display that value but isn’t working. I hope someone could help me.
$query=mysqli_query("SELECT m.variable, me.label as result FROM "MAIN_DB_PREFIX."mymodule m, ".MAIN_DB_PREFIX.“mydictionarie as me WHERE m.variable = me.code”);
while($data=mysqli_fetch_array($query)){
$pdf->MultiCell($widthrecbox, 2, 'RESULT'.": ".$data['label'], 0, 'L');
}