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-2010 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_PATH . "pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_System_Rank.php 16582 2007-11-28 15:02:29Z satou $
if($_GET['move'] == 'up') {
} else if($_GET['move'] == 'down') {
$rank = $conn->getOne("SELECT rank FROM dtb_member WHERE member_id = ". $id);
$maxno = $conn->getOne("SELECT max(rank) FROM dtb_member");
$sqlse = "SELECT member_id FROM dtb_member WHERE rank = ?";
$up_id = $conn->getOne($sqlse, $rank + 1);
$sqlup = "UPDATE dtb_member SET rank = ? WHERE member_id = ?";
$conn->query($sqlup, array($rank + 1, $id));
$conn->query($sqlup, array($rank, $up_id));
$rank = $conn->getOne("SELECT rank FROM dtb_member WHERE member_id = ". $id);
$minno = $conn->getOne("SELECT min(rank) FROM dtb_member");
$sqlse = "SELECT member_id FROM dtb_member WHERE rank = ?";
$down_id = $conn->getOne($sqlse, $rank - 1);
$sqlup = "UPDATE dtb_member SET rank = ? WHERE member_id = ?";
$conn->query($sqlup, array($rank - 1, $id));
$conn->query($sqlup, array($rank, $down_id));
Documentation generated on Fri, 24 Feb 2012 13:59:11 +0900 by Seasoft
|