コード例 #1
0
     $results = $Profile->fetchProfileByGym($term);
     echo json_encode($results);
     break;
 case 'like_feed':
     $user_id = $_POST['user_id'];
     $feed_id = $_POST['feed_id'];
     $friend_id = $_POST['friend_id'];
     $info = $Profile->fetchProfile($user_id);
     $data = array('user_id' => $friend_id, 'other_id' => $user_id, 'person_name' => $info['name'], 'person_lastname' => $info['surname'], 'type' => 2);
     echo $Relation->likeFeed($user_id, $feed_id);
     echo $Relation->createNotification($data);
     break;
 case 'unlike_feed':
     $user_id = $_POST['user_id'];
     $feed_id = $_POST['feed_id'];
     echo $Relation->unlikeFeed($user_id, $feed_id);
     break;
 case 'editAvatarLink':
     $user_id = $_POST['user_id'];
     $avatar_url = basename($_POST['avatarURL']);
     if ($Profile->editAvatarLink($user_id, $avatar_url)) {
         echo json_encode('updated');
     }
     break;
 case 'check_update':
     $user_id = $_POST['user_id'];
     $type = $_POST['type'];
     if ($type == 'messages-popup') {
         echo $Inbox->checkInbox($user_id);
     } else {
         if ($type == 'notification-popup') {