21 $actualyear = strftime(
"%Y", time());
22 $fmonth =
GetHttpVars(
"fmonth", strftime(
"%m", time()));
27 for ($i = 1; $i < 13; $i++) {
28 $monthname[$i][
"monthname"] = strftime(
"%B", $i * 3600 * 24 * 28);
29 $monthname[$i][
"monthvalue"] = $i;
30 if ($i == $fmonth) $monthname[$i][
"fselectmonth"] =
"selected";
31 else $monthname[$i][
"fselectmonth"] =
"";
32 if ($i == $tmonth) $monthname[$i][
"tselectmonth"] =
"selected";
33 else $monthname[$i][
"tselectmonth"] =
"";
36 for ($i = 2002; $i <= $actualyear; $i++) {
37 $year[$i][
"yearvalue"] = $i;
38 if ($i == $fyear) $year[$i][
"fselectyear"] =
"selected";
39 else $year[$i][
"fselectyear"] =
"";
40 if ($i == $fyear) $year[$i][
"tselectyear"] =
"selected";
41 else $year[$i][
"tselectyear"] =
"";
43 $action->lay->SetBlockData(
"SELECTMONTHFROM", $monthname);
44 $action->lay->SetBlockData(
"SELECTMONTHTO", $monthname);
45 $action->lay->SetBlockData(
"SELECTYEARFROM", $year);
46 $action->lay->SetBlockData(
"SELECTYEARTO", $year);
47 $action->lay->Set(
"today", strftime(
"%d %B %Y", time()));
49 $fdate = mktime(0, 0, 0, $fmonth, 1, $fyear);
51 if ($tmonth == 0) $tdate = time();
52 else $tdate = mktime(0, 0, -1, $tmonth + 1, 1, $tyear);
53 $action->lay->Set(
"period", sprintf(_(
"period from %s to %s") , strftime(
"%d %B %Y", $fdate) , strftime(
"%d %B %Y", $tdate)));
55 if ($tdate < $fdate)
$action->ExitError(sprintf(_(
"the end date (%s) is before the begin date (%s)") , strftime(
"%d %B %Y %T", $tdate) , strftime(
"%d %B %Y %T", $fdate)));