marcq
Member
Hi,
I would like to limit the returned data to the data (dates) that belongs to the logged in user.
So I have created a prefilter query :
Field : book_crewmember (which contain the value(s) of a Picklist element like ["1","36"]
Condition : equal
Value :
$user = JFactory::getUser();
$userid = $user->get('id');
// var_dump($userid);exit;
$dbcrew = JFactory::getDbo();
// GET THE FABRIK ID FROM THE JOOMLA USER ID
$dbcrew->setQuery("SELECT id FROM fab_crew WHERE userid = '$userid'");
$loggedincrewmember = $dbcrew->loadResult();
// GET THE LOGGED IN ID FROM THE COMMA SEPARATED FIELD
$dbcrew->setQuery("SELECT * FROM fab_booking WHERE find_in_set('$loggedincrewmember',book_crewmember) >0");
I guess I have an issue with the query, since it is returning only one date in the full calendar for logged in members which have more than one "dates" that should be displayed.
I would appreciate your support.
Thank you in advance.
Cheers, marc
I would like to limit the returned data to the data (dates) that belongs to the logged in user.
So I have created a prefilter query :
Field : book_crewmember (which contain the value(s) of a Picklist element like ["1","36"]
Condition : equal
Value :
$user = JFactory::getUser();
$userid = $user->get('id');
// var_dump($userid);exit;
$dbcrew = JFactory::getDbo();
// GET THE FABRIK ID FROM THE JOOMLA USER ID
$dbcrew->setQuery("SELECT id FROM fab_crew WHERE userid = '$userid'");
$loggedincrewmember = $dbcrew->loadResult();
// GET THE LOGGED IN ID FROM THE COMMA SEPARATED FIELD
$dbcrew->setQuery("SELECT * FROM fab_booking WHERE find_in_set('$loggedincrewmember',book_crewmember) >0");
I guess I have an issue with the query, since it is returning only one date in the full calendar for logged in members which have more than one "dates" that should be displayed.
I would appreciate your support.
Thank you in advance.
Cheers, marc
Last edited: