Page
[ class tree: Page ] [ index: Page ] [ all elements ]

Source for file LC_Page_Admin_System.php

Documentation is available at LC_Page_Admin_System.php

  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) 2000-2011 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_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: LC_Page_Admin_System.php 20911 2011-05-04 19:29:41Z Seasoft $
  33.  */
  34. class LC_Page_Admin_System extends LC_Page_Admin_Ex {
  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_mainno   'system';
  52.         $this->tpl_subno    'index';
  53.         $this->tpl_onload   'fnGetRadioChecked();';
  54.         $this->tpl_maintitle 'システム設定';
  55.         $this->tpl_subtitle 'メンバー管理';
  56.  
  57.         $masterData new SC_DB_MasterData_Ex();
  58.         $this->arrAUTHORITY $masterData->getMasterData('mtb_authority');
  59.         $this->arrWORK[0]   "非稼働";
  60.         $this->arrWORK[1]   "稼働";
  61.     }
  62.  
  63.     /**
  64.      * Page のプロセス.
  65.      *
  66.      * @return void 
  67.      */
  68.     function process({
  69.         $this->action();
  70.         $this->sendResponse();
  71.     }
  72.  
  73.     /**
  74.      * Page のアクション.
  75.      *
  76.      * @return void 
  77.      */
  78.     function action({
  79.  
  80.         // ADMIN_ID以外の管理者件数を取得
  81.         $linemax $this->getMemberCount("del_flg <> 1 AND member_id <> " ADMIN_ID);
  82.  
  83.         // ADMIN_ID以外で稼動中の管理者件数を取得
  84.         $this->workmax
  85.             = $this->getMemberCount("work = 1 AND del_flg <> 1 AND member_id <> " ADMIN_ID);
  86.  
  87.         // ページ送りの処理 $_GET['pageno']が信頼しうる値かどうかチェックする。
  88.         $pageno $this->lfCheckPageNo($_GET['pageno']);
  89.  
  90.         $objNavi new SC_PageNavi_Ex($pageno$linemaxMEMBER_PMAX'fnMemberPage'NAVI_PMAX);
  91.         $this->tpl_strnavi  $objNavi->strnavi;
  92.         $this->tpl_disppage $objNavi->now_page;
  93.         $this->tpl_pagemax  $objNavi->max_page;
  94.  
  95.         // 取得範囲を指定(開始行番号、行数のセット)して管理者データを取得
  96.         $this->list_data $this->getMemberData($objNavi->start_row);
  97.     }
  98.  
  99.     /**
  100.      * デストラクタ.
  101.      *
  102.      * @return void 
  103.      */
  104.     function destroy({
  105.         parent::destroy();
  106.     }
  107.  
  108.     /**
  109.      * dtb_memberからWHERE句に該当する件数を取得する.
  110.      *
  111.      * @access private
  112.      * @param string $where WHERE句
  113.      * @return integer 件数
  114.      */
  115.      function getMemberCount($where{
  116.         $objQuery =SC_Query_Ex::getSingletonInstance();
  117.         $table 'dtb_member';
  118.         return $objQuery->count($table$where);
  119.      }
  120.  
  121.     /**
  122.      * 開始行番号, 行数を指定して管理者データを取得する.
  123.      *
  124.      * @access private
  125.      * @param integer $startno 開始行番号
  126.      * @return array 管理者データの連想配列
  127.      */
  128.     function getMemberData($startno{
  129.         $objSql new SC_SelectSql_Ex();
  130.         $objSql->setSelect("SELECT member_id,name,department,login_id,authority,rank,work FROM dtb_member");
  131.         $objSql->setOrder("rank DESC");
  132.         $objSql->setWhere("del_flg <> 1 AND member_id <> "ADMIN_ID);
  133.         $objSql->setLimitOffset(MEMBER_PMAX$startno);
  134.  
  135.         $objQuery =SC_Query_Ex::getSingletonInstance();
  136.         $arrMemberData $objQuery->getAll($objSql->getSql());
  137.  
  138.         return $arrMemberData;
  139.      }
  140.  
  141.     /**
  142.      * ページ番号が信頼しうる値かチェックする.
  143.      *
  144.      * @access private
  145.      * @param integer  $pageno ページの番号($_GETから入ってきた値)
  146.      * @return integer $clean_pageno チェック後のページの番号
  147.      */
  148.     function lfCheckPageNo($pageno{
  149.  
  150.         $clean_pageno "";
  151.  
  152.         // $pagenoが0以上の整数かチェック
  153.         if(SC_Utils_Ex::sfIsInt($pageno&& $pageno 0{
  154.             $clean_pageno $pageno;
  155.         }
  156.  
  157.         // 例外は全て1とする
  158.         else {
  159.             $clean_pageno 1;
  160.         }
  161.  
  162.         return $clean_pageno;
  163.     }
  164. }
  165. ?>

Documentation generated on Fri, 24 Feb 2012 14:01:46 +0900 by Seasoft