Changeset 18635 for branches/comu-ver2


Ignore:
Timestamp:
2010/05/08 14:00:32 (14 years ago)
Author:
Seasoft
Message:

#628(未使用処理・定義の削除)

Location:
branches/comu-ver2/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/admin/total/index.tpl

    r18254 r18635  
    106106  <div class="btn"> 
    107107    <button type="button" onclick="fnModeSubmit('csv','','');"><span>検索結果をCSVダウンロード</span></button> 
    108     <!--{* PDF機能は次期開発で追加予定 
    109     <input type="button" name="subm" value="検索結果をPDFダウンロード" onclick="fnModeSubmit('pdf','','');" /> 
    110     *}--> 
    111108  </div> 
    112109 
  • branches/comu-ver2/data/class/pages/admin/total/LC_Page_Admin_Total.php

    r18486 r18635  
    120120        $mode = $this->objFormParam->getValue('mode'); 
    121121        switch($mode) { 
    122         case 'pdf': 
    123122        case 'csv': 
    124123        case 'search': 
     
    235234                    exit; 
    236235                } 
    237  
    238                 if($mode == 'pdf') { 
    239                     // CSV出力タイトル行の取得 
    240                     list($arrTitleCol, $arrDataCol, $arrColSize, $arrAlign, $title) = $this->lfGetPDFColum($page, $type, $this->keyname); 
    241                     $head = SC_Utils_Ex::sfGetPDFList($arrTitleCol); 
    242                     $data = $this->lfGetDataColPDF($this->arrResults, $arrDataCol, 40); 
    243                     // PDF出力用 
    244                     $graph_name = basename($this->tpl_image); 
    245                     $this->lfPDFDownload($graph_name, $head . $data, $arrColSize, $arrAlign, $sdate, $edate, $title, $page); 
    246                     exit; 
    247                 } 
    248236            } 
    249237            break; 
     
    281269    function destroy() { 
    282270        parent::destroy(); 
    283     } 
    284  
    285     /* PDF出力 */ 
    286     function lfPDFDownload($image, $table, $arrColSize, $arrAlign, $sdate, $edate, $title, $page = "") { 
    287  
    288         $objPdf = new SC_Pdf(); 
    289         $objPdf->setTableColor("CCCCCC", "F0F0F0", "D1DEFE"); 
    290  
    291         // 土台となるPDFファイルの指定 
    292         $objPdf->setTemplate(PDF_DIR . "total.pdf"); 
    293  
    294         $disp_sdate = sfDispDBDate($sdate, false); 
    295         $disp_edate = sfDispDBDate($edate, false); 
    296  
    297         $arrText['title_block'] = $title; 
    298         $arrText['date_block'] = "$disp_sdate-$disp_edate"; 
    299         $arrImage['graph_block'] = GRAPH_DIR . $image; 
    300  
    301         // 文末の\nを削除する 
    302         $table = ereg_replace("\n$", "", $table); 
    303         $arrRet = split("\n", $table); 
    304         $page_max = intval((count($arrRet) / 35) + 1); 
    305  
    306         for($page = 1; $page <= $page_max; $page++) { 
    307             if($page > 1) { 
    308                 // 2ページ以降 
    309                 $start_no = 35 * ($page - 1) + 1; 
    310             } else { 
    311                 // 開始ページ 
    312                 $start_no = 1; 
    313             } 
    314  
    315             $arrText['page_block'] = $page . " / " . $page_max; 
    316             $objPdf->setTextBlock($arrText); 
    317             $objPdf->setImageBlock($arrImage); 
    318             // ブロック値の入力 
    319             $objPdf->writeBlock(); 
    320             // 最終ページのみ、商品別集計は合計がないので最終行の色を変更しない。 
    321             if($page == $page_max && $page != 'products') { 
    322                 $last_color_flg = true; 
    323             } else { 
    324                 $last_color_flg = false; 
    325             } 
    326             $objPdf->writeTableCenter($table, 500, $arrColSize, $arrAlign, 35, $start_no, $last_color_flg); 
    327             $objPdf->closePage(); 
    328         } 
    329  
    330         // PDFの出力 
    331         $objPdf->output(); 
    332271    } 
    333272 
     
    891830        } 
    892831        return $csv_data; 
    893     } 
    894  
    895     // 必要なカラムのみ抽出する(PDFデータで取得する) 
    896     function lfGetDataColPDF($arrData, $arrDataCol, $len) { 
    897         $max = count($arrData); 
    898         $csv_data = ""; 
    899         for($i = 0; $i < $max; $i++) { 
    900             foreach($arrDataCol as $val) { 
    901                 $arrRet[$i][$val] = SC_Utils_Ex::sfCutString($arrData[$i][$val], $len); 
    902             } 
    903             $csv_data.= SC_Utils_Ex::sfGetPDFList($arrRet[$i]); 
    904         } 
    905         return $csv_data; 
    906     } 
    907  
    908     function lfGetPDFColum($page, $type, $key = "") { 
    909  
    910         $arrSUBNAME['day'] = "日別"; 
    911         $arrSUBNAME['month'] = "月別"; 
    912         $arrSUBNAME['year'] = "年別"; 
    913         $arrSUBNAME['hour'] = "時間別"; 
    914         $arrSUBNAME['wday'] = "曜日別"; 
    915         $arrSUBNAME['all'] = "全体"; 
    916         $arrSUBNAME['member'] = "会員"; 
    917         $arrSUBNAME['nonmember'] = "非会員"; 
    918  
    919         switch($page) { 
    920             // 商品別集計 
    921         case 'products': 
    922             $title = "商品別集計(" . $arrSUBNAME[$type] . ")"; 
    923             $arrColSize = array( 
    924                                 60, 
    925                                 120, 
    926                                 220, 
    927                                 80, 
    928                                 80, 
    929                                 80, 
    930                                 ); 
    931             $arrAlign = array( 
    932                               'right', 
    933                               'center', 
    934                               'right', 
    935                               'right', 
    936                               'right', 
    937                               'right', 
    938                               ); 
    939             break; 
    940             // 職業別集計 
    941         case 'job': 
    942             $title = "職業別集計(" . $arrSUBNAME[$type] . ")"; 
    943             $arrColSize = array( 
    944                                 100, 
    945                                 100, 
    946                                 100, 
    947                                 100, 
    948                                 ); 
    949             $arrAlign = array( 
    950                               'right', 
    951                               'right', 
    952                               'right', 
    953                               'right', 
    954                               ); 
    955             break; 
    956             // 会員別集計 
    957         case 'member': 
    958             $title = "会員別集計(" . $arrSUBNAME[$type] . ")"; 
    959             $arrColSize = array( 
    960                                 100, 
    961                                 100, 
    962                                 100, 
    963                                 100, 
    964                                 ); 
    965             $arrAlign = array( 
    966                               'right', 
    967                               'right', 
    968                               'right', 
    969                               'right', 
    970                               ); 
    971             break; 
    972             // 年代別集計 
    973         case 'age': 
    974             $title = "年代別集計(" . $arrSUBNAME[$type] . ")"; 
    975             $arrColSize = array( 
    976                                 80, 
    977                                 100, 
    978                                 100, 
    979                                 100, 
    980                                 ); 
    981             $arrAlign = array( 
    982                               'right', 
    983                               'right', 
    984                               'right', 
    985                               'right', 
    986                               ); 
    987             break; 
    988             // 期間別集計 
    989         default: 
    990             $title = "期間別集計(" . $arrSUBNAME[$type] . ")"; 
    991             $arrColSize = array( 
    992                                 60, 
    993                                 60, 
    994                                 50, 
    995                                 50, 
    996                                 80, 
    997                                 80, 
    998                                 80, 
    999                                 80, 
    1000                                 80, 
    1001                                 80, 
    1002                                 ); 
    1003             $arrAlign = array( 
    1004                               'right', 
    1005                               'right', 
    1006                               'right', 
    1007                               'right', 
    1008                               'right', 
    1009                               'right', 
    1010                               'right', 
    1011                               'right', 
    1012                               'right', 
    1013                               'right', 
    1014                               ); 
    1015             break; 
    1016         } 
    1017  
    1018         list($arrTitleCol, $arrDataCol) = lfGetCSVColum($page, $key); 
    1019  
    1020         return array($arrTitleCol, $arrDataCol, $arrColSize, $arrAlign, $title); 
    1021832    } 
    1022833 
Note: See TracChangeset for help on using the changeset viewer.