コード例 #1
0
ファイル: like_user.php プロジェクト: Gameonn/tinder
 } catch (Exception $e) {
 }
 $result = $sth->fetchAll(PDO::FETCH_ASSOC);
 $user_id = $result[0]['id'];
 $uname = $result[0]['username'];
 if ($user_id) {
     $sql = "SELECT * from user_like where liked_by=:user_id and liked_to=:user_id2";
     $sth = $conn->prepare($sql);
     $sth->bindValue('user_id', $user_id);
     $sth->bindValue('user_id2', $user_id2);
     try {
         $sth->execute();
     } catch (Exception $e) {
     }
     $likes = $sth->fetchAll();
     $other_like_status = GeneralFunctions::getLikeStatus($user_id, $user_id2);
     $push_check = GeneralFunctions::PushCheck($user_id2);
     $new_match = $push_check[0]['new_matches'];
     //push notification code
     $user = GeneralFunctions::get_push_ids($user_id2);
     $apnid = $user[0]['apn_id'];
     $oid = $user[0]['id'];
     $reg_ids[] = $user[0]['reg_id'];
     $message = array();
     $message['msg'] = $uname . ' and you have a match';
     $message['type'] = 'match';
     //match-push
     $message['uid'] = $user_id;
     $type = 'match';
     if (count($likes)) {
         $sql = "UPDATE user_like set status=:status where liked_by=:user_id and liked_to=:user_id2";