Remove global variable $page from set_form_date func

This commit is contained in:
Dmitriy Simushev 2014-01-20 13:20:12 +00:00
parent f2f4f7bb12
commit 155c858fd6
2 changed files with 10 additions and 7 deletions

View File

@ -56,11 +56,11 @@ function get_form_date($day, $month)
return 0;
}
function set_form_date($utime, $prefix)
{
global $page;
$page["form${prefix}day"] = date("d", $utime);
$page["form${prefix}month"] = date("m.y", $utime);
function set_form_date($utime, $prefix) {
return array(
"form${prefix}day" => date("d", $utime),
"form${prefix}month" => date("m.y", $utime)
);
}
function date_to_text($unixtime)

View File

@ -76,8 +76,11 @@ if (isset($_GET['startday'])) {
$end = time() + 24 * 60 * 60;
}
}
set_form_date($start, "start");
set_form_date($end - 24 * 60 * 60, "end");
$page = array_merge(
$page,
set_form_date($start, "start"),
set_form_date($end - 24 * 60 * 60, "end")
);
if ($start > $end) {
$errors[] = getlocal("statistics.wrong.dates");