コード例 #1
0
ファイル: index_4_7_2015.php プロジェクト: bhushansonar/hammu
function getUserInfo($userId)
{
    global $BOL_AvatarService_inst;
    global $Userservice;
    global $QuestionService;
    global $PHOTO_BOL_PhotoService_inst;
    global $language;
    $user_data = array();
    $user_account = $Userservice->findUserById($userId);
    if (!empty($user_account)) {
        $account = $user_account->getAccountType();
        $filed_array = array(HAMMU_DB_IM_USING_HAMMU_AS_KEY);
        $check_type_client_escort = getallquestions(array("user_id" => $userId, "fields" => $filed_array));
        $type_check = $check_type_client_escort[0]['userSelectedValue'];
        if ($type_check == "1") {
            $type = "preferences";
            $sex = "client";
        } else {
            $sex = "escort";
            $type = "services";
        }
    }
    $filed = array(HAMMU_DB_PREFRENCES_KEY, HAMMU_DB_SERVICES_KEY);
    $all_services_preferences = getallquestions(array("user_id" => $userId, "fields" => $filed));
    //hardik edit
    $userinfoData = $QuestionService->getQuestionData(array($userId), array('id', 'username', 'birthdate', 'email', 'googlemap_location', HAMMU_DB_SERVICES_KEY, HAMMU_DB_MOBILE_NUMBER_KEY, HAMMU_DB_PRICE_KEY, HAMMU_HOTEL_SERVICE, HAMMU_HOME_VISIT, HAMMU_AVAILABLE_AT, HAMMU_SECRET_FANTASY, HAMMU_LANGUAGE, HAMMU_COUNTRY));
    //print_r($userinfoData);
    $avatar = $BOL_AvatarService_inst->getDataForUserAvatars(array($userId));
    $onlineStatus = $Userservice->findOnlineStatusForUserList(array($userId));
    $available = "";
    if (count($all_services_preferences) > 0) {
        foreach ($all_services_preferences as $key => $user_services_preferences) {
            $user[HAMMU_DB_PRICE_KEY] = "";
            if (count($userinfoData) > 0) {
                foreach ($userinfoData as $key => $user) {
                    $availableUser = checkAvailableOrNot($key);
                    if ($availableUser == "online") {
                        $available = $language->text("hammu", "available");
                        //"Available";
                    } else {
                        $available = $language->text("hammu", "unavailable");
                        //"Unavailable";
                    }
                    $phone_number = "";
                    if (!empty($user[HAMMU_DB_MOBILE_NUMBER_KEY])) {
                        $phone_number = $user[HAMMU_DB_MOBILE_NUMBER_KEY];
                    }
                    //hardik edited
                    if (!empty($user[HAMMU_HOTEL_SERVICE])) {
                        $hotel_service = $user[HAMMU_HOTEL_SERVICE];
                    } else {
                        $hotel_service = "0";
                    }
                    if (!empty($user[HAMMU_HOME_VISIT])) {
                        $home_visit = $user[HAMMU_HOME_VISIT];
                    } else {
                        $home_visit = "0";
                    }
                    if (!empty($user[HAMMU_AVAILABLE_AT])) {
                        $availabel_at_all = getallquestions(array("user_id" => $userId, "fields" => array(HAMMU_AVAILABLE_AT)));
                        //                            print_r($availabel_at_all);
                        //                            die;
                        $HAMMU_AVAILABLE_AT_VALUE = $availabel_at_all[0]["userSelectedValue"];
                        //$user[HAMMU_AVAILABLE_AT];
                        $HAMMU_AVAILABLE_AT_label = $availabel_at_all[0]["userSelectedLabel"];
                        //$user[HAMMU_AVAILABLE_AT];
                        // $HAMMU_AVAILABLE_AT = $user[HAMMU_AVAILABLE_AT];
                    } else {
                        $HAMMU_AVAILABLE_AT_VALUE = "";
                        $HAMMU_AVAILABLE_AT_label = "";
                    }
                    if (!empty($user[HAMMU_SECRET_FANTASY])) {
                        $secret_fantasy = $user[HAMMU_SECRET_FANTASY];
                    } else {
                        $secret_fantasy = "0";
                    }
                    if (!empty($user[HAMMU_LANGUAGE])) {
                        $HAMMU_LANGUAGE = $user[HAMMU_LANGUAGE];
                    } else {
                        $HAMMU_LANGUAGE = "";
                    }
                    if (!empty($user[HAMMU_COUNTRY])) {
                        $HAMMU_COUNTRY = $user[HAMMU_COUNTRY];
                    } else {
                        $HAMMU_COUNTRY = "";
                    }
                    $dob = date("d-m-Y", strtotime($user["birthdate"]));
                    $age = ageCalculate($dob);
                    $userKeyId = $key;
                    $photos = $PHOTO_BOL_PhotoService_inst->findPhotoListByUserId($userKeyId, 1, 500);
                    $user_data = array("user_id" => $key, "email" => $user["email"], "user_name" => $user["username"], "address" => !empty($user["googlemap_location"]["address"]) ? $user["googlemap_location"]["address"] : "", "phone_number" => $phone_number, "birthdate" => $dob, "age" => "{$age}", "profile_picture" => $avatar[$key]["src"], "prices" => !empty($user[HAMMU_DB_PRICE_KEY]) ? $user[HAMMU_DB_PRICE_KEY] : "", "services" => $user_services_preferences['userSelectedValue'], "services_name" => $user_services_preferences['userSelectedLabel'], "location" => array("latitude" => $user["googlemap_location"]["latitude"], "longitude" => $user["googlemap_location"]["longitude"]), "available" => $available, HAMMU_HOTEL_SERVICE => $hotel_service, HAMMU_HOME_VISIT => $home_visit, HAMMU_AVAILABLE_AT => $HAMMU_AVAILABLE_AT_VALUE, HAMMU_AVAILABLE_AT . "_label" => $HAMMU_AVAILABLE_AT_label, HAMMU_SECRET_FANTASY => $secret_fantasy, HAMMU_LANGUAGE => $HAMMU_LANGUAGE, HAMMU_COUNTRY => $HAMMU_COUNTRY, "image" => $photos);
                }
            }
        }
    }
    return $user_data;
}
コード例 #2
0
function getUserInfo($userId)
{
    //    echo "call->" . $userId;
    //    exit;
    global $BOL_AvatarService_inst;
    global $Userservice;
    global $QuestionService;
    $user_data = array();
    $user_account = $Userservice->findUserById($userId);
    if (!empty($user_account)) {
        $account = $user_account->getAccountType();
        $filed_array = array(HAMMU_DB_IM_USING_HAMMU_AS_KEY);
        $check_type_client_escort = getallquestions(array("user_id" => $userId, "fields" => $filed_array));
        $type_check = $check_type_client_escort[0]['userSelectedValue'];
        if ($type_check == "1") {
            $type = "preferences";
            $sex = "client";
        } else {
            $sex = "escort";
            $type = "services";
        }
    }
    //$userInfo = $BOL_AvatarService_inst->getDataForUserAvatars(array($userId));
    $filed = array(HAMMU_DB_PREFRENCES_KEY, HAMMU_DB_SERVICES_KEY);
    $all_services_preferences = getallquestions(array("user_id" => $userId, "fields" => $filed));
    // echo "userid-->" . $userId;
    // 'field_e9795a9d3be797f58aab38b1033265a4'
    $userinfoData = $QuestionService->getQuestionData(array($userId), array('id', 'username', 'birthdate', 'email', 'googlemap_location', HAMMU_DB_SERVICES_KEY, HAMMU_DB_MOBILE_NUMBER_KEY, HAMMU_DB_PRICE_KEY));
    $avatar = $BOL_AvatarService_inst->getDataForUserAvatars(array($userId));
    $onlineStatus = $Userservice->findOnlineStatusForUserList(array($userId));
    //    print_r($onlineStatus);
    //    exit;
    foreach ($all_services_preferences as $key => $user_services_preferences) {
        $user[HAMMU_DB_PRICE_KEY] = "";
        foreach ($userinfoData as $key => $user) {
            //  print_r($user);
            $phone_number = "";
            if (!empty($user[HAMMU_DB_MOBILE_NUMBER_KEY])) {
                $phone_number = $user[HAMMU_DB_MOBILE_NUMBER_KEY];
            }
            $dob = date("d-m-Y", strtotime($user["birthdate"]));
            $age = ageCalculate($dob);
            $user_data = array("user_id" => $key, "email" => $user["email"], "user_name" => $user["username"], "address" => !empty($user["googlemap_location"]["address"]) ? $user["googlemap_location"]["address"] : "", "phone_number" => $phone_number, "birthdate" => $dob, "age" => "{$age}", "profile_picture" => $avatar[$key]["src"], "price" => !empty($user[HAMMU_DB_PRICE_KEY]) ? $user[HAMMU_DB_PRICE_KEY] : "", "services" => $user_services_preferences['userSelectedLabel'], "available" => !empty($onlineStatus[$key]) ? "Online" : "Offline");
        }
    }
    //    echo "<pre>";
    //    print_r($user_data);
    //    exit;
    //    $usersInfo['avatars'][$userId] = $userInfo[$userId]['src'];
    //    $usersInfo['urls'][$userId] = $userInfo[$userId]['url'];
    //    $usersInfo['names'][$userId] = $userInfo[$userId]['title'];
    //    $usersInfo['roleLabels'][$userId] = array(
    //        'label' => $userInfo[$userId]['label'],
    //        'labelColor' => $userInfo[$userId]['labelColor']
    //    );
    //
    //    $user = array(
    //        'id' => $userId,
    //        'avatarUrl' => $usersInfo['avatars'][$userId],
    //        'name' => $usersInfo['names'][$userId],
    //    );
    return $user_data;
}
コード例 #3
0
function getUserInfo($userId)
{
    global $BOL_AvatarService_inst;
    global $Userservice;
    global $QuestionService;
    global $PHOTO_BOL_PhotoService_inst;
    $user_data = array();
    $user_account = $Userservice->findUserById($userId);
    if (!empty($user_account)) {
        $account = $user_account->getAccountType();
        $filed_array = array(HAMMU_DB_IM_USING_HAMMU_AS_KEY);
        $check_type_client_escort = getallquestions(array("user_id" => $userId, "fields" => $filed_array));
        $type_check = $check_type_client_escort[0]['userSelectedValue'];
        if ($type_check == "1") {
            $type = "preferences";
            $sex = "client";
        } else {
            $sex = "escort";
            $type = "services";
        }
    }
    $filed = array(HAMMU_DB_PREFRENCES_KEY, HAMMU_DB_SERVICES_KEY);
    $all_services_preferences = getallquestions(array("user_id" => $userId, "fields" => $filed));
    $userinfoData = $QuestionService->getQuestionData(array($userId), array('id', 'username', 'birthdate', 'email', 'googlemap_location', HAMMU_DB_SERVICES_KEY, HAMMU_DB_MOBILE_NUMBER_KEY, HAMMU_DB_PRICE_KEY));
    $avatar = $BOL_AvatarService_inst->getDataForUserAvatars(array($userId));
    $onlineStatus = $Userservice->findOnlineStatusForUserList(array($userId));
    $available = "";
    foreach ($all_services_preferences as $key => $user_services_preferences) {
        $user[HAMMU_DB_PRICE_KEY] = "";
        foreach ($userinfoData as $key => $user) {
            $availableUser = checkAvailableOrNot($key);
            if ($availableUser == "online") {
                $available = "Available";
            } else {
                $available = "Unavailable";
            }
            $phone_number = "";
            if (!empty($user[HAMMU_DB_MOBILE_NUMBER_KEY])) {
                $phone_number = $user[HAMMU_DB_MOBILE_NUMBER_KEY];
            }
            $dob = date("d-m-Y", strtotime($user["birthdate"]));
            $age = ageCalculate($dob);
            $userKeyId = $key;
            $photos = $PHOTO_BOL_PhotoService_inst->findPhotoListByUserId($userKeyId, 1, 500);
            $user_data = array("user_id" => $key, "email" => $user["email"], "user_name" => $user["username"], "address" => !empty($user["googlemap_location"]["address"]) ? $user["googlemap_location"]["address"] : "", "phone_number" => $phone_number, "birthdate" => $dob, "age" => "{$age}", "profile_picture" => $avatar[$key]["src"], "price" => !empty($user[HAMMU_DB_PRICE_KEY]) ? $user[HAMMU_DB_PRICE_KEY] : "", "services" => $user_services_preferences['userSelectedValue'], "services_name" => $user_services_preferences['userSelectedLabel'], "location" => array("latitude" => $user["googlemap_location"]["latitude"], "longitude" => $user["googlemap_location"]["longitude"]), "available" => $available, "image" => $photos);
        }
    }
    return $user_data;
}
コード例 #4
0
function getUserInfo($userId)
{
    // echo "call->" . $userId;
    global $BOL_AvatarService_inst;
    global $Userservice;
    global $QuestionService;
    $user_data = array();
    $user_account = $Userservice->findUserById($userId);
    if (!empty($user_account)) {
        $account = $user_account->getAccountType();
        if ($account == "8cc28eaddb382d7c6a94aeea9ec029fb") {
            $sex = "lady";
            $type = "services";
        } else {
            $type = "preferences";
            $sex = "gentleman";
        }
    }
    //$userInfo = $BOL_AvatarService_inst->getDataForUserAvatars(array($userId));
    $filed = array('field_f2d8bb949d7d74a70bcb2003abc5b436', 'field_f92bbdb57510b86ba6c506c487be3aa1');
    $all_services_preferences = getallquestions(array("user_id" => $userId, "fields" => $filed));
    // echo "userid-->" . $userId;
    $userinfoData = $QuestionService->getQuestionData(array($userId), array('id', 'username', 'birthdate', 'email', 'googlemap_location', 'field_f92bbdb57510b86ba6c506c487be3aa1', 'field_e9795a9d3be797f58aab38b1033265a4', 'field_391797ad0e06d17d5b5cec0e48def7c2', 'field_d3d1470339c8d689ab705fd19a509655'));
    //print_r($userinfoData);
    $avatar = $BOL_AvatarService_inst->getDataForUserAvatars(array($userId));
    $onlineStatus = $Userservice->findOnlineStatusForUserList(array($userId));
    foreach ($all_services_preferences as $key => $user_services_preferences) {
        $user["field_d3d1470339c8d689ab705fd19a509655"] = NULL;
        // print_r($userinfoData);
        foreach ($userinfoData as $key => $user) {
            //  print_r($user);
            $phone_number = Null;
            if (!empty($user["field_391797ad0e06d17d5b5cec0e48def7c2"])) {
                $phone_number = $user["field_391797ad0e06d17d5b5cec0e48def7c2"];
            }
            $dob = date("d-m-Y", strtotime($user["birthdate"]));
            $age = ageCalculate($dob);
            $user_data = array("user_id" => $key, "email" => $user["email"], "user_name" => $user["username"], "address" => !empty($user["googlemap_location"]["address"]) ? $user["googlemap_location"]["address"] : "", "phone_number" => $phone_number, "birthdate" => $dob, "age" => "{$age}", "profile_picture" => $avatar[$key]["src"], "price" => !empty($user["field_d3d1470339c8d689ab705fd19a509655"]) ? $user["field_d3d1470339c8d689ab705fd19a509655"] : "", "services" => $user_services_preferences['userSelectedLabel'], "available" => !empty($onlineStatus[$key]) ? "Online" : "Offline");
        }
    }
    //    echo "<pre>";
    //    print_r($user_data);
    //    exit;
    //    $usersInfo['avatars'][$userId] = $userInfo[$userId]['src'];
    //    $usersInfo['urls'][$userId] = $userInfo[$userId]['url'];
    //    $usersInfo['names'][$userId] = $userInfo[$userId]['title'];
    //    $usersInfo['roleLabels'][$userId] = array(
    //        'label' => $userInfo[$userId]['label'],
    //        'labelColor' => $userInfo[$userId]['labelColor']
    //    );
    //
    //    $user = array(
    //        'id' => $userId,
    //        'avatarUrl' => $usersInfo['avatars'][$userId],
    //        'name' => $usersInfo['names'][$userId],
    //    );
    return $user_data;
}
コード例 #5
0
function listing()
{
    global $Userservice;
    global $QuestionService;
    global $BOL_AvatarService_inst;
    global $PHOTO_BOL_PhotoService_inst;
    $app = \Slim\Slim::getInstance();
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->setStatus(200);
    $user_id = $app->request()->params('user_id');
    $location = $app->request()->params('location');
    $urlencode_address = urlencode($location);
    $geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $urlencode_address . '&sensor=false');
    $output = json_decode($geocode);
    if (!empty($output->results[0]->geometry->location->lng)) {
        $data_location['googlemap_location']['address'] = $output->results[0]->formatted_address;
        $data_location['googlemap_location']['latitude'] = $output->results[0]->geometry->location->lat;
        $data_location['googlemap_location']['longitude'] = $output->results[0]->geometry->location->lng;
        $data_location['googlemap_location']['northEastLat'] = $output->results[0]->geometry->viewport->northeast->lat;
        $data_location['googlemap_location']['northEastLng'] = $output->results[0]->geometry->viewport->northeast->lng;
        $data_location['googlemap_location']['southWestLat'] = $output->results[0]->geometry->viewport->southwest->lat;
        $data_location['googlemap_location']['southWestLng'] = $output->results[0]->geometry->viewport->southwest->lng;
        $data_location['googlemap_location']['json'] = json_encode($output->results[0]);
        $data_location['accountType'] = "8cc28eaddb382d7c6a94aeea9ec029fb";
        $userIdList = $Userservice->findUserIdListByQuestionValues($data_location, 0, BOL_SearchService::USER_LIST_SIZE);
        if (!empty($userIdList)) {
            if (($key = array_search($user_id, $userIdList)) !== false) {
                unset($userIdList[$key]);
            }
            $user_ids = array_values($userIdList);
            $userinfoData = array();
            $userinfoData = $QuestionService->getQuestionData($user_ids, array('id', 'username', 'realname', 'birthdate', 'googlemap_location', 'field_f92bbdb57510b86ba6c506c487be3aa1', 'field_d3d1470339c8d689ab705fd19a509655'));
            $avatar = $BOL_AvatarService_inst->getDataForUserAvatars($user_ids);
            $onlineStatus = $Userservice->findOnlineStatusForUserList($user_ids);
            $user_info = array();
            foreach ($userinfoData as $key => $user) {
                $dob = date("Y/m/d", strtotime($user["birthdate"]));
                $age = ageCalculate($dob);
                $userKeyId = $key;
                $photoService = $PHOTO_BOL_PhotoService_inst;
                $photos = $photoService->findPhotoListByUserId($userKeyId, 1, 500);
                $service = null;
                $service_name = null;
                $price = null;
                if (array_key_exists("field_f92bbdb57510b86ba6c506c487be3aa1", $user)) {
                    $service = renderQuestion($key, "field_f92bbdb57510b86ba6c506c487be3aa1");
                    $service_name = renderQuestion($key, "field_f92bbdb57510b86ba6c506c487be3aa1", true);
                }
                if (array_key_exists("field_d3d1470339c8d689ab705fd19a509655", $user)) {
                    $price = $user["field_d3d1470339c8d689ab705fd19a509655"];
                }
                $user_data[] = array("user_id" => $key, "user_name" => $user["username"], "profile_picture" => $avatar[$key]["src"], "available" => !empty($onlineStatus[$key]) ? "Online" : "Offline", "age" => "{$age}", "prices" => $price, "services" => $service, "services_name" => $service_name, "location" => array("latitude" => $user["googlemap_location"]["latitude"], "longitude" => $user["googlemap_location"]["longitude"]), "image" => $photos);
            }
            $return_data = array("response_status" => "1", "response_message" => "Successfully", "data" => $user_data);
            $app->response->setBody(json_encode($return_data));
        } else {
            $return_data = array("response_status" => "0", "response_message" => "Fail to get your location Please try again");
            $app->response->setBody(json_encode($return_data));
        }
    } else {
        $return_data = array("response_status" => "0", "response_message" => "unSuccessfully Please try again");
        $app->response->setBody(json_encode($return_data));
    }
}