コード例 #1
0
/*! \file
*/
$module = $Params['Module'];
$year = $Params['Year'];
$month = $Params['Month'];
$http = eZHTTPTool::instance();
if ($http->hasPostVariable("Year")) {
    $year = $http->postVariable("Year");
}
if ($http->hasPostVariable("Month")) {
    $month = $http->postVariable("Month");
}
if ($http->hasPostVariable("View")) {
    $module->redirectTo("/shop/statistics/" . $year . '/' . $month);
}
$statisticArray = eZOrder::orderStatistics($year, $month);
$yearList = array();
$currentDate = new eZDate();
$currentYear = $currentDate->attribute('year');
for ($index = 0; $index < 10; $index++) {
    $yearList[] = $currentYear - $index;
}
$locale = eZLocale::instance();
$monthList = array();
for ($monthIndex = 1; $monthIndex <= 12; $monthIndex++) {
    $monthList[] = array('value' => $monthIndex, 'name' => $locale->longMonthName($monthIndex));
}
$tpl = eZTemplate::factory();
$tpl->setVariable("year", $year);
$tpl->setVariable("month", $month);
$tpl->setVariable("year_list", $yearList);