public function getPersonComingEvents($person)
 {
     if ($person->geo_location == Null) {
         return array();
     }
     $events_query = db_get_next_events_user($person->geo_location);
     return $this->fetchEvents($events_query);
 }
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js";
         d.getElementsByTagName('head')[0].appendChild(js);
       }(document));
    </script>
<?php 
$userId = $facebook->getUser();
db_connect();
$maxevent = db_get_maxevent();
$nextevents_result = db_get_next_events();
if ($userId) {
    $userInfo = $facebook->api('/' + $userId);
    $username = $userInfo['name'];
    $loc = $facebook->api('/me?fields=location');
    //print_r($loc['location']['name']);
    $nextevents_result1 = db_get_next_events_user($loc);
    //fetching user location events
    if ($nextevents_result1) {
        $nextevents_result = $nextevents_result1;
    }
}
?>
  <body>

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>