Ignore:
Timestamp:
2007/09/07 21:43:22 (17 years ago)
Author:
nanasess
Message:

クラス化に伴う修正

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

Legend:

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

    r15532 r15654  
    55 * http://www.lockon.co.jp/ 
    66 */ 
    7 require_once("../require.php"); 
    87 
    9 class LC_Page { 
    10     var $arrSession; 
    11     var $body; 
    12     var $list_data; 
     8// {{{ requires 
     9require_once("../../require.php"); 
     10require_once(CLASS_PATH . "page_extends/admin/mail/LC_Page_Admin_Mail_Preview_Ex.php"); 
    1311 
    14     function LC_Page() { 
    15         $this->tpl_mainpage = 'mail/preview.tpl'; 
    16     } 
    17 } 
     12// }}} 
     13// {{{ generate page 
    1814 
    19 //---- ページ初期設定 
    20 $conn = new SC_DBConn(); 
    21 $objPage = new LC_Page(); 
    22 $objView = new SC_AdminView(); 
    23 $objSess = new SC_Session(); 
    24 $objDate = new SC_Date(); 
    25  
    26 // 認証可否の判定 
    27 sfIsSuccess($objSess); 
    28  
    29  
    30 if ( $_POST['body'] ){ 
    31     $objPage->body = $_POST['body']; 
    32  
    33 // HTMLメールテンプレートのプレビュー 
    34 } elseif ($_REQUEST["method"] == "template" && sfCheckNumLength($_REQUEST['id'])) { 
    35  
    36     $sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ?"; 
    37     $result = $conn->getAll($sql, array($_REQUEST["id"])); 
    38     $objPage->list_data = $result[0]; 
    39      
    40     //メール担当写真の表示 
    41     $objUpFile = new SC_UploadFile(IMAGE_TEMP_URL, IMAGE_SAVE_URL); 
    42     $objUpFile->addFile("メール担当写真", 'charge_image', array('jpg'), IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
    43     $objUpFile->setDBFileList($objPage->list_data); 
    44     // Form用配列を渡す。 
    45     $objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL); 
    46      
    47     // メイン商品の情報取得 
    48     $sql = "SELECT name, main_image, point_rate, deliv_fee, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass AS allcls WHERE product_id = ?"; 
    49     $main = $conn->getAll($sql, array($objPage->list_data["main_product_id"])); 
    50     $objPage->list_data["main"] = $main[0]; 
    51  
    52     // サブ商品の情報取得 
    53     $sql = "SELECT product_id, name, main_list_image, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass WHERE product_id = ?"; 
    54     $k = 0; 
    55     $l = 0; 
    56     for ($i = 1; $i <= 12; $i ++) { 
    57         if ($l == 4) { 
    58             $l = 0; 
    59             $k ++; 
    60         } 
    61         $result = ""; 
    62         $j = sprintf("%02d", $i); 
    63         if ($i > 0 && $i < 5 ) $k = 0; 
    64         if ($i > 4 && $i < 9 ) $k = 1; 
    65         if ($i > 8 && $i < 13 ) $k = 2;  
    66          
    67         if (is_numeric($objPage->list_data["sub_product_id" .$j])) { 
    68             $result = $conn->getAll($sql, array($objPage->list_data["sub_product_id" .$j])); 
    69             $objPage->list_data["sub"][$k][$l] = $result[0]; 
    70             $objPage->list_data["sub"][$k]["data_exists"] = "OK";   //当該段にデータが1つ以上存在するフラグ 
    71         } 
    72         $l ++; 
    73     } 
    74     $objPage->tpl_mainpage = 'mail/html_template.tpl'; 
    75  
    76 } elseif ( sfCheckNumLength($_GET['send_id']) || sfCheckNumLength($_GET['id'])){ 
    77     if (is_numeric($_GET["send_id"])) { 
    78         $id = $_GET["send_id"]; 
    79         $sql = "SELECT body, mail_method FROM dtb_send_history WHERE send_id = ?"; 
    80     } else { 
    81         $sql = "SELECT body, mail_method FROM dtb_mailmaga_template WHERE template_id = ?"; 
    82         $id = $_GET['id']; 
    83     } 
    84     $result = $conn->getAll($sql, array($id)); 
    85      
    86      
    87     if ( $result ){ 
    88         if ( $result[0]["mail_method"] == 2 ){ 
    89             // テキスト形式の時はタグ文字をエスケープ 
    90             $objPage->escape_flag = 1; 
    91         } 
    92         $objPage->body = $result[0]["body"]; 
    93     } 
    94  
    95 } 
    96      
    97 $objView->assignobj($objPage); 
    98 $objView->display($objPage->tpl_mainpage); 
    99  
     15$objPage = new LC_Page_Admin_Mail_Preview_Ex(); 
     16$objPage->init(); 
     17$objPage->process(); 
     18register_shutdown_function(array($objPage, "destroy")); 
    10019?> 
Note: See TracChangeset for help on using the changeset viewer.