<?php defined('_JEXEC') or die('Restricted access');
if (!isset($this->config['show_matchreport_column'])){$this->config['show_matchreport_column']=0;}
?>
<a name="jl_top" id="jl_top"></a>
<?php
if (!empty($this->matches))
{
$teamid=JRequest::getInt('tid');
?>
<table>
<tr>
<td><?php
echo JText::_($this->teams[$this->ptid]->name); //вывожу имя
?></td>
</tr>
<tr>
<td>
<?php
echo JoomleagueHelper::getPictureThumb($this->teams[$this->ptid]->logo_big,
$this->teams[$this->ptid]->name,
$this->config['150'],
$this->config['150'],1);
?>
</td>
<td width="50"></td>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php
echo JText::_('JL_RANKING_TEAM_ADMIN');
echo JText::_(':');
?></td>
<td width="20"> </td>
<td><?php
echo JText::_($this->teams[$this->ptid]->username);
?></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
</tr>
<tr>
<td> </td>
<td width="20"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td width="20"> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<table class="fixtures" align="center">
<thead>
<tr class="sectiontableheader">
<?php
if ($this->config['show_events'])
{
?>
<th> </th>
<?php
}
?>
<th><?php echo JText::_('JL_TEAMPLAN_MATCHDAY'); ?></th>
<?php
if ($this->config['show_match_number'])
{
?>
<th><?php echo ' '.JText::_('NUM').' '; ?></th>
<?php
}
?>
<?php
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_DIVISION'); ?></th>
<?php
}
?>
<?php
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_PLAYGROUND'); ?></th>
<?php
}
?>
<th><?php echo JText::_('JL_TEAMPLAN_EDIT_DATE'); ?></th>
<?php
if ($this->config['show_time'])
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_EDIT_TIME'); ?></th>
<?php
}
?>
<?php
if ($this->config['show_time_present'])
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_TIME_PRESENT'); ?></th>
<?php
}
switch ($this->config['result_style'])
{
case 1 :
// Show home team marker
echo '<th>';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
echo '</th>';
// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th> </th>';
}
// Create room for the score to be displayed
echo '<th>'.JText::_('JL_TEAMPLAN_RESULT').'</th>';
// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th> </th>';
}
// Show guest team marker
echo '<th>';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
echo '</th>';
break;
default :
case 0 :
// Show home team marker
echo '<th>';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
echo '</th>';
// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th> </th>';
}
echo '<th> </th>';
// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th> </th>';
}
echo '<th>';
// Show guest team marker
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
echo '</th>';
echo '<th>'.JText::_('JL_TEAMPLAN_RESULT').'</th>';
break;
}
?>
<?php
if ($this->config['show_referee'])
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_REFEREE'); ?></th>
<?php
}
?>
<?php
if (($this->config['show_thumbs_picture']) & ($teamid>0))
{
?>
<th> </th>
<?php
}
?>
<?php
if ($this->config['show_matchreport_column'])
{
?>
<th><?php echo JText::_('JL_MATCHREPORT_PAGE_TITLE'); ?></th>
<?php
}
?>
</tr>
</thead>
<?php
$k = 0;
$counter = 1;
$round_date = '';
foreach($this->matches as $match)
{
$hometeam=$this->teams[$match->projectteam1_id];
$home_projectteam_id=$hometeam->projectteamid;
$guestteam=$this->teams[$match->projectteam2_id];
$guest_projectteam_id=$guestteam->projectteamid;
$class=($k==0)? 'sectiontableentry1' : 'sectiontableentry2';
if ($match->team1==$this->favteams)
{
$highlight="highlight";
}
else
{
$highlight=$class;
}
if (!empty($this->ptid))
{
$home=$hometeam->name;
if ($match->team1==$this->ptid)
{
$home=sprintf('%s',$hometeam->name);
}
}
else
{
$home=$hometeam->name;
if ($match->team2)
{
$home=sprintf('%s',$hometeam->name);
}
}
if (!empty($this->ptid))
{
$away=$guestteam->name;
if ($match->team2==$this->ptid)
{
$away=sprintf('%s',$guestteam->name);
}
}
else
{
$away=$guestteam->name;
if ($match->team2)
{
$away=sprintf('%s',$guestteam->name);
}
}
$homeclub=$hometeam->club_id;
$awayclub=$guestteam->club_id;
?>
<tr class="<?php echo $highlight; ?>" style="border:1px solid #DCDCDC;">
<?php
// start events
if ($this->config['show_events'])
{
?>
<td width='5' class='ko'><?php
$are_there_events=$this->model->getMatchEvents($match->id);
$link="javascript:void(0);";
$img=JHTML::image( 'media/com_joomleague/jl_images/events.png',
'events.png');
$params=array();
$params["onclick"]='switchMenu(\'info'.$match->id.'\');return false;';
$params["title"]=JText::_('JL_TEAMPLAN_EVENTS');
if (count($are_there_events) > 0)
{
echo JHTML::link($link,$img,$params);
}
?></td>
<?php }
// end events
?>
<td width='5%'><?php
echo JText::_($match->roundcode);
?></td>
<?php
if ($this->config['show_match_number'])
{
?>
<td>
<?php if (empty($match->match_number)){$match->match_number='-';} echo $match->match_number; ?>
</td>
<?php
}
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
<td>
<?php echo JoomleagueHelperHtml::showDivisonRemark($hometeam,$guestteam,$this->config); ?>
</td>
<?php
}
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
<td>
<?php JoomleagueHelperHtml::showMatchPlayground($match); ?>
</td>
<?php
}
/*
echo JoomleagueModelTeamPlan::showPlayground( $hometeam,
$guestteam,
$match,
$this->config['show_playground_alert'],
$this->config['show_playground'],
$match->project_id);
*/
?>
<td width="10%"><?php
if (!strstr($match->match_date,"0000-00-00"))
{
echo JHTML::date($match->match_date,JText::_('JL_GLOBAL_CALENDAR_DATE'));
}
else
{
echo " ";
}
?></td>
<?php
if ($this->config['show_time'])
{
?>
<td width="10%"><?php echo JoomleagueHelperHtml::showMatchTime( $match,
$this->config,
$this->overallconfig,
$this->project); ?></td>
<?php
}
?>
<?php
if ($this->config['show_time_present'])
{
?>
<td width='10%'><?php if (empty($match->time_present)){$match->time_present='-';} echo $match->time_present; ?></td>
<?php
}
?>
<?php
// Define some variables which will be used
$class1 = "right";
$teamA = '';
$class2 = "left";
$class3 = "small2";
$teamB = '';
$score = "";
// Check if the home and guest team should be switched arround
if ($this->config['switch_home_guest']){$class1='left'; $class2='right';}
$isFavTeam = in_array($hometeam->id,$this->favteams);
$teamA .= '<td class="'.$class1.'">';
if($this->config['show_teamplan_link']) {
$link=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$hometeam->team_slug);
$teamA .= JHTML::link($link,$home);
} else {
$teamA .= JoomleagueHelper::formatTeamName($hometeam,"g".$match->id."t".$hometeam->id,$this->config,$isFavTeam,0,$this->project->id);
//$teamA .= $hometeam->name;
$teamA .= '</br><span class="'.$class3.'">';
$showRow = $hometeam;
$team_link = JoomleagueHelperRoute::getTeamPlanRoute($this->project->id, $showRow->id, 0, 0);
$teamA .= JHTML::link($team_link, $hometeam->username);
}
$teamA .= '</span></td>';
// Check if the user wants to show the club logo or country flag
switch ($this->config['show_logo_small'])
{
case 1 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= ' '.JoomleagueModelProject::getClubIconHtml($hometeam,1);
$teamA .= '</td>';
$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueModelProject::getClubIconHtml($guestteam,1).' ';
$teamB .= '</td>';
}
break;
case 2 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= Countries::getCountryFlag($hometeam->country);
$teamA .= '</td>';
$teamB .= '<td class="'.$class2.'">';
$teamB .= Countries::getCountryFlag($guestteam->country);
$teamB .= '</td>';
}
break;
case 3:
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= JoomleagueHelper::getPictureThumb($hometeam->picture,
$hometeam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);
$teamA .= '</td>';
$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueHelper::getPictureThumb($guestteam->picture,
$guestteam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);
$teamB .= '</td>';
}
break;
}
$seperator ='<td width="10">'.$this->config['seperator'].'</td>';
$isFavTeam = in_array($guestteam->id, $this->favteams);
$teamB .= '<td class="'.$class2.'">';
if($this->config['show_teamplan_link']) {
$link=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$guestteam->team_slug);
$teamB .= JHTML::link($link,$away);
} else {
$teamB .= JoomleagueHelper::formatTeamName($guestteam,"g".$match->id."t".$guestteam->id,$this->config, $isFavTeam,0,$this->project->id);
//$teamB .= $guestteam->name;
$teamB .= '</br><span class="'.$class3.'">';
$showRow = $guestteam;
$team_link = JoomleagueHelperRoute::getTeamPlanRoute($this->project->id, $showRow->id, 0, 0);
$teamB .= JHTML::link($team_link, $guestteam->username);
};
$teamB .= '</span></td>';
if (!$match->cancel)
{
if ($match->alt_decision)
{
$team1_result = (isset($match->team1_result_decision))? $match->team1_result_decision : 'X';
$team2_result = (isset($match->team2_result_decision))? $match->team2_result_decision : 'X';
}
else
{
if ($this->config['show_part_results'] && ($match->team1_result_split != ";") && ($match->team2_result_split != ";"))
{
$team1_result = explode(";", $match->team1_result_split);
$team2_result = explode(";", $match->team2_result_split);
}
else
{
$team1_result = $match->team1_result;
$team2_result = $match->team2_result;
}
}
if ($this->config['switch_home_guest'])
{
$part_results_left = $team2_result;
$part_results_right = $team1_result;
}
else
{
$part_results_left = $team1_result;
$part_results_right = $team2_result;
}
if (!is_array($part_results_left)) { $part_results_left = array($part_results_left); }
if (!is_array($part_results_right)) { $part_results_right = array($part_results_right); }
$config_seperator = $this->config['seperator'];
$score = "<td><table align='center'><tbody>";
for ($i = 0; $i < count($part_results_left); $i++)
{
if ($this->config['results_linkable'])
{
if (isset($part_results_left[$i]))
{
$link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
$part_results_left[$i] = JHTML::link($link,$part_results_left[$i]);
$part_results_right[$i] = JHTML::link($link,$part_results_right[$i]);
}
else
{
$link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
}
$result_seperator = JHTML::link($link,$config_seperator);
}
$score .= sprintf('<tr><td>%snumb</td><td width="5px">%svs</td><td>%snumb</td></tr>',
$part_results_left[$i], $result_seperator, $part_results_right[$i]);
}
$score .= "</tbody></table></td>";
}
else
{
$score='<td>'.JText::_($match->cancel_reason).'</td>';
}
switch ($this->config['result_style'])
{
case 1 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$score.$teamA;
}
else
{
echo $teamA.$score.$teamB;
}
}
break;
default;
case 0 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$seperator.$teamA.$score;
}
else
{
echo $teamA.$seperator.$teamB.$score;
}
}
break;
}
?>
<?php
if ($this->config['show_referee'])
{
?>
<td><?php
if ((isset($match->referees)) && (count($match->referees)>0))
{
if ($this->project->teams_as_referees)
{
$output='';
$toolTipTitle=JText::_('Match Referees');
$toolTipText='';
for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_name != '')
{
$output .= $match->referees[$i]->referee_name;
$toolTipText .= $match->referees[$i]->referee_name.'<br />';
}
else
{
$output .= '-';
$toolTipText .= '-<br />';
}
}
if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?> <span class='hasTip'
title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img
src='<?php echo JURI::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png'
alt='' title='' /> </span> <?php
}
}
else
{
$output='';
$toolTipTitle=JText::_('Match Referees');
$toolTipText='';
for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_lastname != '' && $match->referees[$i]->referee_firstname)
{
$output .= '<span class="hasTip" title="'.JText::_('Referee function').'::'.$match->referees[$i]->referee_position_name.'">';
$ref=$match->referees[$i]->referee_lastname. ','.$match->referees[$i]->referee_firstname;
$toolTipText .= $ref.' ('.$match->referees[$i]->referee_position_name.')'.'<br />';
if ($this->config['show_referee_link'])
{
$link=JoomleagueHelperRoute::getRefereeRoute($this->project->slug,$match->referees[$i]->referee_id,3);
$ref=JHTML::link($link,$ref);
}
$output .= $ref;
$output .= '</span>';
if (($i + 1) < count($match->referees))
{
$output .= ' - ';
}
}
else
{
$output .= '-';
}
}
if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?> <span class='hasTip'
title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img
src='<?php echo JURI::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png'
alt='' title='' /> </span> <?php
}
}
}
else
{
echo '-';
}
?></td>
<?php
}
?>
<?php
if (($this->config['show_thumbs_picture']) & ($teamid>0))
{
if ($teamid==$hometeam->id)
{
$team1=$match->team1_result;
$team2=$match->team2_result;
}
else
{
$team2=$match->team1_result;
$team1=$match->team2_result;
}
if (isset($team1) && isset($team2) && ($team1==$team2))
{
?>
<td><?php echo JHTML::image( 'media/com_joomleague/jl_images/draw.png',
'draw.png',
array('title' => JText::_('JL_GLOBAL_DRAW'))); ?></td>
<?php
}
else
{
if ($team1 > $team2)
{
?>
<td><?php echo JHTML::image( 'media/com_joomleague/jl_images/thumbs_up.png',
'thumbs_up.png',
array('title' => JText::_('JL_GLOBAL_WON'))); ?></td>
<?php
}
elseif ($team2 > $team1)
{
?>
<td><?php echo JHTML::image( 'media/com_joomleague/jl_images/thumbs_down.png',
'thumbs_down.png',
array('title' => JText::_('JL_GLOBAL_LOST'))); ?></td>
<?php
}
else
{
?>
<td>
<?php
$date1=JHTML::date($match->match_date,$format = '%d-%m');
$date2=JHTML::date($date = null,$format = '%d-%m');
$arr1 = explode(" ", $date1);
$arr2 = explode(" ", $date2);
$arrdate1 = explode("-", $arr1[0]);
$arrdate2 = explode("-", $arr2[0]);
$timestamp1 = (mktime(0, $arrdate1[1], $arrdate1[0], $arrdate1[2]));
$timestamp2 = (mktime(0, $arrdate2[1], $arrdate2[0], $arrdate2[2]));
if ($timestamp1 <= $timestamp2)
{
if ($timestamp1+2 >= $timestamp2)
{
$link = JoomleagueHelperRoute::getResultsRoute
($this->project->slug,$match->roundid, $this->model->divisionid, $this->model->mode, $this->model->order, 'form');
$imgTitle = JText::_( 'JL_RESULTS_ENTER_EDIT_RESULTS' );
$desc = JHTML::image( 'media/com_joomleague/jl_images/edit.png', $imgTitle, array( ' title' => $imgTitle ) );
echo ' ';
echo JHTML::link( $link, $desc );
}
else
{
JText::_(' ');
}
}
?>
</td>
<?php
}
}
}
if ($this->config['show_matchreport_column'])
{
?>
<td><?php
if (isset($match->team1_result))
{
if ($this->config['show_matchreport_image']) {
$href_text = JHTML::image($this->config['matchreport_image'], JText::_('JL_TEAMPLAN_VIEW_MATCHREPORT'));
} else {
$href_text = JText::_('JL_TEAMPLAN_VIEW_MATCHREPORT');
}
$link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
$viewReport=JHTML::link($link, $href_text);
echo $viewReport;
}
else
{
if ($this->config['show_matchreport_image']) {
$href_text = JHTML::image($this->config['matchpreview_image'], JText::_('JL_TEAMPLAN_VIEW_MATCHPREVIEW'));
} else {
$href_text = JText::_('JL_TEAMPLAN_VIEW_MATCHPREVIEW');
}
$link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
$viewPreview=JHTML::link($link, $href_text);
echo $viewPreview;
}
?></td>
<?php
}
?>
<td width="20px"></td>
</tr>
<?php
if (($this->config['show_events'] > 0) && (count($are_there_events) > 0))
{
?>
<tr>
<td colspan="6">
<div id="info<?php echo $match->id; ?>" style="display:<?php echo (count($are_there_events) > 0)? 'none' : 'block'; ?>">
<?php
$this->showEvents($match,$are_there_events);
?>
</div>
</td>
</tr>
<?php
}
$k=1 - $k;
$counter++;
}
?>
</table>
<?php
}
else
{
?>
<h3><?php echo JText::_('JL_TEAMPLAN_NO_MATCHES'); ?></h3>
<?php
}
?>