<?php
$buk=array('А','Б','В','Г','Д','Е','Ж','З','И','Й','К','Л','М','Н','О','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Э','Ю','Я');
header ("Content-type: text/vnd.wap.wml");
echo '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="Main" title="Погода от wap.vavan.ru"><p><small>';
if(isset($c)){
$c=(int)$c;
if($c<0 || $c>27){
echo 'Извените, запрашиваемая страница не найдена!';
}
$cit=file('./city.txt');
for ($i = 0; $i < count($cit) ; $i++){
if($buk[$c]==substr($cit[$i], 7, 1)){
$bk=$cit[$i];
$bka=@explode('>>', $bk);
$bk=iconv('cp1251', 'utf-8', $bka[1]);
$bk=trim($bk);
$cid=$bka[0];
echo '<a href="./wether.php?c='.$cid.'">'.$bk.'</a><br/>';
}
}
echo '*****<br/><a href="./city.php">Назад</a>';
}else{
for ($i = 0; $i <= 27 ; $i++){
echo '<a href="./city.php?c='.$i.'">'.iconv("cp1251", "utf-8", $buk[$i]).'</a>';
$ch=($i+1)/4;
$ch=(int)$ch;
if($ch==($i+1)/4){echo '<br/>';}else{echo ' ';}
}
echo '*****<br/><a href="./">Назад</a>';
}
echo '<br/>*****<br/><a href="http://site.ru">site.ru</a></small></p></card></wml>';
?>