kouros91
Member
Hi
I have a date element DATEVERS and i have a php condition for validation.
I have another element date in another table named VARDATE.
I would like that Validation for DATEVERS is good for DATEVERS>VARDATE
I'm written this code but it doesn't work :
My element VARDATE from g363_users can be accessed with a list names utilisateurs
it's {utilisateurs___VARDATE} (when id = user id)
Thank you for help
Nicolas
I have a date element DATEVERS and i have a php condition for validation.
I have another element date in another table named VARDATE.
I would like that Validation for DATEVERS is good for DATEVERS>VARDATE
I'm written this code but it doesn't work :
Code:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$my_userid = '{$my->id}';
$query
->select('VARDATE')
->from('g363_users')
->where('id = ' . $db->quote($my_userid));
$db->setQuery($query);
$fieldA = $db->loadResult();
$thedate = strtotime($fieldA);
$date = JFactory::getDate($data);
$date = $date->toUnix();
//$midnight = JFactory::getDate(strtotime('today'));
$thedate = $thedate->toUnix();
if ($date < $thedate){
return true;
}else{
return false;
}
My element VARDATE from g363_users can be accessed with a list names utilisateurs
it's {utilisateurs___VARDATE} (when id = user id)
Thank you for help
Nicolas