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

Source for file LC_Page_Admin_Order_Status.php

Documentation is available at LC_Page_Admin_Order_Status.php

  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.  
  35.     // }}}
  36.     // {{{ functions
  37.  
  38.     /**
  39.      * Page を初期化する.
  40.      *
  41.      * @return void 
  42.      */
  43.     function init({
  44.         parent::init();
  45.         $this->tpl_mainpage = 'order/status.tpl';
  46.         $this->tpl_subnavi 'order/subnavi.tpl';
  47.         $this->tpl_mainno = 'order';
  48.         $this->tpl_subno 'status';
  49.  
  50.         $masterData new SC_DB_MasterData_Ex();
  51.         $this->arrORDERSTATUS $masterData->getMasterData("mtb_order_status");
  52.         $this->arrORDERSTATUS_COLOR $masterData->getMasterData("mtb_order_status_color");
  53.     }
  54.  
  55.     /**
  56.      * Page のプロセス.
  57.      *
  58.      * @return void 
  59.      */
  60.     function process({
  61.         $objView new SC_AdminView();
  62.         $objSess new SC_Session();
  63.         $objDb new SC_Helper_DB_Ex();
  64.         $objQuery new SC_Query();
  65.  
  66.         // 認証可否の判定
  67.         $objSess new SC_Session();
  68.         SC_Utils_Ex::sfIsSuccess($objSess);
  69.  
  70.         $this->arrForm $_POST;
  71.  
  72.         //支払方法の取得
  73.         $this->arrPayment $objDb->sfGetIDValueList("dtb_payment""payment_id""payment_method");
  74.  
  75.         if (!isset($_POST['mode'])) $_POST['mode'"";
  76.         if (!isset($_POST['search_pageno'])) $_POST['search_pageno'1;
  77.  
  78.         switch ($_POST['mode']){
  79.  
  80.         case 'update':
  81.             if (!isset($_POST['change_status'])) $_POST['change_status'"";
  82.             if ($_POST['change_status'== 'delete'{
  83.                 $this->lfStatusMove("delete",$_POST['move']);
  84.             elseif (!empty($_POST['change_status'])) {
  85.                 $this->lfStatusMove($_POST['change_status']$_POST['move']);
  86.             }
  87.             //ステータス情報
  88.             $status = isset($_POST['status']$_POST['status'"";
  89.             break;
  90.  
  91.         case 'search':
  92.             //ステータス情報
  93.             $status = isset($_POST['status']$_POST['status'"";
  94.             break;
  95.  
  96.         default:
  97.             //ステータス情報
  98.             //デフォルトで新規受付一覧表示
  99.             $status ORDER_NEW;
  100.             break;
  101.         }
  102.  
  103.         //ステータス情報
  104.         $this->SelectedStatus $status;
  105.         //検索結果の表示
  106.         $this->lfStatusDisp($status$_POST['search_pageno']);
  107.  
  108.         $objView->assignobj($this);
  109.         $objView->display(MAIN_FRAME);
  110.     }
  111.     /**
  112.      * デストラクタ.
  113.      *
  114.      * @return void 
  115.      */
  116.     function destroy({
  117.         parent::destroy();
  118.     }
  119.  
  120.     //ステータス一覧の表示
  121.     function lfStatusDisp($status,$pageno){
  122.         $objQuery new SC_Query();
  123.  
  124.         $select ="*";
  125.         $from "dtb_order";
  126.         $where "del_flg = 0 AND status = ?";
  127.         $arrval[$status;
  128.         $order "order_id DESC";
  129.  
  130.         $linemax $objQuery->count($from$where$arrval);
  131.         $this->tpl_linemax $linemax;
  132.  
  133.         // ページ送りの処理
  134.         $page_max ORDER_STATUS_MAX;
  135.  
  136.         // ページ送りの取得
  137.         $objNavi new SC_PageNavi($pageno$linemax$page_max"fnNaviSearchOnlyPage"NAVI_PMAX);
  138.         $this->tpl_strnavi $objNavi->strnavi;      // 表示文字列
  139.         $startno $objNavi->start_row;
  140.  
  141.         $this->tpl_pageno $pageno;
  142.  
  143.         // 取得範囲の指定(開始行番号、行数のセット)
  144.         $objQuery->setLimitOffset($page_max$startno);
  145.  
  146.         //表示順序
  147.         $objQuery->setOrder($order);
  148.  
  149.         //検索結果の取得
  150.         $this->arrStatus $objQuery->select($select$from$where$arrval);
  151.     }
  152.  
  153.     //ステータス情報の更新(削除)
  154.     function lfStatusMove($status_id$arrMove){
  155.         $objQuery new SC_Query();
  156.         $masterData new SC_DB_MasterData_Ex();
  157.         $arrORDERSTATUS $masterData->getMasterData("mtb_order_status");
  158.  
  159.         $table 'dtb_order';
  160.         $where 'order_id = ?';
  161.         $arrUpdate array('update_date' => 'NOW()');
  162.  
  163.         $delflg  '1'// 削除フラグ
  164.         $message '';  // ステータス変更後にポップアップするメッセージの内容
  165.  
  166.         if $status_id == 'delete' {
  167.             $arrUpdate['del_flg'$delflg;
  168.             $message '削除';
  169.         }
  170.         // ステータスが発送済みの時は発送日を更新
  171.         elseif $status_id == ORDER_DELIV {
  172.             $arrUpdate['status'$status_id;
  173.             $arrUpdate['commit_date''NOW()';
  174.             $message $arrORDERSTATUS[$status_id'へ移動';
  175.         }
  176.         else {
  177.             $arrUpdate['status'$status_id;
  178.             $message $arrORDERSTATUS[$status_id'へ移動';
  179.         }
  180.  
  181.         if isset($arrMove) ){
  182.             foreach $arrMove as $val ){
  183.                 if $val != "" {
  184.                     $objQuery->update($table$arrUpdate$wherearray($val));
  185.                 }
  186.  
  187.             }
  188.         }
  189.  
  190.         $this->tpl_onload = "window.alert('選択項目を" $message "しました。');";
  191.     }
  192. }
  193. ?>

Documentation generated on Fri, 24 Feb 2012 13:58:56 +0900 by Seasoft