| Current Path : /home/ahrcaeuege/www/modules/mod_jayahoo_weather/tmpl/ |
| Current File : /home/ahrcaeuege/www/modules/mod_jayahoo_weather/tmpl/accodion.php |
<?php
/**
* ------------------------------------------------------------------------
* JA Yahoo Weather
* ------------------------------------------------------------------------
* Copyright (C) 2004-2018 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
* Author: J.O.O.M Solutions Co., Ltd
* Websites: http://www.joomlart.com - http://www.joomlancers.com
* ------------------------------------------------------------------------
*/
defined('_JEXEC') or die;
?>
<div id="ja-weather-<?php echo $module->id; ?>" class="ja-weather">
<!-- Tab panes -->
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<?php foreach($list as $index => $item): ?>
<?php $info = $item;
if(!isset($info->current_observation->condition)) continue;
?>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne<?php echo '-'.$module->id.'-'.$index; ?>">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#<?php echo 'tab-'.$module->id.'-'.$index; ?>" aria-expanded="<?php if($index == 0) echo 'true'; else echo 'false'; ?>" aria-controls="<?php echo 'tab-'.$module->id.'-'.$index; ?>">
<?php echo $info->location->city; ?>
</a>
<span>
<?php echo ModJaYahooWeatherHelper::getIcon($info->current_observation->condition->code,$info->current_observation->condition->text); ?>
<?php echo ModJaYahooWeatherHelper::formatTemperature($info->current_observation->condition->temperature, $temperature_unit, $temperature_unit); ?>
</span>
</h4>
</div>
<div id="<?php echo 'tab-'.$module->id.'-'.$index; ?>" class="panel-collapse collapse <?php if($index == 0) echo 'in'; ?>" role="tabpanel" aria-labelledby="headingOne<?php echo '-'.$module->id.'-'.$index; ?>" aria-expanded="<?php if($index == 0) echo 'true'; else echo 'false'; ?>">
<div class="panel-body">
<header class="weather-header">
<span class="icon icon-large condition">
<?php echo ModJaYahooWeatherHelper::getIcon($info->current_observation->condition->code, $info->current_observation->condition->text); ?>
</span>
<div>
<span class="text city">
<?php echo $info->location->city; ?>
<small><?php echo $info->location->country; ?></small>
</span>
<span class="text weather-info">
<?php echo ModJaYahooWeatherHelper::getText('MOD_JAYAHOO_WEATHER_CONDITION_CODE_'.$info->current_observation->condition->code, $info->current_observation->condition->text); ?>,
<?php echo ModJaYahooWeatherHelper::formatTemperature($info->current_observation->condition->temperature, $temperature_unit, $temperature_unit); ?>
</span>
</div>
</header>
<?php if ($params->get('ja_show_addition', 1)): ?>
<section class="weather-detail">
<table class="table">
<thead>
<tr>
<th colspan="3"><?php echo JText::_('MOD_JAYAHOO_WEATHER_CURRENT_CONDITIONS'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3">
<?php
$info->current_observation->astronomy->sunrise = preg_replace('/^([0-9\:]+).*/', '$1', $info->current_observation->astronomy->sunrise). ' '.JText::_('MOD_JAYAHOO_WEATHER_TIME_AM');
$info->current_observation->astronomy->sunset = preg_replace('/^([0-9\:]+).*/', '$1', $info->current_observation->astronomy->sunset). ' '.JText::_('MOD_JAYAHOO_WEATHER_TIME_PM');
?>
<?php echo JText::_('MOD_JAYAHOO_WEATHER_SUNRISE'); ?> <?php echo $info->current_observation->astronomy->sunrise; ?>
|
<?php echo JText::_('MOD_JAYAHOO_WEATHER_SUNSET'); ?> <?php echo $info->current_observation->astronomy->sunset; ?>
</td>
</tr>
<tr>
<td>
<span title="<?php echo JText::_('MOD_JAYAHOO_WEATHER_HUMIDITY'); ?>"><i class="wi wi-thermometer"></i> <?php echo $info->current_observation->atmosphere->humidity . '%'; ?></span>
<span title="<?php echo JText::_('MOD_JAYAHOO_WEATHER_WIND'); ?>">
<?php echo ModJaYahooWeatherHelper::getWindDirectionIcon($info->current_observation->wind->direction); ?>
<?php echo ModJaYahooWeatherHelper::formatSpeed($info->current_observation->wind->speed, $wind_unit, $wind_unit); ?>
</span>
<span title="<?php echo JText::_('MOD_JAYAHOO_WEATHER_PRESSURE'); ?>"><i class="wi wi-sprinkles"></i> <?php echo ModJaYahooWeatherHelper::formatPressure((float)$info->current_observation->atmosphere->pressure, $pressure_unit, $pressure_unit); ?></span>
</td>
</tr>
</tbody>
</table>
</section>
<?php endif; ?>
<?php if ($params->get('ja_show_forecast', 1)): ?>
<section class="weather-forecast">
<table class="table">
<thead>
<tr>
<th colspan="4"><?php echo JText::_('MOD_JAYAHOO_WEATHER_FORECAST'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach($info->forecasts as $forecast):
$date = new JDate($forecast->date);
// $forecast->day = $date->format('D');
$forecast->date = $date->format(JText::_('DATE_FORMAT_LC'));
?>
<tr>
<td><span class="text date" title="<?php echo $forecast->date; ?>"><?php echo JText::_(strtoupper($forecast->day)); ?></span></td>
<td><?php echo ModJaYahooWeatherHelper::getIcon($forecast->code,$info->current_observation->condition->text); ?></td>
<td><span class="text temp-low"><?php echo JText::sprintf('MOD_JAYAHOO_WEATHER_LOW_VAR', ModJaYahooWeatherHelper::formatTemperature($forecast->low, $temperature_unit, $temperature_unit)); ?></span></td>
<td><span class="text temp-high"><?php echo JText::sprintf('MOD_JAYAHOO_WEATHER_HIGH_VAR', ModJaYahooWeatherHelper::formatTemperature($forecast->high, $temperature_unit, $temperature_unit)); ?></span></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</section>
<?php endif; ?>
<?php //echo @$info->current_observation->description; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>