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

Revision 19803, 4.1 KB checked in by Seasoft, 13 years ago (diff)

#834(パラメータの定数名に「URL」を含むにもかかわらず、パスのみのものがある)

  • 一斉置換前の現状記録のためのコミット

#628(未使用処理・定義などの削除)

  • 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_FILE_PATH . "pages/admin/LC_Page_Admin.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_Admin {
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        $this->action();
61        $this->sendResponse();
62    }
63
64    /**
65     * Page のアクション.
66     *
67     * @return void
68     */
69    function action() {
70        // ページ初期設定
71        $objQuery = new SC_Query();
72        $objSess = new SC_Session();
73        $objDate = new SC_Date();
74
75        // 認証可否の判定
76        SC_Utils_Ex::sfIsSuccess($objSess);
77
78        if (!isset($_GET['send_id'])) $_GET['send_id'] = "";
79        if (!isset($_GET['mode'])) $_GET['mode'] = "";
80        if (!isset($_POST['search_pageno'])) $_POST['search_pageno'] = "";
81
82        // 削除時
83        if (SC_Utils_Ex::sfCheckNumLength($_GET['send_id']) && ($_GET['mode']=='delete')) {
84
85            $sql = "UPDATE dtb_send_history SET del_flg = 1 WHERE send_id = ?";
86            $objQuery->query($sql, array($_GET['send_id']) );
87            $_SERVER['QUERY_STRING'] = "";
88            $this->objDisplay->reload();
89        }
90        $from = "dtb_send_history";
91
92        $where = " del_flg = ?";
93        $arrval[] = "0";
94
95        // 行数の取得
96        $linemax = $objQuery->count($from, $where, $arrval);
97        $this->tpl_linemax = $linemax;              // 何件が該当しました。表示用
98
99        // ページ送りの取得
100        $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, SEARCH_PMAX, "fnNaviSearchPage", NAVI_PMAX);
101        $this->tpl_strnavi = $objNavi->strnavi;     // 表示文字列
102        $startno = $objNavi->start_row;
103
104        // 取得範囲の指定(開始行番号、行数のセット)
105        $objQuery->setLimitOffset(SEARCH_PMAX, $startno);
106
107        // 表示順序
108        $order = "start_date DESC, send_id DESC";
109        $objQuery->setOrder($order);
110
111        $col = "*";
112        $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id) AS count_all";
113        $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";
114        $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";
115        $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";
116
117        // 検索結果の取得
118        $this->arrDataList = $objQuery->select($col, $from, $where, $arrval);
119    }
120
121    /**
122     * デストラクタ.
123     *
124     * @return void
125     */
126    function destroy() {
127        parent::destroy();
128    }
129}
130?>
Note: See TracBrowser for help on using the repository browser.