source: branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_History.php @ 18820

Revision 18820, 4.0 KB checked in by nanasess, 14 years ago (diff)

#781(規格のデータベースを木構造に)

  • 規格の無い商品が品切れになってしまう不具合修正
  • Property svn:eol-style set to LF
  • Property svn:keywords set to "Id Revision Date"
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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
25require_once(CLASS_PATH . "pages/LC_Page.php");
26
27/**
28 * メール配信履歴 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Admin_Mail_History extends LC_Page {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $this->tpl_mainpage = 'mail/history.tpl';
47        $this->tpl_mainno = 'mail';
48        $this->tpl_subnavi = 'mail/subnavi.tpl';
49        $this->tpl_subno = "history";
50        $this->tpl_subtitle = '配信履歴';
51
52    }
53
54    /**
55     * Page のプロセス.
56     *
57     * @return void
58     */
59    function process() {
60        // ページ初期設定
61        $objQuery = new SC_Query();
62        $objView = new SC_AdminView();
63        $objSess = new SC_Session();
64        $objDate = new SC_Date();
65
66        // 認証可否の判定
67        SC_Utils_Ex::sfIsSuccess($objSess);
68
69        if (!isset($_GET['send_id'])) $_GET['send_id'] = "";
70        if (!isset($_GET['mode'])) $_GET['mode'] = "";
71        if (!isset($_POST['search_pageno'])) $_POST['search_pageno'] = "";
72
73        // 削除時
74        if (SC_Utils_Ex::sfCheckNumLength($_GET['send_id']) && ($_GET['mode']=='delete')) {
75
76            $sql = "UPDATE dtb_send_history SET del_flg = 1 WHERE send_id = ?";
77            $objQuery->query($sql, array($_GET['send_id']) );
78            $_SERVER['QUERY_STRING'] = "";
79            $this->reload();
80        }
81        $from = "dtb_send_history";
82
83        $where = " del_flg = ?";
84        $arrval[] = "0";
85
86        // 行数の取得
87        $linemax = $objQuery->count($from, $where, $arrval);
88        $this->tpl_linemax = $linemax;              // 何件が該当しました。表示用
89
90        // ページ送りの取得
91        $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, SEARCH_PMAX, "fnNaviSearchPage", NAVI_PMAX);
92        $this->tpl_strnavi = $objNavi->strnavi;     // 表示文字列
93        $startno = $objNavi->start_row;
94
95        // 取得範囲の指定(開始行番号、行数のセット)
96        $objQuery->setLimitOffset(SEARCH_PMAX, $startno);
97
98        // 表示順序
99        $order = "start_date DESC, send_id DESC";
100        $objQuery->setOrder($order);
101
102        $col = "*";
103        $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id) AS count_all";
104        $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 1) AS count_sent";
105        $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 2) AS count_error";
106        $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag IS NULL) AS count_unsent";
107
108        // 検索結果の取得
109        $this->arrDataList = $objQuery->select($col, $from, $where, $arrval);
110
111        // ページ表示
112        $objView->assignobj($this);
113        $objView->display(MAIN_FRAME);
114    }
115
116    /**
117     * デストラクタ.
118     *
119     * @return void
120     */
121    function destroy() {
122        parent::destroy();
123    }
124}
125?>
Note: See TracBrowser for help on using the repository browser.