public function getFindLoved($data)
{
$str = array();
if($data['fname'])
{
$str[] = 'f_name = "'. $data['fname'].'"';
}
if($data['lname'])
{
$str[] = 'l_name = "'. $data['lname'].'"';
}
if($data['city'])
{
$str[] = 'city = "'. $data['city'].'"';
}
if($data['state'])
{
$str[] = 'state = "'. $data['state'].'"';
}
if($data['dob'])
{
$str[] = 'dob = "'. $data['dob'].'"';
}
if($data['dod'])
{
$str[] = 'dod = "'. $data['dod'].'"';
}
if($data['cemetry'])
{
$str[] = 'cemetryid = "'. $data['cemetry'].'"';
}
$wherestr = implode(" AND ",$str);
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query = 'SELECT * FROM #__listloved WHERE '.$wherestr ;
$db->setQuery($query);
$db->query();
$num_rows = $db->getNumRows();
return $rows = $db->loadObjectList();
}
EmoticonEmoticon