<?php
@ ob_start();
@ require ('writable/set/set.php');
header("content-type: text/html; charset=gb2312");

?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=gb2312" />
<title>天气</title>
<link href="writable/css/<?php echo $web['cssfile']; ?>/style.css" rel="stylesheet" type="text/css" id="my_style">
<style type="text/css">
<!--

html { min-width:860px; padding-top:0; background:none; }
body { min-width:860px; width:860px; padding:0; border-top:none; margin-top:0; }
.body { width:auto; }
#tq { margin-bottom:10px; background-color:#EEEEEE; color:#999999; padding:0 10px; text-align:left; font-weight:bold; }
#tq a { }
#search { color:#999999; }



.tab_ctn li{ margin:0; padding:0; list-style:none; }

h1,h2,h3,h4,h5,h6,p {margin:0;padding:0;}

.tab_ctn { width:672px; overflow:hidden; }
.tab_ctn h3{ margin:0 12px; font:24px/30px 'Microsoft YaHei',"宋体",sans-serif; color:#094c9f; }
.tab_ctn h3 span { font:14px/30px '宋体'; color:#333; }

.tab_hd .temp_opt { display:inline; float:right; margin:-25px 10px 0; }
.clearfix:after { content:'\20'; display:block; height:0; clear:both; }
.clearfix { zoom:1; }


.tab_hd .temp_opt{ display:inline; float:right; margin:-25px 10px 0; }
.temp_opt span{ cursor:pointer; text-decoration:underline; }
.temp_opt .temp_on { cursor:default; text-decoration:none; }

.mod_today{ height:278px; background-color:#C4E5EA;          margin-bottom: 10px;overflow: hidden; clear:both;}
.mod_today .m_left{ float:left; width:496px; height:268px; overflow:hidden; padding:5px;
background: url(http://php.weather.sina.com.cn/images/weather_yc_01.jpg) 0 0 no-repeat;color: #fff;font:14px/28px 'Microsoft YaHei';}/*2012/9/1*/
.mod_today h5{margin: 10px 10px 0;font-size: 20px;font-family:'Microsoft YaHei', "宋体", sans-serif; }/*2012/9/1*/

.mod_today .detail{position: relative; margin-top: -55px;font-size: 18px;text-align: center;}/*2012/9/9*/
.mod_today .detail .fs_30{margin-right: 10px;}
.icon_weather{width: 180px;height: 180px;margin: auto;text-align: center;}

.mod_today .day,.mod_today .night{float: left;width: 248px;}

.fs_30{font-size: 30px;}
.fs_24{font-size: 24px;}
.fs_14{font-size: 14px;}


.mod_today .m_right{float: right;width: 166px; height:278px; overflow:auto; font-size:12px; line-height:150%;}
.mod_today .m_right td {font-size:12px; line-height:150%; padding:0;}
.mod_today .m_right h4{ font-size:12px; text-align:center; border:1px outset; margin:4px; color: #094c9f}
.mod_today .m_right .tb_sun { font-size:12px; }

.mod_today .m_right p{ }
.mod_today h4 span{}

.weather_list{}
.mod_02{float: left;width: 158px;height: 243px;padding: 5px;margin-top: 3px;background: url(http://php.weather.sina.com.cn/images/weather_yc_01.jpg) -510px 0 no-repeat;color: #fff;}
.mod_02 .mod_03{float: left;width: 78px;text-align: center;font-family: 'Microsoft YaHei';}/*2012/9/1*/
.icon_mid_weather{width: 78px;height: 78px;margin: auto;}
.mod_03 h5{margin-bottom: 5px;font-size: 14px;}
.mod_03 ul{margin-top: -20px;}
.mod_03 ul{margin-top: -20px;}
.mod_02 h4{margin: 20px 0 15px;font:16px 'Microsoft YaHei', "宋体", sans-serif;text-align: center;}

-->
</style>
<script type="text/javascript" language="javaScript" src="readonly/js/main.js"></script>
</head>
<body>
<div id="tq">天气 [<a href="?area=china">更换城市</a>]</div>
<?php
$text = '';
if (empty($_GET['area'])) {
  $_GET['type'] = 2;
  echo  '<div class="body">';
  @ require ('readonly/weather/getweather.php');
  echo  '</div>';
} else {
  @ require ('readonly/weather/getweather_seek.php');
  if (empty($_GET['area']) || $_GET['area'] != 'international') {
    $text .= '<div id="search">国内城市 | <a href="?area=international">国外城市</a></div>';
    if (empty($_GET['province']) || !array_key_exists($_GET['province'], $seek['china'])) {
      $text_capital = $text_province = '';
      foreach ($seek['china'] as $k => $v) {
        $text_capital .= '<a href="?city='.urlencode($v[0]).'">'.$v[0].'</a>';
        $text_province .= '<a href="?area=china&province='.urlencode($k).'">'.$k.'</a>';
      }
      $text .= '<div class="column"><div class="column_title">省会城市</div><div class="class">'.$text_capital.'</div></div><div class="column"><div class="column_title">各省查找</div><div class="class">'.$text_province.'</div></div>';
    } else {
      $text_city = '';
      foreach ($seek['china'][$_GET['province']] as $k => $v) {
        $text_city .= '<a href="?city='.urlencode($v).'">'.$v.'</a>';
      }
      $text .= '<div class="column"><div class="column_title"><a href="?area=china">省区分类</a> &gt; '.$_GET['province'].'</div><div class="class">'.$text_city.'</div></div>';
    }
  } else {
    $text .= '<div id="search"><a href="?area=china">国内城市</a> | 国外城市</div>';

    if (empty($_GET['continent']) || !array_key_exists($_GET['continent'], $seek['international'])) {
      $text_continent = '';
      foreach ($seek['international'] as $k => $v) {
        $text_continent .= '<a href="?area=international&continent='.urlencode($k).'">'.$k.'</a>';
      }
      $text .= '<div class="column"><div class="column_title">洲际</div><div class="class">'.$text_continent.'</div></div>';
    } else {
      if (empty($_GET['country']) || !array_key_exists($_GET['country'], $seek['international'][$_GET['continent']])) {
        $text_country = '';
        foreach ($seek['international'][$_GET['continent']] as $k => $v) {
          $text_country .= '<a href="?area=international&continent='.urlencode($_GET['continent']).'&country='.urlencode($k).'">'.$k.'</a>';
        }
        $text .= '<div class="column"><div class="column_title"><a href="?area=international">洲际</a> &gt; '.$_GET['continent'].'国家</div><div class="class">'.$text_country.'</div></div>';

      } else {
        $text_city = '';
        foreach ($seek['international'][$_GET['continent']][$_GET['country']] as $k => $v) {
          $text_city .= '<a href="?city='.urlencode($v).'">'.$v.'</a>';
        }
        $text .= '<div class="column"><div class="column_title"><a href="?area=international">洲际</a> &gt; <a href="?area=international&continent='.urlencode($_GET['continent']).'">'.$_GET['continent'].'国家</a> &gt; '.$_GET['country'].'</div><div class="class">'.$text_city.'</div></div>';

      }
    }

  }
  echo $text;
}
?>
</body>
</html>
<?php
@ ob_end_flush();
?>