Your IP : 216.73.216.53


Current Path : /home/ahrcaeuege/www/modules/mod_jayahoo_weather/tmpl/
Upload File :
Current File : /home/ahrcaeuege/www/modules/mod_jayahoo_weather/tmpl/tabs.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">
  <div role="tabpanel">

    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
      <?php foreach($list as $index => $item): ?>
              <?php $info = $item;
              if(!isset($info->current_observation->condition)) continue;
              ?>
        <li role="presentation" title="<?php echo addslashes($info->location->city); ?>" class="<?php if($index == 0) echo 'active'; ?>">
          <a href="#<?php echo 'tab-'.$module->id.'-'.$index; ?>" aria-controls="<?php echo 'tab-'.$module->id.'-'.$index; ?>" role="tab" data-toggle="tab">
            <?php echo $info->location->city; ?>
          </a>
        </li>
      <?php endforeach; ?>
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
      <?php foreach($list as $index => $item): ?>
        <?php $info = $item; ?>
        <div role="tabpanel" class="tab-pane panel-default <?php if($index == 0) echo 'active'; ?>" id="<?php echo 'tab-'.$module->id.'-'.$index; ?>">
          <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; ?>
                    &nbsp; | &nbsp;
                    <?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>
                    &nbsp;&nbsp;&nbsp;
                    <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>
                    &nbsp;&nbsp;&nbsp;
                    <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, $forecast->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>
      <?php endforeach; ?>
    </div>

  </div>
</div>