$xmlfile = $DATA_PATH.$DAY_PART_FILENAME;
$file = fopen($xmlfile,'r');
if(!$file){
?>
Unable to open
for reading
exit();
}
$text = fread($file,filesize($xmlfile));
$p = xml_parser_create();
xml_parse_into_struct($p,$text,$vals);
xml_parser_free($p);
//////////////////////////////////////////////
$xmlfile = $DATA_PATH.$FORECAST_FILENAME;
$file = fopen($xmlfile,'r');
if(!$file){
?>
Unable to open
for reading
exit();
}
$text = fread($file,filesize($xmlfile));
$p = xml_parser_create();
xml_parse_into_struct($p,$text,$locfore);
xml_parser_free($p);
///////////////////////////////////////////////////
$today = getdate();
$wday = $today['wday'];
$weekday = $today['weekday'];
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
?>
Weather Forecast For
//DAY (9 TIMES)
$disp_keys = array('LOCATIONID','PHRASE ','PHRASE NAME');
/*$disp_fields = array('Phrase','Time');
for($i=0; $i
|
}*/
?>
for($i=0; $i0){
$row = mysql_fetch_object($result);
$city=$row->CityName;
$country=$row->CountryName;
echo "$city | ";
$index = 0;
for($k=0; $k<10; $k++){
$index = $k+1;
$disp_keys[1] = str_replace(" ",$index,$disp_keys[1]);
$disp_keys[2] = str_replace(" ",$index,$disp_keys[2]);
if(strstr($attributes[$disp_keys[2]],$weekday)!==FALSE){
$disptime = str_replace($weekday,"",$attributes[$disp_keys[2]]);
if($disptime==""){
$disptime = "Day";
}
$disptime = trim($disptime);
$disptime = ucfirst($disptime);
echo "";
echo $attributes[$disp_keys[1]];
echo " | $disptime | ";
////////////////////////////////////////////////////////////////////////
if(strcasecmp($disptime,"Day")!=0){
echo "";
$disp_keys1 = array('MIXED_NM','PROCESS_TIME','DAY HITMPF','DAY HITMPC','DAY LOTMPF','DAY LOTMPC',
'DAY SUNRISE','DAY SUNSET','DAY MOONRISE','DAY MOONSET','DAY SKY24');
$disp_fields1 = array('Location','Last Updated','Hi (F)','Hi (C)','Low (F)','Low (C)',
'Sunrise','Sunset','Moonrise','Moonset','');
echo "";
for($n=1; $n$disp_fields1[$n]";
}
echo " ";
for($m=0; $m";
for($j=1; $j";
}else{
echo "";
echo $attributes1[$disp_keys1[$j]];
echo " | ";
}
$disp_keys1[$j] = preg_replace("/$day/"," ",$disp_keys1[$j],1);
}
break;
}
echo " ";
}
}
}
echo " ";
///////////////////////////////////////////////////////////////
echo " | | ";
}
}
$disp_keys[1] = str_replace($index," ",$disp_keys[1]);
$disp_keys[2] = str_replace($index," ",$disp_keys[2]);
}
}
}
}
?>
///////////////////////////////////////////////////////////////////////////////////////////////
?>
|