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; return 0;
} }
function set_form_date($utime, $prefix) function set_form_date($utime, $prefix) {
{ return array(
global $page; "form${prefix}day" => date("d", $utime),
$page["form${prefix}day"] = date("d", $utime); "form${prefix}month" => date("m.y", $utime)
$page["form${prefix}month"] = date("m.y", $utime); );
} }
function date_to_text($unixtime) function date_to_text($unixtime)

View File

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