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

Revision 22856, 4.8 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
  • 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
24require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
25
26/**
27 * システム管理 のページクラス.
28 *
29 * @package Page
30 * @author LOCKON CO.,LTD.
31 * @version $Id$
32 */
33class LC_Page_Admin_System extends LC_Page_Admin_Ex
34{
35    /**
36     * Page を初期化する.
37     *
38     * @return void
39     */
40    function init()
41    {
42        parent::init();
43
44        $this->list_data    = '';  // テーブルデータ取得用
45        $this->tpl_disppage = '';  // 表示中のページ番号
46        $this->tpl_strnavi  = '';
47        $this->tpl_mainpage = 'system/index.tpl';
48        $this->tpl_mainno   = 'system';
49        $this->tpl_subno    = 'index';
50        $this->tpl_onload   = 'fnGetRadioChecked();';
51        $this->tpl_maintitle = 'システム設定';
52        $this->tpl_subtitle = 'メンバー管理';
53
54        $masterData = new SC_DB_MasterData_Ex();
55        $this->arrAUTHORITY = $masterData->getMasterData('mtb_authority');
56        $this->arrWORK = $masterData->getMasterData('mtb_work');
57    }
58
59    /**
60     * Page のプロセス.
61     *
62     * @return void
63     */
64    function process()
65    {
66        $this->action();
67        $this->sendResponse();
68    }
69
70    /**
71     * Page のアクション.
72     *
73     * @return void
74     */
75    function action()
76    {
77        // ADMIN_ID以外の管理者件数を取得
78        $linemax = $this->getMemberCount('del_flg <> 1 AND member_id <> ' . ADMIN_ID);
79
80        // ADMIN_ID以外で稼動中の管理者件数を取得
81        $this->workmax
82            = $this->getMemberCount('work = 1 AND del_flg <> 1 AND member_id <> ' . ADMIN_ID);
83
84        // ページ送りの処理 $_GET['pageno']が信頼しうる値かどうかチェックする。
85        $pageno = $this->lfCheckPageNo($_GET['pageno']);
86
87        $objNavi = new SC_PageNavi_Ex($pageno, $linemax, MEMBER_PMAX, 'fnMemberPage', NAVI_PMAX);
88        $this->tpl_strnavi  = $objNavi->strnavi;
89        $this->tpl_disppage = $objNavi->now_page;
90        $this->tpl_pagemax  = $objNavi->max_page;
91
92        // 取得範囲を指定(開始行番号、行数のセット)して管理者データを取得
93        $this->list_data = $this->getMemberData($objNavi->start_row);
94
95    }
96
97    /**
98     * デストラクタ.
99     *
100     * @return void
101     */
102    function destroy()
103    {
104        parent::destroy();
105    }
106
107    /**
108     * dtb_memberからWHERE句に該当する件数を取得する.
109     *
110     * @access private
111     * @param string $where WHERE句
112     * @return integer 件数
113     */
114    function getMemberCount($where)
115    {
116        $objQuery =& SC_Query_Ex::getSingletonInstance();
117        $table = 'dtb_member';
118
119        return $objQuery->count($table, $where);
120    }
121
122    /**
123     * 開始行番号, 行数を指定して管理者データを取得する.
124     *
125     * @access private
126     * @param integer $startno 開始行番号
127     * @return array 管理者データの連想配列
128     */
129    function getMemberData($startno)
130    {
131        $col = 'member_id,name,department,login_id,authority,rank,work';
132        $from = 'dtb_member';
133        $where = 'del_flg <> 1 AND member_id <> ?';
134        $objQuery =& SC_Query_Ex::getSingletonInstance();
135        $objQuery->setOrder('rank DESC');
136        $objQuery->setLimitOffset(MEMBER_PMAX, $startno);
137        $arrMemberData = $objQuery->select($col, $from, $where, array(ADMIN_ID));
138
139        return $arrMemberData;
140    }
141
142    /**
143     * ページ番号が信頼しうる値かチェックする.
144     *
145     * @access private
146     * @param integer  $pageno ページの番号($_GETから入ってきた値)
147     * @return integer $clean_pageno チェック後のページの番号
148     */
149    function lfCheckPageNo($pageno)
150    {
151        $clean_pageno = '';
152
153        // $pagenoが0以上の整数かチェック
154        if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) {
155            $clean_pageno = $pageno;
156        }
157
158        // 例外は全て1とする
159        else {
160            $clean_pageno = 1;
161        }
162
163        return $clean_pageno;
164    }
165}
Note: See TracBrowser for help on using the repository browser.