# Weather forecast

To enter into it it is possible having pressed on the reference "Weather" located on the main page of administration.

On page of weather forecasts you can add, edit and delete forecasts appearing in "phone book".
Let's add the new forecast in the list.
НPress the reference:

In the opened window fill below the specified fields (obligatory to filling - are marked by orange color). Pay attention to a format of filling of date - YYYY-MM-DD

Press "Add".
As a result you will return on the main page of administration of forecasts on which the record added by you will be just registered

Also by means of references "Edit" and "Delete" it is possible to edit the forecast or to remove the forecast from the directory.
Still, you can load into base in advance received forecast (in the form of a XML-file) from a site Hydrometeorological centre of Russia For this purpose, the received file needs to be kept under a name forecast.xml in folder Personal\Admin\forecast\
And to press the reference:

If also it to do laziness, that is the variant is better...
Edit in file Personal\Admin\forecast\parser.php (clean comments symbols (//) in below the specified lines)
It should turn out about the following:
//the way to yours xml to a file on the Internet (receive on a site of hydrometeorological centre)
$xml_file="http://meteoinfo.ru/xml3/export/pay/1/1.xml";
//Copying of a xml-file to itself on a computer
function http_get($url)
{
$buffer = "";
$url_stuff = parse_url($url);
$port = isset($url_stuff['port']) ? $url_stuff['port'] : 80;
$fp = fsockopen($url_stuff['host'], $port);
$query = 'GET ' . $url_stuff['path'] . " HTTP/1.0\n";
$query .= 'Host: ' . $url_stuff['host'];
$query .= "\n\n";
fwrite($fp, $query);
while ($tmp = fread($fp, 1024))
{
$buffer .= $tmp;
}
preg_match('/Content-Length: ([0-9]+)/', $buffer, $parts);
return substr($buffer, - $parts[1]);
}
$fp = fopen ("forecast.xml", "w+");
fwrite ($fp, http_get($xml_file));
fclose ($fp);
Also connect the given file on regular performance in favourite the scheduler of tasks (cron or any another)
In this case it will be possible to forget about updating forecasts (at least for some time)...