<div class="middle_module_container weather_advanced_container">
    <div class="wa-box">
        <div class="wa-header">
            <?php
            if($module_show_title == 1) {
                ?>
                <h2><?php echo tx("Weather Forecast %s", array ( tx($adv_city_name)));?></h2>
                <?php
            }
            ?>
        </div>
        <?php


    if(isset($weather_fiveday[$adv_city_id])) {
        $tmp = array();
        $tmp = $weather_fiveday[$city['ws_city_id']];
        asort($tmp);
        $weather_fiveday[$city['ws_city_id']] = $tmp;

        //echo '<pre>', print_r($weather_fiveday), '</pre>';

        // Put the names of days of the week
        ?>

        <div class="wa-body no-padding">
        <?php
        $cnt = 0;
        foreach ($weather_fiveday[$city['ws_city_id']] as $id=>$fd) {
            $day_timestamp = ($cnt == 0) ? time() : strtotime("+$cnt day", time());
            ?>
                <div class="wa-loc">
                    <div class="row wa-row">
                        <div class="col-sm-4 no-padding">
                            <div class="wa-l1">
                                <?php echo '<span> <i class="fa fa-calendar"></i> ' . tx(date("l", $day_timestamp)) . ' &nbsp; <span class="smalldate">' . date("d", $day_timestamp) . ' ' . tx(date("M", $day_timestamp)) . ', ' . date("Y", $day_timestamp) . '</span></span>';?>
                            </div>
                        </div>

                        <div class="col-sm-6 no-padding">
                            <div class="wa-l2"><?php echo tx($fd['phrase']);?></div>
                        </div>
                    </div>
                    <div class="row wa-row">
                        <div class="col-sm-2 col-xs-5 no-padding">
                            <div class="wa-c1">
                                <div class="wa-t-range">
                                    <b class="wa-t-high">
                                        <span class="sr-only"><?php echo tx("High"); ?>:</span>
                                        <?php echo convert_temp($fd['high'], $c_to_f) . '&deg;' . show_scale($fd['high_unit'], $c_to_f); ?>
                                    </b>
                                    <b class="wa-t-low">
                                        <span class="sr-only"><?php echo tx("Low"); ?>:</span>
                                        <?php echo convert_temp($fd['low'], $c_to_f) . '&deg;' . show_scale($fd['low_unit'], $c_to_f); ?>
                                    </b>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-2 col-xs-5 no-padding">
                            <div class="wa-c2">
                                <img
                                    src="<?php echo $path; ?>images/weather_icons/<?php echo $fd['icon']; ?>.png"
                                    border="0" alt="<?php echo tx($fd['phrase']); ?>"
                                    title="<?php echo tx($fd['phrase']); ?>"/>
                            </div>
                        </div>
                        <div class="col-sm-6 col-xs-10 wa-current-specs no-padding">
                            <div class="wa-c3">
                                <div class="row">
                                    <div class="col-sm-5 no-padding">
                                        <div class="col-xs-10">
                                            <span class="para_name pull-left"><?php echo tx("Real feel");?>:</span>
                                            <span class="para_value pull-right"><?php echo $fd['rfhigh'] . " " . $fd['low_unit'];?></span>
                                        </div>
                                    </div>
                                    <div class="col-sm-5 no-padding">
                                        <div class="col-xs-10">
                                            <span class="para_name pull-left"><?php echo tx("Wind speed");?>:</span>
                                            <span class="para_value pull-right"><?php echo $fd['windspeed'] . " m/s";?></span>
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-sm-5 no-padding">
                                        <div class="col-xs-10">
                                            <span class="para_name pull-left"><?php echo tx("Precipitation");?>:</span>
                                            <span class="para_value pull-right"><?php echo $fd['precip'] . " cm";?></span>
                                        </div>
                                    </div>
                                    <div class="col-sm-5 no-padding">
                                        <div class="col-xs-10">
                                            <span class="para_name pull-left"><?php echo tx("Wind direction");?>:</span>
                                            <span class="para_value pull-right"><?php echo $fd['wind_dir'] ;?></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-5 no-padding">
                                        <div class="col-xs-10">
                                            <span class="para_name pull-left"><?php echo tx("UV Index");?>:</span>
                                            <span class="para_value pull-right"><?php echo $fd['uv_indx'];?></span>
                                        </div>
                                    </div>
                                    <div class="col-sm-5 no-padding">
                                        <div class="col-xs-10">
                                            <span class="para_name pull-left"><?php echo tx("Gust");?>:</span>
                                            <span class="para_value pull-right"><?php echo $fd['gust'];?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>



            <?php
            $cnt++;
        }
        ?>
            </div>
            <?php
    }
    ?>
    </div>
</div>