Changeset 16357


Ignore:
Timestamp:
2007/10/09 22:05:24 (17 years ago)
Author:
nanasess
Message:

クラス化対応

Location:
branches/feature-module-update
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/html/admin/order/mail.php

    r15532 r16357  
    55 * http://www.lockon.co.jp/ 
    66 */ 
    7 require_once("../require.php"); 
    87 
    9 class LC_Page { 
    10     function LC_Page() { 
    11         $this->tpl_mainpage = 'order/mail.tpl'; 
    12         $this->tpl_subnavi = 'order/subnavi.tpl'; 
    13         $this->tpl_mainno = 'order';         
    14         $this->tpl_subno = 'index'; 
    15         $this->tpl_subtitle = '受注管理'; 
    16         global $arrMAILTEMPLATE; 
    17         $this->arrMAILTEMPLATE = $arrMAILTEMPLATE; 
    18     } 
    19 } 
     8// {{{ requires 
     9require_once("../../require.php"); 
     10require_once(CLASS_EX_PATH . "page_extends/admin/order/LC_Page_Admin_Order_Mail_Ex.php"); 
    2011 
    21 $objPage = new LC_Page(); 
    22 $objView = new SC_AdminView(); 
    23 $objSess = new SC_Session(); 
    24 sfIsSuccess($objSess); 
     12// }}} 
     13// {{{ generate page 
    2514 
    26 // 検索パラメータの引き継ぎ 
    27 foreach ($_POST as $key => $val) { 
    28     if (ereg("^search_", $key)) { 
    29         $objPage->arrSearchHidden[$key] = $val;  
    30     } 
    31 } 
    32  
    33 $objPage->tpl_order_id = $_POST['order_id']; 
    34  
    35 // パラメータ管理クラス 
    36 $objFormParam = new SC_FormParam(); 
    37 // パラメータ情報の初期化 
    38 lfInitParam(); 
    39  
    40 switch($_POST['mode']) { 
    41 case 'pre_edit': 
    42     break; 
    43 case 'return': 
    44     // POST値の取得 
    45     $objFormParam->setParam($_POST); 
    46     break; 
    47 case 'send': 
    48     // POST値の取得 
    49     $objFormParam->setParam($_POST); 
    50     // 入力値の変換 
    51     $objFormParam->convParam(); 
    52     $objPage->arrErr = $objFormParam->checkerror(); 
    53     // メールの送信 
    54     if (count($objPage->arrErr) == 0) { 
    55         // 注文受付メール 
    56         sfSendOrderMail($_POST['order_id'], $_POST['template_id'], $_POST['subject'], $_POST['header'], $_POST['footer']); 
    57     } 
    58     header("Location: " . URL_SEARCH_ORDER); 
    59     exit; 
    60     break;   
    61 case 'confirm': 
    62     // POST値の取得 
    63     $objFormParam->setParam($_POST); 
    64     // 入力値の変換 
    65     $objFormParam->convParam(); 
    66     // 入力値の引き継ぎ 
    67     $objPage->arrHidden = $objFormParam->getHashArray(); 
    68     $objPage->arrErr = $objFormParam->checkerror(); 
    69     // メールの送信 
    70     if (count($objPage->arrErr) == 0) { 
    71         // 注文受付メール(送信なし) 
    72         $objSendMail = sfSendOrderMail($_POST['order_id'], $_POST['template_id'], $_POST['subject'], $_POST['header'], $_POST['footer'], false); 
    73         // 確認ページの表示 
    74         $objPage->tpl_subject = $objSendMail->subject; 
    75         $objPage->tpl_body = mb_convert_encoding( $objSendMail->body, "EUC-JP", "auto" );        
    76         $objPage->tpl_to = $objSendMail->tpl_to; 
    77         $objPage->tpl_mainpage = 'order/mail_confirm.tpl'; 
    78          
    79         $objView->assignobj($objPage); 
    80         $objView->display(MAIN_FRAME); 
    81          
    82         exit;    
    83     } 
    84     break; 
    85 case 'change': 
    86     // POST値の取得 
    87     $objFormParam->setValue('template_id', $_POST['template_id']); 
    88     if(sfIsInt($_POST['template_id'])) { 
    89         $objQuery = new SC_Query(); 
    90         $where = "template_id = ?"; 
    91         $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($_POST['template_id'])); 
    92         $objFormParam->setParam($arrRet[0]); 
    93     } 
    94     break; 
    95 } 
    96  
    97 $objQuery = new SC_Query(); 
    98 $col = "send_date, subject, template_id, send_id"; 
    99 $where = "order_id = ?"; 
    100 $objQuery->setorder("send_date DESC"); 
    101  
    102 if(sfIsInt($_POST['order_id'])) { 
    103     $objPage->arrMailHistory = $objQuery->select($col, "dtb_mail_history", $where, array($_POST['order_id'])); 
    104 } 
    105  
    106 $objPage->arrForm = $objFormParam->getFormParamList(); 
    107 $objView->assignobj($objPage); 
    108 $objView->display(MAIN_FRAME); 
    109 //----------------------------------------------------------------------------------------------------------------------------------- 
    110 /* パラメータ情報の初期化 */ 
    111 function lfInitParam() { 
    112     global $objFormParam; 
    113     $objFormParam->addParam("テンプレート", "template_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 
    114     $objFormParam->addParam("メールタイトル", "subject", STEXT_LEN, "KVa",  array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); 
    115     $objFormParam->addParam("ヘッダー", "header", LTEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); 
    116     $objFormParam->addParam("フッター", "footer", LTEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); 
    117 } 
     15$objPage = new LC_Page_Admin_Order_Mail_Ex(); 
     16$objPage->init(); 
     17$objPage->process(); 
     18register_shutdown_function(array($objPage, "destroy")); 
     19?> 
  • branches/feature-module-update/html/admin/order/mail_view.php

    r15532 r16357  
    55 * http://www.lockon.co.jp/ 
    66 */ 
    7 require_once("../require.php"); 
    87 
    9 class LC_Page { 
    10     function LC_Page() { 
    11         $this->tpl_mainpage = 'order/mail_view.tpl'; 
    12     } 
    13 } 
     8// {{{ requires 
     9require_once("../../require.php"); 
     10require_once(CLASS_EX_PATH . "page_extends/admin/order/LC_Page_Admin_Order_MailView_Ex.php"); 
    1411 
    15 $objPage = new LC_Page(); 
    16 $objView = new SC_AdminView(); 
    17 $objSess = new SC_Session(); 
     12// }}} 
     13// {{{ generate page 
    1814 
    19 // 認証可否の判定 
    20 sfIsSuccess($objSess); 
    21  
    22 if(sfIsInt($_GET['send_id'])) { 
    23     $objQuery = new SC_Query(); 
    24     $col = "subject, mail_body"; 
    25     $where = "send_id = ?"; 
    26     $arrRet = $objQuery->select($col, "dtb_mail_history", $where, array($_GET['send_id'])); 
    27     $objPage->tpl_subject = $arrRet[0]['subject']; 
    28     $objPage->tpl_body = $arrRet[0]['mail_body']; 
    29 } 
    30  
    31 $objView->assignobj($objPage); 
    32 $objView->display($objPage->tpl_mainpage); 
    33 //----------------------------------------------------------------------------------------------------------------------------------- 
     15$objPage = new LC_Page_Admin_Order_MailView_Ex(); 
     16$objPage->init(); 
     17$objPage->process(); 
     18register_shutdown_function(array($objPage, "destroy")); 
     19?> 
Note: See TracChangeset for help on using the changeset viewer.