/*
*/
?>
//team name is already translated?>
Players Stats: ASTERAS AKTOR
global $globalsForView;
$globalsForView = $params;
$globalsForView['html'] = $html;
$globalsForView['columns'] = $columns;
$globalsForView['competitionSelected'] = $competitionSelected;
$globalsForView['teamSelected'] = $teamSelected;
function createTableStatsUrl($name, $params=array()){
global $globalsForView;
$html = $globalsForView['html'];
$columns = $globalsForView['columns'];
if(array_key_exists($globalsForView['by'], $columns)){
$by = $globalsForView['by'];
}
if($params['nodir']){
unset($params['nodir']);
$dir = $params['dir'] ? $params['dir'] : $globalsForView['dir'];
}elseif($globalsForView['by']==$params['by']){
$dir = ($globalsForView['dir'] == 'asc') ? 'desc' : 'asc';
}elseif($params['by']=='player_fullname'){
$dir = 'asc';
}
return $html->link(
$name,
array_merge(
array(
'controller' => 'statistics',
'action' => 'playerstats',
$globalsForView['competitionSelected'] ? $globalsForView['competitionSelected'] : null,
$globalsForView['teamSelected'] ? $globalsForView['teamSelected'] : null,
'by' => $by,
'dir' => $dir,
'page' => '1'
),
$params
)
);
}
function renderPlayerFullName($r){
global $globalsForView;
$lang_ext=Configure::read('lang');
$html = $globalsForView['html'];
$currentCompetitionId=$globalsForView['competitionSelected'];
if($r['player_fullname']===null){
echo __('totals',true);
}else{
echo $html->link($r['player_fullname'], array('controller'=>'players', 'action'=>'view',$r['player_id'])). '
(' .
$html->link($r['team_abbr'], array('controller'=>'statistics', 'action'=>'playerstats',$currentCompetitionId,$r['team_id'])) .
')';
}
}
function renderGoalsAttempts($r){
if($r['SUM_goals']>0)
{
echo '1/' . round($r['SUM_attempts_on_goal']/$r['SUM_goals'], 1);
}
else
{
echo '-';
}
}
function renderPerfCrossesCrosses($r){
echo $r['SUM_crosses_total_success'] . '/' . $r['SUM_crosses_total_all'];
}
function renderEvaluation($r){
echo round($r['AVG_evaluation'],1);
}
?>
$cnt=1;
foreach($columns as $k=>$v){
if($columns[$k][1]!==false){
if($cnt==1)
{
$first=' first';
$firstClass=' class="first"';
}
else
{
$first='';
$firstClass='';
}
$keyLower=strtolower($k);
$cnt++;
echo "';
echo createTableStatsUrl($v[1], array('by' => $k, 'page' => '1')) . " | \n";
}
}
?>
$trfirst = ' first';
$cnt=1;
foreach($players as $r){
if($cnt==1) $trfirst.=' totals';
echo (($cnt++%2)==1) ? $class = "" : $class = "
\n";
$trfirst = '';
$first = ' first';
foreach($r as $k=>$v){
if($columns[$k][2]!==false){
echo '';
if(function_exists($columns[$k][2])){
echo $columns[$k][2]($r);
}else{
echo $v;
}
echo " | \n";
$first = null;
}
}
echo "
\n";
}
?>