source: branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System.php @ 22567

Revision 22567, 4.9 KB checked in by shutta, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23
24// {{{ requires
25require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
26
27/**
28 * システム管理 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Admin_System extends LC_Page_Admin_Ex
35{
36
37    // }}}
38    // {{{ functions
39
40    /**
41     * Page を初期化する.
42     *
43     * @return void
44     */
45    function init()
46    {
47        parent::init();
48
49        $this->list_data    = '';  // テーブルデータ取得用
50        $this->tpl_disppage = '';  // 表示中のページ番号
51        $this->tpl_strnavi  = '';
52        $this->tpl_mainpage = 'system/index.tpl';
53        $this->tpl_mainno   = 'system';
54        $this->tpl_subno    = 'index';
55        $this->tpl_onload   = 'fnGetRadioChecked();';
56        $this->tpl_maintitle = 'システム設定';
57        $this->tpl_subtitle = 'メンバー管理';
58
59        $masterData = new SC_DB_MasterData_Ex();
60        $this->arrAUTHORITY = $masterData->getMasterData('mtb_authority');
61        $this->arrWORK = $masterData->getMasterData('mtb_work');
62    }
63
64    /**
65     * Page のプロセス.
66     *
67     * @return void
68     */
69    function process()
70    {
71        $this->action();
72        $this->sendResponse();
73    }
74
75    /**
76     * Page のアクション.
77     *
78     * @return void
79     */
80    function action()
81    {
82
83        // ADMIN_ID以外の管理者件数を取得
84        $linemax = $this->getMemberCount('del_flg <> 1 AND member_id <> ' . ADMIN_ID);
85
86        // ADMIN_ID以外で稼動中の管理者件数を取得
87        $this->workmax
88            = $this->getMemberCount('work = 1 AND del_flg <> 1 AND member_id <> ' . ADMIN_ID);
89
90        // ページ送りの処理 $_GET['pageno']が信頼しうる値かどうかチェックする。
91        $pageno = $this->lfCheckPageNo($_GET['pageno']);
92
93        $objNavi = new SC_PageNavi_Ex($pageno, $linemax, MEMBER_PMAX, 'fnMemberPage', NAVI_PMAX);
94        $this->tpl_strnavi  = $objNavi->strnavi;
95        $this->tpl_disppage = $objNavi->now_page;
96        $this->tpl_pagemax  = $objNavi->max_page;
97
98        // 取得範囲を指定(開始行番号、行数のセット)して管理者データを取得
99        $this->list_data = $this->getMemberData($objNavi->start_row);
100
101    }
102
103    /**
104     * デストラクタ.
105     *
106     * @return void
107     */
108    function destroy()
109    {
110        parent::destroy();
111    }
112
113    /**
114     * dtb_memberからWHERE句に該当する件数を取得する.
115     *
116     * @access private
117     * @param string $where WHERE句
118     * @return integer 件数
119     */
120    function getMemberCount($where)
121    {
122        $objQuery =& SC_Query_Ex::getSingletonInstance();
123        $table = 'dtb_member';
124        return $objQuery->count($table, $where);
125    }
126
127    /**
128     * 開始行番号, 行数を指定して管理者データを取得する.
129     *
130     * @access private
131     * @param integer $startno 開始行番号
132     * @return array 管理者データの連想配列
133     */
134    function getMemberData($startno)
135    {
136        $col = 'member_id,name,department,login_id,authority,rank,work';
137        $from = 'dtb_member';
138        $where = 'del_flg <> 1 AND member_id <> ?';
139        $objQuery =& SC_Query_Ex::getSingletonInstance();
140        $objQuery->setOrder('rank DESC');
141        $objQuery->setLimitOffset(MEMBER_PMAX, $startno);
142        $arrMemberData = $objQuery->select($col, $from, $where, array(ADMIN_ID));
143        return $arrMemberData;
144    }
145
146    /**
147     * ページ番号が信頼しうる値かチェックする.
148     *
149     * @access private
150     * @param integer  $pageno ページの番号($_GETから入ってきた値)
151     * @return integer $clean_pageno チェック後のページの番号
152     */
153    function lfCheckPageNo($pageno)
154    {
155
156        $clean_pageno = '';
157
158        // $pagenoが0以上の整数かチェック
159        if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) {
160            $clean_pageno = $pageno;
161        }
162
163        // 例外は全て1とする
164        else {
165            $clean_pageno = 1;
166        }
167
168        return $clean_pageno;
169    }
170}
Note: See TracBrowser for help on using the repository browser.