marcq
Member
Hi,
I'm creating a form detail view PDF template.
I'm trying to retrieve the label of the databasejoin Element "fab_booking_44_repeat.categorie" in a query, I get the id :
Would appreciate, if someone could explain me how to solve this issue.
Thanks in advance.
Marc
I'm creating a form detail view PDF template.
I'm trying to retrieve the label of the databasejoin Element "fab_booking_44_repeat.categorie" in a query, I get the id :
Code:
1 | 2 | 20.20 |
2 | 10 | 25.00 |
2 | 10 | 42.00 |
3 | 20 | 112.00 |
(First value in the array is the id)
Would appreciate, if someone could explain me how to solve this issue.
Thanks in advance.
Marc
PHP:
$bookingid = JRequest::getVar('rowid');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query
->select (array('fab_booking.id', 'fab_booking_44_repeat.categorie', 'fab_booking_44_repeat.nombre_art', 'fab_booking_44_repeat.prix_ttc'))
->from('fab_booking')
->leftJoin('fab_booking_44_repeat ON fab_booking.id = fab_booking_44_repeat.parent_id')
->having('fab_booking.id = ' . $db->quote($bookingid))
->group('fab_booking.id, fab_booking_44_repeat.categorie, fab_booking_44_repeat.nombre_art, fab_booking_44_repeat.prix_ttc');
$db->setQuery($query);
$row = $db->loadObjectList();
echo "<div style='font-family: arial, helvetica, sans-serif; font-size: 11pt;'><UL>";
foreach ($row as $item)
{
echo "<LI> $item->categorie | ";
echo "$item->nombre_art | ";
echo "$item->prix_ttc | <br />";
echo "</LI>";
}
echo "</UL></div>";
Last edited: