Esempio n. 1
0
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;
}
Esempio n. 2
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;
}