Ignore:
Timestamp:
2010/05/05 20:11:17 (14 years ago)
Author:
Seasoft
Message:

#698(メルマガ配信に誤りがある) 改修

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/admin/mail/LC_Page_Admin_Mail.php

    r18630 r18631  
    6666        $this->arrMagazineTypeAll = $masterData->getMasterData("mtb_magazine_type"); 
    6767 
    68         //---- 検索用項目配列 
     68        // 検索用項目配列 
    6969        $this->arrHtmlmail = array( "" => "両方",  1 => "HTML", 2 => "TEXT" ); 
    7070 
    7171 
    72         //---- 配列内容専用項目の配列 
     72        // 配列内容専用項目の配列 
    7373        $this->arrRegistColumn = array( 
    7474              array(  "column" => "template_id",    "convert" => "n" ), 
     
    8383              ); 
    8484 
    85         //---- メルマガ会員種別 
     85        // メルマガ会員種別 
    8686        $this->arrCustomerType = array(1 => "会員", 
    8787                                       2 => "非会員", 
    88                                        //3 => "CSV登録" 
     88                                       // 3 => "CSV登録" 
    8989                                       ); 
    9090 
    91         //---- 検索項目 
     91        // 検索項目 
    9292        $this->arrSearchColumn = array( 
    9393             array(  "column" => "name",                "convert" => "aKV"), 
     
    149149    function process() { 
    150150 
    151         //---- ページ初期設定 
     151        // ページ初期設定 
    152152        $conn = new SC_DBConn(); 
    153153        $objView = new SC_AdminView(); 
     
    221221        case 'search': 
    222222        case 'back': 
    223             //-- 入力値コンバート 
     223            // 入力値コンバート 
    224224            $this->list_data = $this->lfConvertParam($_POST, $this->arrSearchColumn); 
    225225 
    226             //-- 入力エラーのチェック 
     226            // 入力エラーのチェック 
    227227            $this->arrErr = $this->lfErrorCheck($this->list_data); 
    228228 
    229             //-- 検索開始 
     229            // 検索開始 
    230230            if (empty($this->arrErr)) { 
    231231                $this->list_data['name'] = isset($this->list_data['name']) 
     
    234234                $this->arrHidden = $this->lfGetHidden($this->list_data); 
    235235 
    236                 //-- 検索データ取得 
     236                // 検索データ取得 
    237237                $objSelect = new SC_CustomerList($this->list_data, "magazine"); 
    238238                // 生成されたWHERE文を取得する 
     
    262262                $col = $objSelect->getMailMagazineColumn($this->lfGetIsMobile($_POST['mail_type'])); 
    263263                $this->arrResults = $objQuery->select($col, $from, $where, $arrval); 
    264                 //現在時刻の取得 
     264                // 現在時刻の取得 
    265265                $this->arrNowDate = $this->lfGetNowDate(); 
    266266            } 
     
    270270            */ 
    271271        case 'input': 
    272             //-- 入力値コンバート 
     272            // 入力値コンバート 
    273273            $this->list_data = $this->lfConvertParam($_POST, $this->arrSearchColumn); 
    274             //-- 入力エラーのチェック 
     274            // 入力エラーのチェック 
    275275            $this->arrErr = $this->lfErrorCheck($this->list_data); 
    276             //-- エラーなし 
     276            // エラーなし 
    277277            if (empty($this->arrErr)) { 
    278                 //-- 現在時刻の取得 
     278                // 現在時刻の取得 
    279279                $this->arrNowDate = $this->lfGetNowDate(); 
    280280                $this->arrHidden = $this->lfGetHidden($this->list_data); // hidden要素作成 
     
    286286            */ 
    287287        case 'template': 
    288             //-- 入力値コンバート 
     288            // 入力値コンバート 
    289289            $this->list_data = $this->lfConvertParam($_POST, $this->arrSearchColumn); 
    290290 
    291             //-- 時刻設定の取得 
     291            // 時刻設定の取得 
    292292            $this->arrNowDate['year'] = isset($_POST['send_year']) ? $_POST['send_year'] : ""; 
    293293            $this->arrNowDate['month'] = isset($_POST['send_month']) ? $_POST['send_month'] : ""; 
     
    296296            $this->arrNowDate['minutes'] = isset($_POST['send_minutes']) ? $_POST['send_minutes'] : ""; 
    297297 
    298             //-- 入力エラーのチェック 
     298            // 入力エラーのチェック 
    299299            $this->arrErr = $this->lfErrorCheck($this->list_data); 
    300300 
    301             //-- 検索開始 
     301            // 検索開始 
    302302            if (empty($this->arrErr)) { 
    303303                $this->list_data['name'] = isset($this->list_data['name']) ? SC_Utils_Ex::sfManualEscape($this->list_data['name']) : ""; 
     
    312312                } 
    313313 
    314                 //-- HTMLテンプレートを使用する場合は、HTMLソースを生成してBODYへ挿入 
     314                // HTMLテンプレートを使用する場合は、HTMLソースを生成してBODYへ挿入 
    315315                if ( $this->list_data["mail_method"] == 3) { 
    316316                    $objTemplate = new LC_HTMLtemplate; 
     
    318318                    $objSiteInfo = new SC_SiteInfo(); 
    319319                    $objTemplate->arrInfo = $objSiteInfo->data; 
    320                     //メール担当写真の表示 
     320                    // メール担当写真の表示 
    321321                    $objUpFile = new SC_UploadFile(IMAGE_TEMP_URL, IMAGE_SAVE_URL); 
    322322                    $objUpFile->addFile("メール担当写真", 'charge_image', array('jpg'), IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
     
    337337        case 'regist_back': 
    338338        case 'regist_complete': 
    339             //-- 入力値コンバート 
     339            // 入力値コンバート 
    340340            $this->arrCheckColumn = array_merge( $this->arrSearchColumn, $this->arrRegistColumn ); 
    341341            $this->list_data = $this->lfConvertParam($_POST, $this->arrCheckColumn); 
    342342 
    343             //現在時刻の取得 
     343            // 現在時刻の取得 
    344344            $this->arrNowDate = $this->lfGetNowDate(); 
    345345 
    346             //-- 入力エラーのチェック 
     346            // 入力エラーのチェック 
    347347            $this->arrErr = $this->lfErrorCheck($this->list_data, 1); 
    348348            $this->tpl_mainpage = 'mail/input.tpl'; 
    349349            $this->arrHidden = $this->lfGetHidden($this->list_data); // hidden要素作成 
    350350 
    351             //-- 検索開始 
     351            // 検索開始 
    352352            if (empty($this->arrErr)) { 
    353353                $this->list_data['name'] = 
     
    358358                    $this->tpl_mainpage = 'mail/input_confirm.tpl'; 
    359359                } else if( $_POST['mode'] == 'regist_complete' ){ 
    360                     $this->lfRegistData($conn, $this->list_data); 
    361                     if(MELMAGA_SEND == true) { 
    362                         if(MELMAGA_BATCH_MODE) { 
    363                             $this->sendRedirect($this->getLocation(URL_DIR . "admin/mail/history.php")); 
     360                    $sendId = $this->lfRegistData($conn, $this->list_data); 
     361                    if (MELMAGA_SEND) { 
     362                        if (MELMAGA_BATCH_MODE) { 
     363                            $this->sendRedirect($this->getLocation(URL_DIR . 'admin/mail/history.php')); 
    364364                        } else { 
    365                             $this->sendRedirect($this->getLocation(URL_DIR . "admin/mail/sendmail.php", array("mode" => "now"))); 
     365                            $this->sendRedirect($this->getLocation(URL_DIR . 'admin/mail/sendmail.php', array('mode' => 'now', 'send_id' => $sendId))); 
    366366                        } 
    367367                        exit; 
     
    389389        $this->arrCampaignList = $this->lfGetCampaignList($objQuery); 
    390390 
    391         //---- ページ表示 
     391        // ページ表示 
    392392        $objView->assignobj($this); 
    393393        $objView->display(MAIN_FRAME); 
     
    421421    } 
    422422 
    423     //現在時刻の取得(配信時間デフォルト値) 
     423    // 現在時刻の取得(配信時間デフォルト値) 
    424424    function lfGetNowDate(){ 
    425425        $nowdate = date("Y/n/j/G/i"); 
     
    451451    } 
    452452 
    453     // 配信内容と配信リストを書き込む 
     453    /** 
     454     * 配信内容と配信リストを書き込む 
     455     * 
     456     * @return string 登録した行の dtb_send_history.send_id の値 
     457     */ 
    454458    function lfRegistData(&$conn, $arrData){ 
    455459 
     
    461465 
    462466        $dtb_send_history = array(); 
    463         if(DB_TYPE=='pgsql'){ 
    464             $dtb_send_history["send_id"] = $objQuery->nextval('dtb_send_history', 'send_id'); 
    465         } 
    466467        $dtb_send_history["mail_method"] = $arrData['mail_method']; 
    467468        $dtb_send_history["subject"] = $arrData['subject']; 
     
    479480        $dtb_send_history["create_date"] = "now()"; 
    480481        $objQuery->insert("dtb_send_history", $dtb_send_history ); 
    481         if(DB_TYPE == "mysql"){ 
    482             $dtb_send_history["send_id"] = $objQuery->nextval('dtb_send_history','send_id'); 
    483         } 
     482 
     483        $sendId = $objQuery->currval('dtb_send_history', 'send_id'); 
     484 
    484485        if ( is_array( $search_data ) ){ 
    485486            foreach( $search_data as $line ){ 
    486487                $dtb_send_customer = array(); 
    487488                $dtb_send_customer["customer_id"] = $line["customer_id"]; 
    488                 $dtb_send_customer["send_id"] = $dtb_send_history["send_id"]; 
     489                $dtb_send_customer["send_id"] = $sendId; 
    489490                $dtb_send_customer["email"] = $line["email"]; 
    490  
    491491                $dtb_send_customer["name"] = $line["name01"] . " " . $line["name02"]; 
    492  
    493492                $conn->autoExecute("dtb_send_customer", $dtb_send_customer ); 
    494493            } 
    495494        } 
     495 
     496        return $sendId; 
    496497    } 
    497498 
     
    528529 
    529530 
    530     //---- HTMLテンプレートを使用する場合、データを取得する。 
     531    // HTMLテンプレートを使用する場合、データを取得する。 
    531532    function lfGetHtmlTemplateData($id) { 
    532533 
     
    559560                $result = $conn->getAll($sql, array($list_data["sub_product_id" .$j])); 
    560561                $list_data["sub"][$k][$l] = $result[0]; 
    561                 $list_data["sub"][$k]["data_exists"] = "OK";    //当該段にデータが1つ以上存在するフラグ 
     562                $list_data["sub"][$k]["data_exists"] = "OK";    // 当該段にデータが1つ以上存在するフラグ 
    562563            } 
    563564            $l ++; 
     
    566567    } 
    567568 
    568     //---  テンプレートの種類を返す 
     569    // テンプレートの種類を返す 
    569570    function lfGetTemplateMethod($conn, $templata_id){ 
    570571 
     
    574575    } 
    575576 
    576     //---  hidden要素出力用配列の作成 
     577    // hidden要素出力用配列の作成 
    577578    function lfGetHidden( $array ){ 
    578579        if ( is_array($array) ){ 
     
    590591    } 
    591592 
    592     //---- 取得文字列の変換 
     593    // 取得文字列の変換 
    593594    function lfConvertParam($array, $arrSearchColumn) { 
    594595 
     
    612613 
    613614 
    614     //---- 入力エラーチェック 
     615    // 入力エラーチェック 
    615616    function lfErrorCheck($array, $flag = '') { 
    616617 
     
    658659        $objErr->doFunc(array("キャンペーン", "campaign_id", INT_LEN), array("NUM_CHECK")); 
    659660 
    660         //購入金額(from) > 購入金額(to) の場合はエラーとする 
     661        // 購入金額(from) > 購入金額(to) の場合はエラーとする 
    661662        if ( (is_numeric($array["buy_total_from"]) && is_numeric($array["buy_total_to"]) ) && 
    662663             ($array["buy_total_from"] > $array["buy_total_to"]) ) { 
     
    689690        $sql = "SELECT template_id, subject, mail_method FROM dtb_mailmaga_template WHERE del_flg = 0 "; 
    690691        if ($_POST["htmlmail"] == 2 || $_POST['mail_type'] == 2) { 
    691             $sql .= " AND mail_method = 2 ";    //TEXT希望者へのTESTメールテンプレートリスト 
     692            $sql .= " AND mail_method = 2 ";    // TEXT希望者へのTESTメールテンプレートリスト 
    692693        } 
    693694        $sql .= " ORDER BY template_id DESC"; 
Note: See TracChangeset for help on using the changeset viewer.