source: branches/feature-module-update/data/class/pages/admin/mail/LC_Page_Admin_Mail_Template.php @ 15648

Revision 15648, 2.3 KB checked in by nanasess, 17 years ago (diff)
  • メンバ変数修正
  • untabfy
  • Property svn:keywords set to "Id Revision Date"
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8// {{{ requires
9require_once(CLASS_PATH . "pages/LC_Page.php");
10
11/**
12 * メールテンプレート設定 のページクラス.
13 *
14 * @package Page
15 * @author LOCKON CO.,LTD.
16 * @version $Id$
17 */
18class LC_Page_Admin_Mail_Template extends LC_Page {
19
20    // }}}
21    // {{{ functions
22
23    /**
24     * Page を初期化する.
25     *
26     * @return void
27     */
28    function init() {
29        parent::init();
30        $this->tpl_mainpage = 'mail/template.tpl';
31        $this->tpl_mainno = 'mail';
32        $this->tpl_subnavi = 'mail/subnavi.tpl';
33        $this->tpl_subno = "template";
34        $this->tpl_subtitle = 'テンプレート設定';
35
36        $masterData = new SC_DB_MasterData_Ex();
37        $this->arrMagazineType = $masterData->getMasterData("mtb_magazine_type");
38    }
39
40    /**
41     * Page のプロセス.
42     *
43     * @return void
44     */
45    function process() {
46        $conn = new SC_DBConn();
47        $objView = new SC_AdminView();
48        $objSess = new SC_Session();
49
50        // 認証可否の判定
51        SC_Utils_Ex::sfIsSuccess($objSess);
52
53        if (!isset($_GET['mode'])) $_GET['mode'] = "";
54        if (!isset($_GET['id'])) $_GET['id'] = "";
55
56        if ( $_GET['mode'] == "delete" && SC_Utils_Ex::sfCheckNumLength($_GET['id'])===true ){
57
58            // メール担当の画像があれば削除しておく
59            $sql = "SELECT charge_image FROM dtb_mailmaga_template WHERE template_id = ?";
60            $result = $conn->getOne($sql, array($_GET["id"]));
61            if (strlen($result) > 0) {
62                @unlink(IMAGE_SAVE_DIR. $result);
63            }
64
65            // 登録削除
66            $sql = "UPDATE dtb_mailmaga_template SET del_flg = 1 WHERE template_id = ?";
67            $conn->query($sql, array($_GET['id']));
68            $this->reload();
69        }
70
71
72        $sql = "SELECT *, (substring(create_date, 1, 19)) as disp_date FROM dtb_mailmaga_template WHERE del_flg = 0 ORDER BY create_date DESC";
73        $this->list_data = $conn->getAll($sql);
74
75        $objView->assignobj($this);
76        $objView->display(MAIN_FRAME);
77    }
78
79    /**
80     * デストラクタ.
81     *
82     * @return void
83     */
84    function destroy() {
85        parent::destroy();
86    }
87}
88?>
Note: See TracBrowser for help on using the repository browser.