本文整理汇总了PHP中JoomleagueHelper::getAge方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomleagueHelper::getAge方法的具体用法?PHP JoomleagueHelper::getAge怎么用?PHP JoomleagueHelper::getAge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomleagueHelper
的用法示例。
在下文中一共展示了JoomleagueHelper::getAge方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
?>
<td width="10%" nowrap="nowrap" style="text-align: left;"><?php
if ($row->birthday != "0000-00-00") {
switch ($this->config['show_birthday_staff']) {
case 1:
// show Birthday and Age
$birthdateStr = JHTML::date($row->birthday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'));
$birthdateStr .= " (" . JoomleagueHelper::getAge($row->birthday, $row->deathday) . ")";
break;
case 2:
// show Only Birthday
$birthdateStr = JHTML::date($row->birthday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'));
break;
case 3:
// show Only Age
$birthdateStr = "(" . JoomleagueHelper::getAge($row->birthday, $row->deathday) . ")";
break;
case 4:
// show Only Year of birth
$birthdateStr = JHTML::date($row->birthday, 'Y');
break;
default:
$birthdateStr = "";
break;
}
} else {
$birthdateStr = "-";
}
// deathday
if ($row->deathday != "0000-00-00") {
$birthdateStr .= ' [ † ' . JHTML::date($row->deathday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE')) . ']';
示例2: switch
</span></td>
<td class="data"><?php
#$this->playerage', $model->getAge( $this->player->birthday, $this->project->start_date );
switch ($this->config['show_birthday']) {
case 1:
// show Birthday and Age
$birthdateStr = $this->person->birthday != "0000-00-00" ? JHtml::date($this->person->birthday . ' UTC', JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'), JoomleagueHelper::getTimezone($this->project, $this->overallconfig)) : "-";
$birthdateStr .= " (" . JoomleagueHelper::getAge($this->person->birthday, $this->person->deathday) . ")";
break;
case 2:
// show Only Birthday
$birthdateStr = $this->person->birthday != "0000-00-00" ? JHtml::date($this->person->birthday . ' UTC', JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'), JoomleagueHelper::getTimezone($this->project, $this->overallconfig)) : "-";
break;
case 3:
// show Only Age
$birthdateStr = JoomleagueHelper::getAge($this->person->birthday, $this->person->deathday);
break;
case 4:
// show Only Year of birth
$birthdateStr = $this->person->birthday != "0000-00-00" ? JHtml::date($this->person->birthday . ' UTC', JText::_('%Y'), JoomleagueHelper::getTimezone($this->project, $this->overallconfig)) : "-";
break;
default:
$birthdateStr = "";
break;
}
echo $birthdateStr;
?>
</td>
</tr>
<?php
}
示例3:
default:
$showbirthday = 0;
$showage = 0;
break;
}
if ($showage == 1) {
?>
<div>
<span class="jl_roster_persondetails_label">
<?php
echo JText::_("COM_JOOMLEAGUE_PERSON_AGE");
?>
</span>
<span class="jl_roster_persondetails_data">
<?php
echo JoomleagueHelper::getAge($this->row->birthday, $this->row->deathday);
?>
</span>
</div>
<?php
}
if ($showbirthday == 1) {
?>
<div>
<span class="jl_roster_persondetails_label">
<?php
echo JText::_("COM_JOOMLEAGUE_PERSON_BIRTHDAY");
?>
</span>
<span class="jl_roster_persondetails_data">
<?php
示例4: switch
<td class="data">
<?php
#$this->playerage = $model->getAge( $this->player->birthday, $this->project->start_date );
switch ($this->config['show_birthday']) {
case 1:
// show Birthday and Age
$birthdateStr = $this->referee->birthday != "0000-00-00" ? JHtml::date($this->referee->birthday . ' UTC', JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'), JoomleagueHelper::getTimezone($this->project, $this->overallconfig)) : "-";
$birthdateStr .= " (" . JoomleagueHelper::getAge($this->referee->birthday, $this->referee->deathday) . ")";
break;
case 2:
// show Only Birthday
$birthdateStr = $this->referee->birthday != "0000-00-00" ? JHtml::date($this->referee->birthday . ' UTC', JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'), JoomleagueHelper::getTimezone($this->project, $this->overallconfig)) : "-";
break;
case 3:
// show Only Age
$birthdateStr = JoomleagueHelper::getAge($this->referee->birthday, $this->referee->deathday);
break;
case 4:
// show Only Year of birth
$birthdateStr = $this->referee->birthday != "0000-00-00" ? JHtml::date($this->referee->birthday . ' UTC', JText::_('%Y'), JoomleagueHelper::getTimezone($this->project, $this->overallconfig)) : "-";
break;
default:
$birthdateStr = "";
break;
}
echo $birthdateStr;
?>
</td>
</tr>
<?php
}
示例5: getPlayerMeanAge
/**
* Get total number of players assigned to a team
* @param int projectid
* @param int projectteamid
* @return int
*/
function getPlayerMeanAge($projectid, $projectteamid)
{
//$player = array();
$meanage = 0;
$countplayer = 0;
$age = 0;
$query = " SELECT ps.*" . " FROM #__joomleague_person AS ps " . " INNER JOIN #__joomleague_team_player AS tp ON tp.person_id = ps.id " . " INNER JOIN #__joomleague_project_team AS pt ON tp.projectteam_id = pt.id " . " WHERE pt.project_id=" . $projectid . " AND pt.id=" . $projectteamid . " AND tp.published = 1 " . " AND ps.published = 1 ";
$this->_db->setQuery($query);
$players = $this->_db->loadObjectList();
foreach ($players as $player) {
if ($player->birthday != '0000-00-00') {
$age += JoomleagueHelper::getAge($player->birthday, $player->deathday);
$countplayer++;
}
}
// diddipoeler
// damit kein fehler hochkommt: Warning: Division by zero
if ($age != 0) {
$meanage = round($age / $countplayer, 2);
}
return $meanage;
}
示例6: elseif
case 3:
// show Only Age
$birthdateStr = "(" . JoomleagueHelper::getAge($row->birthday, $row->deathday) . ")";
break;
case 4:
// show Only Year of birth
$birthdateStr = JHTML::date($row->birthday, 'Y');
break;
default:
$birthdateStr = "";
break;
}
// das alter berechnen zur weiterberechnung des durchschnittsalters
// nicht das alter normal berechnen, sonder das alter des spielers in der saison
//$age += JoomleagueHelper::getAge( $row->birthday,$row->deathday );
$age += JoomleagueHelper::getAge($row->birthday, $this->lastseasondate);
$countplayer++;
} else {
$birthdateStr = "-";
}
// deathday
if ($row->deathday != "0000-00-00") {
$birthdateStr .= ' [† ' . JHTML::date($row->deathday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE')) . ']';
}
echo $birthdateStr;
?>
</td><?php
} elseif ($this->config['show_birthday_staff'] > 0) {
?>
<td width="10%" nowrap="nowrap" style="text-align: left;"> </td><?php
}
示例7:
// show Only Birthday
$birthdateStr = JHTML::date($players->birthday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'));
break;
case 3:
// show Only Age
$birthdateStr = "(" . JoomleagueHelper::getAge($players->birthday, $players->deathday) . ")";
break;
case 4:
// show Only Year of birth
$birthdateStr = JHTML::date($players->birthday, 'Y');
break;
default:
$birthdateStr = "";
break;
}
$age += JoomleagueHelper::getAge($players->birthday, $players->deathday);
$countplayer++;
} else {
$birthdateStr = "-";
}
// deathday
if ($players->deathday != "0000-00-00") {
$birthdateStr .= ' [† ' . JHTML::date($players->deathday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE')) . ']';
}
echo $birthdateStr;
?>
</td>
<?php
}
if ($this->config['show_games_played']) {
$played = $players->start + $players->came_in;