- Timestamp:
- 2012/02/06 11:05:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php
r21420 r21441 103 103 */ 104 104 function action() { 105 if (isset($_GET['draw_image']) && $_GET['draw_image'] != ""){105 if (isset($_GET['draw_image']) && $_GET['draw_image'] != "") { 106 106 define('DRAW_IMAGE' , true); 107 } else{107 } else { 108 108 define('DRAW_IMAGE' , false); 109 109 } … … 119 119 $this->arrHidden = $objFormParam->getSearchArray(); 120 120 121 switch ($this->getMode()) {121 switch ($this->getMode()) { 122 122 case 'csv': 123 123 case 'search': … … 138 138 list($this->arrResults, $this->tpl_image) = call_user_func_array(array($this, 'lfGetOrder'.$page), 139 139 array($type, $sdate, $edate)); 140 if ($this->getMode() == 'csv') {140 if ($this->getMode() == 'csv') { 141 141 // CSV出力タイトル行の取得 142 142 list($arrTitleCol, $arrDataCol) = $this->lfGetCSVColum($page); … … 180 180 181 181 // セッション情報に開始月度が保存されていない。 182 if (empty($_SESSION['total']['startyear_m'])) {182 if (empty($_SESSION['total']['startyear_m'])) { 183 183 $list['startyear_m'] = $year; 184 184 $list['startmonth_m'] = $month; … … 186 186 187 187 // セッション情報に開始日付、終了日付が保存されていない。 188 if (empty($_SESSION['total']['startyear']) && empty($_SESSION['total']['endyear'])) {188 if (empty($_SESSION['total']['startyear']) && empty($_SESSION['total']['endyear'])) { 189 189 $list['startyear'] = $year; 190 190 $list['startmonth'] = $month; … … 229 229 230 230 // 特殊項目チェック 231 if ($objFormParam->getValue('form') == 1) {231 if ($objFormParam->getValue('form') == 1) { 232 232 $objErr->doFunc(array("月度", "search_startyear_m"), array("ONE_EXIST_CHECK")); 233 233 } 234 234 235 if ($objFormParam->getValue('form') == 2) {235 if ($objFormParam->getValue('form') == 2) { 236 236 $objErr->doFunc(array("期間", "search_startyear", "search_startmonth", "search_startday", "search_endyear", "search_endmonth", "search_endday"), array("FULL_EXIST_CHECK")); 237 237 } … … 273 273 274 274 foreach ($arrRet as $key => $val) { 275 if ($val == "") {275 if ($val == "") { 276 276 continue; 277 277 } … … 302 302 303 303 // 結果が0行以上ある場合のみグラフを生成する。 304 if (count($arrResults) > 0 && $this->install_GD) {304 if (count($arrResults) > 0 && $this->install_GD) { 305 305 306 306 // グラフの生成 … … 314 314 // ラベル表示インターバルを求める 315 315 $interval = intval(count($arrList) / 20); 316 if ($interval < 1) {316 if ($interval < 1) { 317 317 $interval = 1; 318 318 } … … 324 324 325 325 // ラベル回転(日本語不可) 326 if ($keyname == "key_day"){326 if ($keyname == "key_day") { 327 327 $objGraphLine->setXLabelAngle(45); 328 328 } … … 343 343 344 344 // グラフの出力 345 if (DRAW_IMAGE){345 if (DRAW_IMAGE) { 346 346 $objGraphLine->outputGraph(); 347 347 exit(); … … 359 359 $ret_path = ""; 360 360 // 結果が0行以上ある場合のみグラフを生成する。 361 if (count($arrResults) > 0 && $this->install_GD) {361 if (count($arrResults) > 0 && $this->install_GD) { 362 362 // グラフの生成 363 363 $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, … … 387 387 388 388 // グラフの出力 389 if (DRAW_IMAGE){389 if (DRAW_IMAGE) { 390 390 $objGraphPie->outputGraph(); 391 391 exit(); … … 403 403 404 404 // 結果が0行以上ある場合のみグラフを生成する。 405 if (count($arrResults) > 0 && $this->install_GD) {405 if (count($arrResults) > 0 && $this->install_GD) { 406 406 // グラフの生成 407 407 $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, 'total', GRAPH_PIE_MAX, GRAPH_LABEL_MAX); … … 413 413 $objGraphBar = new SC_GraphBar(); 414 414 415 foreach (array_keys($arrList) as $val) {415 foreach (array_keys($arrList) as $val) { 416 416 $arrKey[] = ereg_replace("~", "-", $val); 417 417 } … … 433 433 $objGraphBar->drawGraph(); 434 434 435 if (DRAW_IMAGE){435 if (DRAW_IMAGE) { 436 436 $objGraphBar->outputGraph(); 437 437 exit(); … … 447 447 function lfGetGraphPng($keyname) { 448 448 449 if ($_POST['search_startyear_m'] != "") {449 if ($_POST['search_startyear_m'] != "") { 450 450 $pngname = sprintf("%s_%02d%02d.png", $keyname, substr($_POST['search_startyear_m'],2), $_POST['search_startmonth_m']); 451 451 } else { … … 459 459 $where = ""; 460 460 // 取得日付の指定 461 if ($sdate != "") {461 if ($sdate != "") { 462 462 if ($where != "") { 463 463 $where.= " AND "; … … 466 466 } 467 467 468 if ($edate != "") {468 if ($edate != "") { 469 469 if ($where != "") { 470 470 $where.= " AND "; … … 475 475 476 476 // 会員、非会員の判定 477 switch ($type) {477 switch ($type) { 478 478 // 全体 479 479 case 'all': … … 522 522 $arrTotalResults = $objQuery->select($col, $from, $where, $arrval); 523 523 524 foreach (array_keys($arrTotalResults) as $key) {524 foreach (array_keys($arrTotalResults) as $key) { 525 525 $arrResult =& $arrTotalResults[$key]; 526 526 $member_key = $arrResult['order_sex']; 527 if ($member_key != "") {527 if ($member_key != "") { 528 528 $arrResult['member_name'] = (($arrResult['member']) ? '会員' : '非会員') . $this->arrSex[$member_key]; 529 529 } else { … … 557 557 558 558 /* 559 if ($mode != 'csv') {559 if ($mode != 'csv') { 560 560 $sql.= "LIMIT " . PRODUCTS_TOTAL_MAX; 561 561 }*/ … … 592 592 $arrTotalResults = $objQuery->select($col, $from, $where, $arrval); 593 593 594 foreach (array_keys($arrTotalResults) as $key) {594 foreach (array_keys($arrTotalResults) as $key) { 595 595 $arrResult =& $arrTotalResults[$key]; 596 596 $job_key = $arrResult['job']; 597 if ($job_key != "") {597 if ($job_key != "") { 598 598 $arrResult['job_name'] = $this->arrJob[$job_key]; 599 599 } else { … … 629 629 $arrTotalResults = $objQuery->select($col, $from, $where, $arrval); 630 630 631 foreach (array_keys($arrTotalResults) as $key) {631 foreach (array_keys($arrTotalResults) as $key) { 632 632 $arrResult =& $arrTotalResults[$key]; 633 633 $age_key = $arrResult['age']; 634 if ($age_key != "") {634 if ($age_key != "") { 635 635 $arrResult['age_name'] = $arrResult['age'] . '代'; 636 636 } else { … … 652 652 $where .= " AND del_flg = 0 AND status <> " . ORDER_CANCEL; 653 653 654 switch ($type){654 switch ($type) { 655 655 case 'month': 656 656 $xtitle = "(月別)"; … … 705 705 $arrDateList = $this->lfDateTimeArray($type, $st, $ed); 706 706 707 foreach ($arrResults as $arrResult) {707 foreach ($arrResults as $arrResult) { 708 708 $strdate = $arrResult['str_date']; 709 709 $arrDateResults[$strdate] = $arrResult; … … 712 712 foreach ($arrDateList as $date) { 713 713 714 if (array_key_exists($date, $arrDateResults)) {714 if (array_key_exists($date, $arrDateResults)) { 715 715 716 716 $arrRet[] = $arrDateResults[$date]; … … 728 728 */ 729 729 function lfDateTimeArray($type, $st, $ed) { 730 switch ($type){730 switch ($type) { 731 731 case 'month': 732 732 $format = 'm'; … … 754 754 $nAday = 60*60*24; 755 755 $edx = strtotime($ed); 756 while ( $tmp <= $edx ){756 while ($tmp <= $edx ) { 757 757 $sDate = date($format, $tmp); 758 if ( !in_array($sDate, $arrDateList) ){758 if (!in_array($sDate, $arrDateList) ) { 759 759 $arrDateList[] = $sDate; 760 760 } … … 770 770 function lfAddTotalLine($arrResults) { 771 771 // 検索結果が0でない場合 772 if (count($arrResults) > 0) {772 if (count($arrResults) > 0) { 773 773 774 774 // 合計の計算 775 775 foreach ($arrResults as $arrResult) { 776 foreach (array_keys($arrResult) as $value) {776 foreach (array_keys($arrResult) as $value) { 777 777 $arrTotal[$value] += $arrResult[$value]; 778 778 } … … 790 790 $max = count($arrData); 791 791 $csv_data = ""; 792 for ($i = 0; $i < $max; $i++) {793 foreach ($arrDataCol as $val) {792 for ($i = 0; $i < $max; $i++) { 793 foreach ($arrDataCol as $val) { 794 794 $arrRet[$i][$val] = $arrData[$i][$val]; 795 795 } … … 800 800 801 801 function lfGetCSVColum($page) { 802 switch ($page) {802 switch ($page) { 803 803 // 商品別集計 804 804 case 'products':
Note: See TracChangeset
for help on using the changeset viewer.