<style type="text/css">
.highlightDateMatch {
    /* background: #7FE866 url(/static/images/checkbox-checked-64px.png) no-repeat right center !important;*/
	background: none;
}
</style>

<?php
$userModel = new userModel();
$user_favs = [];
if ($_SESSION['loggedin'] && !empty($_SESSION['user_id']))
    $user_favs = $userModel->getFavorites($_SESSION['user_id'], userModel::FAVTYPE_USER);

foreach ($nearby_users as $user) :
    $sess_user = $_SESSION['user'];

    if ($sess_user['id'] == $user['id'])
        continue;

    if ($_SESSION['loggedin'] && !empty($_SESSION['user_id']))
        $is_favorited_user = in_array($user['id'], array_keys($user_favs));

    $last_seen_date = empty($user['date_last_coordinates']) || "0000-00-00 00:00:00" === $user['date_last_coordinates'] ? "Unknown" : date("m/d/Y H:i", strtotime($user['date_last_coordinates']));

    $maps_link = "#";
    if ($last_seen_date != "Unknown")
        $maps_link = " https://maps.google.com/maps?q=" . $user['location_last_lat'] . "," . $user['location_last_lng'];

    $premium_text = $user['premium_status'] ? " &bull; <b>Premium</b>" : "";
    $match_class  = !empty($user['contacted_me']) ? "highlightDateMatch" : "";

    require 'views/profile/nearby-user-row.tpl.php';
endforeach;
?>