load_lang(); $db = new Database(); $stmt = $db->query( "SELECT contacts_v2.lastname as lastname, contacts_v2.firstname as firstname, contacts_v2.contact_id as contact_id, contacts_v2.society as society, contacts_v2.function as function, contacts_v2.other_data as other_data, contacts_v2.is_corporate_person as is_corporate_person, contacts_v2.user_id as user_id, contacts_v2.title as title, contacts_v2.enabled as enabled, contact_addresses.email as email, contact_addresses.phone as phone FROM " .APPS_CONTACTS_V2. " INNER JOIN ".APPS_CONTACTS_ADDRESSES." ON contacts_v2.contact_id = contact_addresses.contact_id ORDER BY contacts_v2.lastname, contacts_v2.society "); //$db->show(); $i=0; $notesList = ''; if ($stmt->rowCount() < 1) { $notesList .= 'no contacts'; } else { while ($line = $stmt->fetchObject()) { if(($line->user_id == $_SESSION['user']['UserId']) || ($line->user_id == "")) { if($line->is_corporate_person == "N") { $notesList .= '
' .functions::xssafe($line->email). ' ' .functions::xssafe($line->phone). '
'; } else { $notesList .= '
' .functions::xssafe($line->email). ' ' .functions::xssafe($line->phone). '
'; } } } } ?>