1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2010 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 |
---|
25 | require_once(CLASS_PATH . "pages/LC_Page.php"); |
---|
26 | |
---|
27 | /** |
---|
28 | * システム管理 のページクラス. |
---|
29 | * |
---|
30 | * @package Page |
---|
31 | * @author LOCKON CO.,LTD. |
---|
32 | * @version $Id$ |
---|
33 | */ |
---|
34 | class LC_Page_Admin_System extends LC_Page { |
---|
35 | |
---|
36 | // }}} |
---|
37 | // {{{ functions |
---|
38 | |
---|
39 | /** |
---|
40 | * Page を初期化する. |
---|
41 | * |
---|
42 | * @return void |
---|
43 | */ |
---|
44 | function init() { |
---|
45 | parent::init(); |
---|
46 | |
---|
47 | $this->list_data = ''; // テーブルデータ取得用 |
---|
48 | $this->tpl_disppage = ''; // 表示中のページ番号 |
---|
49 | $this->tpl_strnavi = ''; |
---|
50 | $this->tpl_mainpage = 'system/index.tpl'; |
---|
51 | $this->tpl_subnavi = 'system/subnavi.tpl'; |
---|
52 | $this->tpl_mainno = 'system'; |
---|
53 | $this->tpl_subno = 'index'; |
---|
54 | $this->tpl_onload = 'fnGetRadioChecked();'; |
---|
55 | $this->tpl_subtitle = 'メンバー管理'; |
---|
56 | |
---|
57 | $masterData = new SC_DB_MasterData_Ex(); |
---|
58 | $this->arrAUTHORITY = $masterData->getMasterData('mtb_authority'); |
---|
59 | } |
---|
60 | |
---|
61 | /** |
---|
62 | * Page のプロセス. |
---|
63 | * |
---|
64 | * @return void |
---|
65 | */ |
---|
66 | function process() { |
---|
67 | $objView = new SC_AdminView(); |
---|
68 | $objSess = new SC_Session(); |
---|
69 | |
---|
70 | // 認証可否の判定 |
---|
71 | SC_Utils_Ex::sfIsSuccess($objSess); |
---|
72 | |
---|
73 | // ADMIN_ID以外の管理者件数を取得 |
---|
74 | $linemax = $this->getMemberCount("del_flg <> 1 AND member_id <> " . ADMIN_ID); |
---|
75 | |
---|
76 | // ADMIN_ID以外で稼動中の管理者件数を取得 |
---|
77 | $this->workmax |
---|
78 | = $this->getMemberCount("work = 1 AND del_flg <> 1 AND member_id <> " . ADMIN_ID); |
---|
79 | |
---|
80 | // ページ送りの処理 |
---|
81 | $pageno = isset($_GET['pageno']) ? $_GET['pageno'] : 1; |
---|
82 | $objNavi = new SC_PageNavi($pageno, $linemax, MEMBER_PMAX, "fnMemberPage", NAVI_PMAX); |
---|
83 | $this->tpl_strnavi = $objNavi->strnavi; |
---|
84 | $this->tpl_disppage = $objNavi->now_page; |
---|
85 | $this->tpl_pagemax = $objNavi->max_page; |
---|
86 | |
---|
87 | // 取得範囲を指定(開始行番号、行数のセット)して管理者データを取得 |
---|
88 | $this->list_data = $this->getMemberData($objNavi->start_row); |
---|
89 | |
---|
90 | $objView->assignobj($this); |
---|
91 | $objView->display(MAIN_FRAME); |
---|
92 | } |
---|
93 | |
---|
94 | /** |
---|
95 | * デストラクタ. |
---|
96 | * |
---|
97 | * @return void |
---|
98 | */ |
---|
99 | function destroy() { |
---|
100 | parent::destroy(); |
---|
101 | } |
---|
102 | |
---|
103 | /** |
---|
104 | * dtb_memberからWHERE句に該当する件数を取得する. |
---|
105 | * |
---|
106 | * @access private |
---|
107 | * @param string $where WHERE句 |
---|
108 | * @return integer 件数 |
---|
109 | */ |
---|
110 | function getMemberCount($where) { |
---|
111 | $objQuery = new SC_Query(); |
---|
112 | $table = 'dtb_member'; |
---|
113 | return $objQuery->count($table, $where); |
---|
114 | } |
---|
115 | |
---|
116 | /** |
---|
117 | * 開始行番号, 行数を指定して管理者データを取得する. |
---|
118 | * |
---|
119 | * @access private |
---|
120 | * @param integer $startno 開始行番号 |
---|
121 | * @return array 管理者データの連想配列 |
---|
122 | */ |
---|
123 | function getMemberData($startno) { |
---|
124 | $objSql = new SC_SelectSql(); |
---|
125 | $objSql->setSelect("SELECT member_id,name,department,login_id,authority,rank,work FROM dtb_member"); |
---|
126 | $objSql->setOrder("rank DESC"); |
---|
127 | $objSql->setWhere("del_flg <> 1 AND member_id <> ". ADMIN_ID); |
---|
128 | $objSql->setLimitOffset(MEMBER_PMAX, $startno); |
---|
129 | |
---|
130 | $objQuery = new SC_Query(); |
---|
131 | $arrMemberData = $objQuery->getAll($objSql->getSql()); |
---|
132 | |
---|
133 | return $arrMemberData; |
---|
134 | } |
---|
135 | } |
---|
136 | ?> |
---|