source: branches/beta/html/admin/order/status.php @ 16805

Revision 16805, 4.4 KB checked in by satou, 15 years ago (diff)

#141
修正完了

Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7require_once("../require.php");
8require_once("./index_csv.php");
9
10//¥¹¥Æ¡¼¥¿¥¹´ÉÍý-°ì³ç°ÜÆ°µ¡Ç½
11
12class LC_Page {
13    function LC_Page() {
14        $this->tpl_mainpage = 'order/status.tpl';
15        $this->tpl_subnavi = 'order/subnavi.tpl';
16        $this->tpl_mainno = 'order';
17        $this->tpl_subno = 'status';
18        global $arrORDERSTATUS;
19        global $arrORDERSTATUS_COLOR;
20        $this->arrORDERSTATUS = $arrORDERSTATUS;
21        $this->arrORDERSTATUS_COLOR = $arrORDERSTATUS_COLOR;
22       
23    }
24}
25
26$objPage = new LC_Page();
27$objView = new SC_AdminView();
28$objSess = new SC_Session();
29$objQuery = new SC_Query();
30
31// ǧ¾Ú²ÄÈݤÎȽÄê
32$objSess = new SC_Session();
33sfIsSuccess($objSess);
34
35//¥¹¥Æ¡¼¥¿¥¹¾ðÊó¡Ê²¾Äê¡Ë
36$objPage->arrForm = $_POST;
37
38//»ÙʧÊýË¡¤Î¼èÆÀ
39$objPage->arrPayment = sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
40
41switch ($_POST['mode']){
42case 'search':
43    switch($_POST['change_status']){
44    //¿·µ¬¼õÉÕ
45    case ORDER_NEW:
46        lfStatusMove(ORDER_NEW, $_POST['move']);
47        break;
48   
49    //Æþ¶âÂÔ¤Á
50    case ORDER_PAY_WAIT:
51        lfStatusMove(ORDER_PAY_WAIT, $_POST['move']);
52        break;
53   
54    //¥­¥ã¥ó¥»¥ë
55    case ORDER_CANCEL:
56        lfStatusMove(ORDER_CANCEL, $_POST['move']);
57        break;
58   
59    //¼è¤ê´ó¤»Ãæ
60    case ORDER_BACK_ORDER:
61        lfStatusMove(ORDER_BACK_ORDER, $_POST['move']);
62        break;
63   
64    //ȯÁ÷ºÑ¤ß
65    case ORDER_DELIV:
66        lfStatusMove(ORDER_DELIV, $_POST['move']);
67        break;
68   
69    //Æþ¶âºÑ¤ß
70    case ORDER_PRE_END:
71        lfStatusMove(ORDER_PRE_END, $_POST['move']);
72        break;
73   
74    //ºï½ü
75    case 'delete':
76        lfStatusMove("delete", $_POST['move']);
77        break;
78   
79    default:
80        break;
81    }
82   
83    //¸¡º÷·ë²Ì¤Îɽ¼¨
84    lfStatusDisp($_POST['status'], $_POST['search_pageno']);
85    $objPage->SelectedStatus = $_POST['status'];
86    break;
87   
88//¥Ç¥Õ¥©¥ë¥È¤Ç¿·µ¬¼õÉÕ°ìÍ÷ɽ¼¨
89default:
90    lfStatusDisp(ORDER_NEW, $_POST['search_pageno']);
91    $objPage->SelectedStatus = ORDER_NEW;
92    break;
93}
94
95$objView->assignobj($objPage);
96$objView->display(MAIN_FRAME);
97
98//-----------------------------------------------------------------------------------------------------------------------------------
99
100//¥¹¥Æ¡¼¥¿¥¹°ìÍ÷¤Îɽ¼¨
101function lfStatusDisp($status, $pageno){
102    global $objPage;
103    global $objQuery;
104   
105    $select ="*";
106    $from = "dtb_order";
107    $where="del_flg=0 AND status=?";
108    $order = "order_id DESC";
109   
110    $linemax = $objQuery->count("dtb_order", "del_flg = 0 AND status=?", array($status));
111    $objPage->tpl_linemax = $linemax;
112   
113    // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý
114    $page_max = ORDER_STATUS_MAX;
115   
116    // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ
117    $objNavi = new SC_PageNavi($pageno, $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
118    $objPage->tpl_strnavi = $objNavi->strnavi;      // ɽ¼¨Ê¸»úÎó
119    $startno = $objNavi->start_row;
120   
121    $objPage->tpl_pageno = $pageno;
122   
123    // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È)
124    $objQuery->setlimitoffset($page_max, $startno);
125   
126    //ɽ¼¨½ç½ø
127    $objQuery->setorder($order);
128   
129    //¸¡º÷·ë²Ì¤Î¼èÆÀ
130    $objPage->arrStatus = $objQuery->select($select, $from, $where, array($status));
131   
132    return $objPage;
133}
134
135//¥¹¥Æ¡¼¥¿¥¹¾ðÊó¤Î¹¹¿·¡Êºï½ü¡Ë
136function lfStatusMove($status_id, $arrMove){
137    global $objQuery;
138    global $objPage;
139    global $arrORDERSTATUS;
140   
141    $table = 'dtb_order';
142    $where = 'order_id = ?';
143    $arrUpdate = array('update_date' => 'NOW()');
144   
145    $delflg  = '1'; // ºï½ü¥Õ¥é¥°
146    $message = '';  // ¥¹¥Æ¡¼¥¿¥¹Êѹ¹¸å¤Ë¥Ý¥Ã¥×¥¢¥Ã¥×¤¹¤ë¥á¥Ã¥»¡¼¥¸¤ÎÆâÍÆ
147   
148    if ( $status_id == 'delete' ) {
149        $arrUpdate['del_flg'] = $delflg;
150        $message = 'ºï½ü';
151    }
152    // ¥¹¥Æ¡¼¥¿¥¹¤¬È¯Á÷ºÑ¤ß¤Î»þ¤ÏȯÁ÷Æü¤ò¹¹¿·
153    elseif ( $status_id == ORDER_DELIV ) {
154        $arrUpdate['status'] = $status_id;
155        $arrUpdate['commit_date'] = 'NOW()';
156        $message = $arrORDERSTATUS[$status_id] . '¤Ø°ÜÆ°';
157    }
158    else {
159        $arrUpdate['status'] = $status_id;
160        $message = $arrORDERSTATUS[$status_id] . '¤Ø°ÜÆ°';
161    }
162   
163    if ( isset($arrMove) ){
164        foreach ( $arrMove as $val ){
165            if ( $val != "" ) {
166                $objQuery->update($table, $arrUpdate, $where, array($val));
167            }
168           
169        }
170    }
171   
172    $objPage->tpl_onload = "window.alert('ÁªÂò¹àÌܤò" . $message . "¤·¤Þ¤·¤¿¡£');";
173}
174
175?>
Note: See TracBrowser for help on using the repository browser.