SoilentRed
Caaan do!
I have a calc element that generates an or clause in my form. It runs the calc on the page load.
I see it returning the result successfully on the form. Yay!
I'm trying to put that result in the data - where statement for a dropdown element. Here is the Joins where and/or order by statement (SQL)
But here is what I'm getting with the fabrik debugger
It's not taking the placeholder and the dropdown isn't loading anything.
I've played a little bit with the ajax option, and tried some of the tips you mentioned on the wiki, but I'm not sure if I am understanding or doing it correctly.
Any thoughts?
Code:
// Get a list of the member's jomsocial group ids
$db = JFactory:: getDbo();
$db->setQuery('SELECT groupid FROM #__community_groups_members WHERE memberid = {$my->id}');
$rows = $db->loadObjectList();
// Get a list of group leader ids
foreach ($rows as $row) {
$db->setQuery('SELECT ownerid FROM #__community_groups WHERE id = '.$row->groupid);
$leaders = $db->loadObjectList();
foreach ($leaders as $leader) {
$groupleaders[] = $leader->ownerid;
}
}
// remove duplicate group leader ids
$scrubLeaders = array_unique($groupleaders);
// Get list of groups belonging to the member's group leader
foreach ($scrubLeaders as $gl) {
$db->setQuery('SELECT id FROM #__community_groups WHERE ownerid = '.$gl);
$accessableGroups = $db->loadObjectList();
// load accessible groups into array
foreach ($accessableGroups as $ag) {
$groups[] = (int)$ag->id;
}
}
foreach ($groups as $group) {
$orClause[] = ' OR cm1.groupid = '. $group;
}
$final = implode('', $orClause);
return $final;
Code:
OR cm1.groupid = 35 OR cm1.groupid = 36 OR cm1.groupid = 38
Code:
WHERE {thistable}.id IN
(
SELECT cm1.memberid FROM jomla_community_groups_members cm1 WHERE cm1.groupid = 99999999999 {lead_swap___groups_or_clause_raw}
)
AND {thistable}.id <>{$my->id}
AND {thistable}.block = '0'
Code:
SELECT DISTINCT(`jomla_users`.`email`) AS value, `name` AS text
FROM `jomla_users` AS `jomla_users`
WHERE `jomla_users`.id IN
(
SELECT cm1.memberid FROM jomla_community_groups_members cm1 WHERE cm1.groupid = 99999999999
)
AND `jomla_users`.id <>2643
AND `jomla_users`.block = '0' AND 7 = -7
ORDER BY text ASC
I've played a little bit with the ajax option, and tried some of the tips you mentioned on the wiki, but I'm not sure if I am understanding or doing it correctly.
Any thoughts?