Ejemplo n.º 1
0
    echo "@" . $get_user_data['screen_name'];
}
?>
				</p>
				<p class="text_btm"><?php 
echo $row['description'];
?>
</p>
			</div>
			<div class="col-md-7 col-sm-7">
				<div class="col-md-3 col-sm-3">
				<?php 
if ($get_user_data['twitter_id'] != '') {
    $tweets_count = getTweetsCount($get_user_data['screen_name']);
    $followers_count = getFollowersCount($get_user_data['screen_name']);
    $retweet_count = getRetweetsCount($get_user_data['screen_name']);
    $favorites_count = getfavoritesCount($get_user_data['screen_name']);
} else {
    $tweets_count = "NA";
    $followers_count = "NA";
    $retweet_count = "NA";
    $favorites_count = "NA";
}
?>
					<p class="nmbr"><?php 
echo $tweets_count;
?>
<br><span class="scl_text">Tweets</span></p>
				</div>
				<div class="col-md-3 col-sm-3">
					<p class="nmbr"><?php 
Ejemplo n.º 2
0
function get_all_offers($client_id = null)
{
    global $conn;
    $sql = "SELECT * FROM offers WHERE client_id=" . $client_id . " ORDER BY created_at DESC";
    $result = $conn->query($sql);
    $return_array = array();
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_assoc()) {
            $team_id = $row['team_id'];
            $offer_id = $row['id'];
            //$sql2 = "SELECT * FROM invites WHERE team_id = ".$row['id']." ORDER BY created_at ASC";
            $sql2 = "SELECT U.*, I.team_id,I.email as email_user, I.is_accepted, UO.status as offer_status FROM invites I JOIN users U ON U.email = I.email JOIN user_offers UO ON U.id=UO.user_id WHERE (I.team_id = " . $team_id . " AND I.is_accepted=1) AND (UO.status =1 AND UO.offer_id=" . $offer_id . ") ORDER BY I.created_at ASC";
            //	echo "<hr>";
            $result2 = $conn->query($sql2);
            //die('--');
            if (@$result2->num_rows > 0) {
                $tweets_count = 0;
                $followers_count = 0;
                $retweets_count = 0;
                $fav_count = 0;
                $row['invites'] = array();
                while ($row2 = $result2->fetch_assoc()) {
                    $screen_name = $row2['screen_name'];
                    $is_accepted = $row2['is_accepted'];
                    $profile_img = '';
                    //$screen_name = 'vkarora42';
                    if ($screen_name != '' && $is_accepted == '1') {
                        $userTimelineObj = getUserTimeline($screen_name);
                        // print_r($userTimelineObj); die;
                        $profile_img = $userTimelineObj->user->profile_image_url;
                        $tweets_count = $tweets_count + $userTimelineObj->user->statuses_count;
                        $followers_count = $followers_count + $userTimelineObj->user->followers_count;
                        $fav_count = $fav_count + $userTimelineObj->user->favourites_count;
                        // print_r(getRetweetsCount($screen_name));
                        $retweets_count = $retweets_count + getRetweetsCount($screen_name);
                        /*$tweets_count = $tweets_count + getTweetsCount($screen_name);
                        		$followers_count = $followers_count + getFollowersCount($screen_name);
                        		$retweets_count = $retweets_count + getRetweetsCount($screen_name);
                        		$fav_count = $fav_count + getfavoritesCount($screen_name);*/
                    }
                    $row2['twt_img'] = $profile_img;
                    $row['invites'][] = $row2;
                }
                $row['twitter_count_total'] = $tweets_count;
                $row['followers_count'] = $followers_count;
                $row['retweets_count'] = $retweets_count;
                $row['fav_count'] = $fav_count;
                $row['offer_id'] = $offer_id;
            }
            $return_array[] = $row;
        }
    }
    // print_r($return_array); die;
    return $return_array;
}