| Statistics Summary | 
			
			
				| Clan: |  | 
			
				| Home Page: |  | 
			
				| Activity: | 40)
						$bar_type = "6";
					elseif ($clandata['activity'] > 30)
						$bar_type = "5";
					elseif ($clandata['activity'] > 20)
						$bar_type = "4";
					elseif ($clandata['activity'] > 10)
						$bar_type = "3";
					elseif ($clandata['activity'] > 5)
						$bar_type = "2";
					echo " ![\"".$clandata['activity']."%\"](\"") ";            
				?> |  | 
			
				| Members: |  | 
			
				| Avg. Member Points: |  | 
			
				| Total Kills: |  | 
				
			
				| Total Deaths: |  | 
            
			
				| Avg. Kills: |  | 
				
			
				| Kills per Death: | %0.2f', $clandata['kills'] / $clandata['deaths']);
					}
					else
					{
						echo '-';
					}
				?> | 
        
			
		    	| Kills per Minute: | 0) {
						echo sprintf("%.2f", ($clandata['kills'] / ($clandata['connection_time'] / 60)));
					} else {
						echo '-'; 
					}
				?> | 
			
				| Total Connection Time: |  | 
			
				| Avg. Connection Time: | 0) {
						echo timestamp_to_str($clandata['connection_time'] / ($clandata['nummembers']));
					} else {
						echo '-'; 
					}
				?> | 
			
				| Favorite Server:* | query("
						SELECT
							hlstats_Events_Entries.serverId,
							hlstats_Servers.name,
							COUNT(hlstats_Events_Entries.serverId) AS cnt
						FROM
							hlstats_Events_Entries
						INNER JOIN
							hlstats_Servers
						ON
							hlstats_Servers.serverId=hlstats_Events_Entries.serverId
						INNER JOIN 
							hlstats_Players
						ON
							(hlstats_Events_Entries.playerId=hlstats_Players.playerId)   
						WHERE   
							clan=$clan
						GROUP BY
							hlstats_Events_Entries.serverId
						ORDER BY
							cnt DESC
						LIMIT 1  	
					");
				    		
					list($favServerId,$favServerName) = $db->fetch_row();
					echo " $favServerName ";
    			?> | 
            
		    	| Favorite Map:* | query("
						SELECT
							hlstats_Events_Entries.map,
							COUNT(map) AS cnt
						FROM
							hlstats_Events_Entries
						INNER JOIN 
							hlstats_Players
						ON
							(hlstats_Events_Entries.playerId=hlstats_Players.playerId)   
						WHERE   
							clan=$clan
						GROUP BY
							hlstats_Events_Entries.map
						ORDER BY
							cnt DESC
						LIMIT 1  	
					");
				    list($favMap) = $db->fetch_row();
					echo " $favMap ";
				?> | 
            
                | Favorite Weapon:* | query("
						SELECT
							hlstats_Events_Frags.weapon,
							hlstats_Weapons.name,
							COUNT(hlstats_Events_Frags.weapon) AS kills,
							SUM(hlstats_Events_Frags.headshot=1) as headshots
						FROM
							hlstats_Events_Frags
						INNER JOIN
							hlstats_Weapons
						ON
							hlstats_Weapons.code = hlstats_Events_Frags.weapon
						INNER JOIN 
                            hlstats_Players
						ON
							hlstats_Events_Frags.killerId=hlstats_Players.playerId
						WHERE
							clan=$clan
						AND
						    hlstats_Weapons.game='$game'
						GROUP BY
							hlstats_Events_Frags.weapon
						ORDER BY
							kills desc, headshots desc
						LIMIT 1
                    ");
                     
					while ($rowdata = $db->fetch_row($result))
					{ 
						$fav_weapon = $rowdata[0];
						$weap_name = htmlspecialchars($rowdata[1]);
					}
					if ($fav_weapon == '')
						$fav_weapon = 'Unknown';
					$image = getImage("/games/$game/weapons/$fav_weapon");
                    // check if image exists
					$weaponlink = "";
						$cellbody = "$weaponlink  ";
                    if ($image) {
                    } else {
						$cellbody = "$weaponlink $weaponlink$weap_name";
                    }
					$cellbody .= "";
                    echo $cellbody;
               ?> |