Source for file LC_Page_Admin_Mail_Template.php

Documentation is available at LC_Page_Admin_Mail_Template.php

  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) 2000-2007 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
  25. require_once(CLASS_PATH . "pages/LC_Page.php");
  26.  
  27. /**
  28.  * メールテンプレート設定 のページクラス.
  29.  *
  30.  * @package Page
  31.  * @author LOCKON CO.,LTD.
  32.  * @version $Id$
  33.  */
  34.  
  35.     // }}}
  36.     // {{{ functions
  37.  
  38.     /**
  39.      * Page を初期化する.
  40.      *
  41.      * @return void 
  42.      */
  43.     function init() {
  44.         parent::init();
  45.         $this->tpl_mainpage = 'mail/template.tpl';
  46.         $this->tpl_mainno = 'mail';
  47.         $this->tpl_subnavi = 'mail/subnavi.tpl';
  48.         $this->tpl_subno = "template";
  49.         $this->tpl_subtitle = 'テンプレート設定';
  50.  
  51.         $masterData = new SC_DB_MasterData_Ex();
  52.         $this->arrMagazineType = $masterData->getMasterData("mtb_magazine_type");
  53.     }
  54.  
  55.     /**
  56.      * Page のプロセス.
  57.      *
  58.      * @return void 
  59.      */
  60.     function process() {
  61.         $conn = new SC_DBConn();
  62.         $objView = new SC_AdminView();
  63.         $objSess = new SC_Session();
  64.  
  65.         // 認証可否の判定
  66.         SC_Utils_Ex::sfIsSuccess($objSess);
  67.  
  68.         if (!isset($_GET['mode'])) $_GET['mode'] = "";
  69.         if (!isset($_GET['id'])) $_GET['id'] = "";
  70.  
  71.         if ( $_GET['mode'] == "delete" && SC_Utils_Ex::sfCheckNumLength($_GET['id'])===true ){
  72.  
  73.             // メール担当の画像があれば削除しておく
  74.             $sql = "SELECT charge_image FROM dtb_mailmaga_template WHERE template_id = ?";
  75.             $result = $conn->getOne($sql, array($_GET["id"]));
  76.             if (strlen($result) > 0) {
  77.                 @unlink(IMAGE_SAVE_DIR. $result);
  78.             }
  79.  
  80.             // 登録削除
  81.             $sql = "UPDATE dtb_mailmaga_template SET del_flg = 1 WHERE template_id = ?";
  82.             $conn->query($sql, array($_GET['id']));
  83.  
  84.             $this->reload(null, true);
  85.         }
  86.  
  87.  
  88.         $sql = "SELECT *, create_date as disp_date FROM dtb_mailmaga_template WHERE del_flg = 0 ORDER BY create_date DESC";
  89.         $this->list_data = $conn->getAll($sql);
  90.         $this->list_data['disp_date'] = substr($this->list_data['disp_date'], 0, 19);
  91.  
  92.         $objView->assignobj($this);
  93.         $objView->display(MAIN_FRAME);
  94.     }
  95.  
  96.     /**
  97.      * デストラクタ.
  98.      *
  99.      * @return void 
  100.      */
  101.     function destroy() {
  102.         parent::destroy();
  103.     }
  104. }
  105. ?>

Documentation generated on Tue, 28 Apr 2009 18:11:18 +0900 by phpDocumentor 1.4.2