コード例 #1
0
ファイル: get_matched_chat.php プロジェクト: Gameonn/tinder
$token = $_REQUEST['token'];
$GLOBALS['timezone'] = $_REQUEST['timezone'];
if (!$token) {
    $success = "0";
    $msg = "Incomplete Parameters";
    $data = array();
} else {
    // +-----------------------------------+
    // + STEP 3: perform operations		   +
    // +-----------------------------------+
    $user_id = GeneralFunctions::getUserId($token);
    if ($user_id) {
        //matched users chat conversation messages
        $data['messages'] = Messages::getMatchedChat($user_id) ? Messages::getMatchedChat($user_id) : [];
        //matched users
        $data['users'] = GeneralFunctions::check_match($user_id) ? GeneralFunctions::check_match($user_id) : [];
        if ($data) {
            $success = "1";
            $msg = "Records Found";
        } else {
            $success = '0';
            $msg = "No Record Found";
        }
    } else {
        $success = "0";
        $msg = "Token Expired";
    }
}
// +-----------------------------------+
// + STEP 4: send json data			   +
// +-----------------------------------+
コード例 #2
0
ファイル: check_match.php プロジェクト: Gameonn/tinder
// +-----------------------------------+
// + STEP 2: get data				   +
// +-----------------------------------+
$token = $_REQUEST['token'];
if (!$token) {
    $success = "0";
    $msg = "Incomplete Parameters";
    $data = array();
} else {
    // +-----------------------------------+
    // + STEP 3: perform operations		   +
    // +-----------------------------------+
    //fetching user_id and name based on token
    $user_id = Users::getUserId($token);
    if ($user_id) {
        $match = GeneralFunctions::check_match($user_id) ? GeneralFunctions::check_match($user_id) : [];
        if ($match) {
            $success = '1';
            $msg = "Matches Found";
        } else {
            $success = '1';
            $msg = "No Match Found";
        }
    } else {
        $success = '0';
        $msg = "Token Expired";
    }
}
// +-----------------------------------+
// + STEP 4: send json data		    +
// +-----------------------------------+