Hi forum,
In an old CF 4 instance I had a simple but flawlessly working solution for fetching entries in JEvents and choosing them in Chronoforms with dropdown:
http://bodega-peninsula.ch/index.php/anlaesse/year.listevents/2020/08/06/-
So far, so good. But I had to rebuild the shop completely on an actual Joomla and VirtueMart basis. For security reasons, I would like to use CF v7. But I can't bring to work the two code snippets I used in CF v4. There, I simply had this one in "Custom Element":
<?php
$current_day = JFactory::getDate('+0 seconds');
$current_day = $current_day->toUnix();
$options = array();
$db =& JFactory::getDBO();
$query = "
SELECT `dtstart`, `summary`
FROM `#__jevents_vevdetail`
WHERE `dtstart` > " . $current_day ."
ORDER BY `dtstart`;
";
$db->setQuery($query);
$data = $db->loadObjectList();
foreach ( $data as $d ) {
$options[] = "<option value='{$d->summary}'>{$d->summary}</option>";
}
?>
And in the options field, I just had this:
<?php echo implode($options); ?>=<?php echo implode($options); ?>
Even when I don't use the opening and closing tags in the PHP section in CF v7, this won't work.
Thanks for any hint. Guess, I wasted a lot of time trying, because the solution will be fairly simple ;-)
Martin
In an old CF 4 instance I had a simple but flawlessly working solution for fetching entries in JEvents and choosing them in Chronoforms with dropdown:
http://bodega-peninsula.ch/index.php/anlaesse/year.listevents/2020/08/06/-
So far, so good. But I had to rebuild the shop completely on an actual Joomla and VirtueMart basis. For security reasons, I would like to use CF v7. But I can't bring to work the two code snippets I used in CF v4. There, I simply had this one in "Custom Element":
<?php
$current_day = JFactory::getDate('+0 seconds');
$current_day = $current_day->toUnix();
$options = array();
$db =& JFactory::getDBO();
$query = "
SELECT `dtstart`, `summary`
FROM `#__jevents_vevdetail`
WHERE `dtstart` > " . $current_day ."
ORDER BY `dtstart`;
";
$db->setQuery($query);
$data = $db->loadObjectList();
foreach ( $data as $d ) {
$options[] = "<option value='{$d->summary}'>{$d->summary}</option>";
}
?>
And in the options field, I just had this:
<?php echo implode($options); ?>=<?php echo implode($options); ?>
Even when I don't use the opening and closing tags in the PHP section in CF v7, this won't work.
Thanks for any hint. Guess, I wasted a lot of time trying, because the solution will be fairly simple ;-)
Martin