source: temp/trunk/html/admin/order/status.php @ 1328

Revision 1328, 3.2 KB checked in by naka, 20 years ago (diff)

* empty log message *

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