Ignore:
Timestamp:
2012/02/06 11:05:15 (12 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php

    r21420 r21441  
    103103     */ 
    104104    function action() { 
    105         if(isset($_GET['draw_image']) && $_GET['draw_image'] != ""){ 
     105        if (isset($_GET['draw_image']) && $_GET['draw_image'] != "") { 
    106106            define('DRAW_IMAGE' , true); 
    107         }else{ 
     107        } else { 
    108108            define('DRAW_IMAGE' , false); 
    109109        } 
     
    119119        $this->arrHidden = $objFormParam->getSearchArray(); 
    120120 
    121         switch($this->getMode()) { 
     121        switch ($this->getMode()) { 
    122122        case 'csv': 
    123123        case 'search': 
     
    138138                list($this->arrResults, $this->tpl_image) = call_user_func_array(array($this, 'lfGetOrder'.$page), 
    139139                                                                                 array($type, $sdate, $edate)); 
    140                 if($this->getMode() == 'csv') { 
     140                if ($this->getMode() == 'csv') { 
    141141                    // CSV出力タイトル行の取得 
    142142                    list($arrTitleCol, $arrDataCol) = $this->lfGetCSVColum($page); 
     
    180180 
    181181        // セッション情報に開始月度が保存されていない。 
    182         if(empty($_SESSION['total']['startyear_m'])) { 
     182        if (empty($_SESSION['total']['startyear_m'])) { 
    183183            $list['startyear_m'] = $year; 
    184184            $list['startmonth_m'] = $month; 
     
    186186 
    187187        // セッション情報に開始日付、終了日付が保存されていない。 
    188         if(empty($_SESSION['total']['startyear']) && empty($_SESSION['total']['endyear'])) { 
     188        if (empty($_SESSION['total']['startyear']) && empty($_SESSION['total']['endyear'])) { 
    189189            $list['startyear'] = $year; 
    190190            $list['startmonth'] = $month; 
     
    229229 
    230230        // 特殊項目チェック 
    231         if($objFormParam->getValue('form') == 1) { 
     231        if ($objFormParam->getValue('form') == 1) { 
    232232            $objErr->doFunc(array("月度", "search_startyear_m"), array("ONE_EXIST_CHECK")); 
    233233        } 
    234234 
    235         if($objFormParam->getValue('form') == 2) { 
     235        if ($objFormParam->getValue('form') == 2) { 
    236236            $objErr->doFunc(array("期間", "search_startyear", "search_startmonth", "search_startday", "search_endyear", "search_endmonth", "search_endday"), array("FULL_EXIST_CHECK")); 
    237237        } 
     
    273273 
    274274        foreach ($arrRet as $key => $val) { 
    275             if($val == "") { 
     275            if ($val == "") { 
    276276                continue; 
    277277            } 
     
    302302 
    303303        // 結果が0行以上ある場合のみグラフを生成する。 
    304         if(count($arrResults) > 0 && $this->install_GD) { 
     304        if (count($arrResults) > 0 && $this->install_GD) { 
    305305 
    306306            // グラフの生成 
     
    314314            // ラベル表示インターバルを求める 
    315315            $interval = intval(count($arrList) / 20); 
    316             if($interval < 1) { 
     316            if ($interval < 1) { 
    317317                $interval = 1; 
    318318            } 
     
    324324 
    325325            // ラベル回転(日本語不可) 
    326             if($keyname == "key_day"){ 
     326            if ($keyname == "key_day") { 
    327327                $objGraphLine->setXLabelAngle(45); 
    328328            } 
     
    343343 
    344344            // グラフの出力 
    345             if(DRAW_IMAGE){ 
     345            if (DRAW_IMAGE) { 
    346346                $objGraphLine->outputGraph(); 
    347347                exit(); 
     
    359359        $ret_path = ""; 
    360360        // 結果が0行以上ある場合のみグラフを生成する。 
    361         if(count($arrResults) > 0 && $this->install_GD) { 
     361        if (count($arrResults) > 0 && $this->install_GD) { 
    362362            // グラフの生成 
    363363            $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, 
     
    387387 
    388388            // グラフの出力 
    389             if(DRAW_IMAGE){ 
     389            if (DRAW_IMAGE) { 
    390390                $objGraphPie->outputGraph(); 
    391391                exit(); 
     
    403403 
    404404        // 結果が0行以上ある場合のみグラフを生成する。 
    405         if(count($arrResults) > 0 && $this->install_GD) { 
     405        if (count($arrResults) > 0 && $this->install_GD) { 
    406406            // グラフの生成 
    407407            $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, 'total', GRAPH_PIE_MAX, GRAPH_LABEL_MAX); 
     
    413413            $objGraphBar = new SC_GraphBar(); 
    414414 
    415             foreach(array_keys($arrList) as $val) { 
     415            foreach (array_keys($arrList) as $val) { 
    416416                $arrKey[] = ereg_replace("~", "-", $val); 
    417417            } 
     
    433433            $objGraphBar->drawGraph(); 
    434434 
    435             if(DRAW_IMAGE){ 
     435            if (DRAW_IMAGE) { 
    436436                $objGraphBar->outputGraph(); 
    437437                exit(); 
     
    447447    function lfGetGraphPng($keyname) { 
    448448 
    449         if($_POST['search_startyear_m'] != "") { 
     449        if ($_POST['search_startyear_m'] != "") { 
    450450            $pngname = sprintf("%s_%02d%02d.png", $keyname, substr($_POST['search_startyear_m'],2), $_POST['search_startmonth_m']); 
    451451        } else { 
     
    459459        $where = ""; 
    460460        // 取得日付の指定 
    461         if($sdate != "") { 
     461        if ($sdate != "") { 
    462462            if ($where != "") { 
    463463                $where.= " AND "; 
     
    466466        } 
    467467 
    468         if($edate != "") { 
     468        if ($edate != "") { 
    469469            if ($where != "") { 
    470470                $where.= " AND "; 
     
    475475 
    476476        // 会員、非会員の判定 
    477         switch($type) { 
     477        switch ($type) { 
    478478            // 全体 
    479479        case 'all': 
     
    522522        $arrTotalResults = $objQuery->select($col, $from, $where, $arrval); 
    523523 
    524         foreach(array_keys($arrTotalResults) as $key) { 
     524        foreach (array_keys($arrTotalResults) as $key) { 
    525525            $arrResult =& $arrTotalResults[$key]; 
    526526            $member_key = $arrResult['order_sex']; 
    527             if($member_key != "") { 
     527            if ($member_key != "") { 
    528528                $arrResult['member_name'] = (($arrResult['member']) ? '会員' : '非会員') . $this->arrSex[$member_key]; 
    529529            } else { 
     
    557557 
    558558        /* 
    559         if($mode != 'csv') { 
     559        if ($mode != 'csv') { 
    560560            $sql.= "LIMIT " . PRODUCTS_TOTAL_MAX; 
    561561        }*/ 
     
    592592        $arrTotalResults = $objQuery->select($col, $from, $where, $arrval); 
    593593 
    594         foreach(array_keys($arrTotalResults) as $key) { 
     594        foreach (array_keys($arrTotalResults) as $key) { 
    595595            $arrResult =& $arrTotalResults[$key]; 
    596596            $job_key = $arrResult['job']; 
    597             if($job_key != "") { 
     597            if ($job_key != "") { 
    598598                $arrResult['job_name'] = $this->arrJob[$job_key]; 
    599599            } else { 
     
    629629        $arrTotalResults = $objQuery->select($col, $from, $where, $arrval); 
    630630 
    631         foreach(array_keys($arrTotalResults) as $key) { 
     631        foreach (array_keys($arrTotalResults) as $key) { 
    632632            $arrResult =& $arrTotalResults[$key]; 
    633633            $age_key = $arrResult['age']; 
    634             if($age_key != "") { 
     634            if ($age_key != "") { 
    635635                $arrResult['age_name'] = $arrResult['age'] . '代'; 
    636636            } else { 
     
    652652        $where .= " AND del_flg = 0 AND status <> " . ORDER_CANCEL; 
    653653 
    654         switch($type){ 
     654        switch ($type) { 
    655655        case 'month': 
    656656            $xtitle = "(月別)"; 
     
    705705        $arrDateList = $this->lfDateTimeArray($type, $st, $ed); 
    706706 
    707         foreach($arrResults as $arrResult) { 
     707        foreach ($arrResults as $arrResult) { 
    708708            $strdate                = $arrResult['str_date']; 
    709709            $arrDateResults[$strdate] = $arrResult; 
     
    712712        foreach ($arrDateList as $date) { 
    713713 
    714             if(array_key_exists($date, $arrDateResults)) { 
     714            if (array_key_exists($date, $arrDateResults)) { 
    715715 
    716716                $arrRet[] = $arrDateResults[$date]; 
     
    728728     */ 
    729729    function lfDateTimeArray($type, $st, $ed) { 
    730         switch($type){ 
     730        switch ($type) { 
    731731            case 'month': 
    732732                $format        = 'm'; 
     
    754754            $nAday  = 60*60*24; 
    755755            $edx    = strtotime($ed); 
    756             while( $tmp <= $edx ){ 
     756            while ($tmp <= $edx ) { 
    757757                $sDate = date($format, $tmp); 
    758                 if( !in_array($sDate, $arrDateList) ){ 
     758                if (!in_array($sDate, $arrDateList) ) { 
    759759                    $arrDateList[] = $sDate; 
    760760                } 
     
    770770    function lfAddTotalLine($arrResults) { 
    771771        // 検索結果が0でない場合 
    772         if(count($arrResults) > 0) { 
     772        if (count($arrResults) > 0) { 
    773773 
    774774            // 合計の計算 
    775775            foreach ($arrResults as $arrResult) { 
    776                 foreach(array_keys($arrResult) as $value) { 
     776                foreach (array_keys($arrResult) as $value) { 
    777777                    $arrTotal[$value] += $arrResult[$value]; 
    778778                } 
     
    790790        $max = count($arrData); 
    791791        $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) { 
    794794                $arrRet[$i][$val] = $arrData[$i][$val]; 
    795795            } 
     
    800800 
    801801    function lfGetCSVColum($page) { 
    802         switch($page) { 
     802        switch ($page) { 
    803803            // 商品別集計 
    804804        case 'products': 
Note: See TracChangeset for help on using the changeset viewer.