19 $actualyear = strftime(
"%Y", time());
20 $fmonth = GetHttpVars(
"fmonth", strftime(
"%m", time()));
21 $fyear = GetHttpVars(
"fyear", $actualyear);
22 $tmonth = GetHttpVars(
"tmonth");
23 $tyear = GetHttpVars(
"tyear", $actualyear);
25 for ($i = 1; $i < 13; $i++) {
26 $monthname[$i][
"monthname"] = strftime(
"%B", $i * 3600 * 24 * 28);
27 $monthname[$i][
"monthvalue"] = $i;
28 if ($i == $fmonth) $monthname[$i][
"fselectmonth"] =
"selected";
29 else $monthname[$i][
"fselectmonth"] =
"";
30 if ($i == $tmonth) $monthname[$i][
"tselectmonth"] =
"selected";
31 else $monthname[$i][
"tselectmonth"] =
"";
34 for ($i = 2002; $i <= $actualyear; $i++) {
35 $year[$i][
"yearvalue"] = $i;
36 if ($i == $fyear) $year[$i][
"fselectyear"] =
"selected";
37 else $year[$i][
"fselectyear"] =
"";
38 if ($i == $fyear) $year[$i][
"tselectyear"] =
"selected";
39 else $year[$i][
"tselectyear"] =
"";
41 $action->lay->SetBlockData(
"SELECTMONTHFROM", $monthname);
42 $action->lay->SetBlockData(
"SELECTMONTHTO", $monthname);
43 $action->lay->SetBlockData(
"SELECTYEARFROM", $year);
44 $action->lay->SetBlockData(
"SELECTYEARTO", $year);
45 $action->lay->Set(
"today", strftime(
"%d %B %Y", time()));
47 $fdate = mktime(0, 0, 0, $fmonth, 1, $fyear);
49 if ($tmonth == 0) $tdate = time();
50 else $tdate = mktime(0, 0, -1, $tmonth + 1, 1, $tyear);
51 $action->lay->Set(
"period", sprintf(_(
"period from %s to %s") , strftime(
"%d %B %Y", $fdate) , strftime(
"%d %B %Y", $tdate)));
53 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)));