Source for file LC_Page_Admin_System_Rank.php
Documentation is available at LC_Page_Admin_System_Rank.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_System_Rank.php 20764 2011-03-22 06:26:40Z nanasess $
// $_GET['move'] が想定値かどうかチェック
$arrClean['move'] = $_GET['move'];
if (SC_Utils_Ex::sfIsInt($_GET['id'])) {
$arrClean['id'] = $_GET['id'];
switch($arrClean['move']) {
GC_Utils_Ex::gfPrintLog("error id=". $_GET['id']);
SC_Response_Ex::sendRedirect(ADMIN_SYSTEM_URLPATH);
$objQuery = & SC_Query_Ex::getSingletonInstance();
$rank = $objQuery->getOne("SELECT rank FROM dtb_member WHERE member_id = ?", array($id));
$maxno = $objQuery->getOne("SELECT max(rank) FROM dtb_member");
$sqlse = "SELECT member_id FROM dtb_member WHERE rank = ?";
$up_id = $objQuery->getOne($sqlse, $rank + 1);
$sqlVal1['rank'] = $rank + 1;
$sqlVal2['rank'] = $rank;
$where = "member_id = ?";
$objQuery->update("dtb_member", $sqlVal1, $where, array($id));
$objQuery->update("dtb_member", $sqlVal2, $where, array($up_id));
$objQuery = & SC_Query_Ex::getSingletonInstance();
$rank = $objQuery->getOne("SELECT rank FROM dtb_member WHERE member_id = ?", array($id));
$minno = $objQuery->getOne("SELECT min(rank) FROM dtb_member");
$sqlse = "SELECT member_id FROM dtb_member WHERE rank = ?";
$down_id = $objQuery->getOne($sqlse, $rank - 1);
$sqlVal1['rank'] = $rank - 1;
$sqlVal2['rank'] = $rank;
$where = "member_id = ?";
$objQuery->update("dtb_member", $sqlVal1, $where, array($id));
$objQuery->update("dtb_member", $sqlVal2, $where, array($down_id));
Documentation generated on Fri, 24 Feb 2012 14:01:51 +0900 by Seasoft
|