- Timestamp:
- 2010/05/05 20:11:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/admin/mail/LC_Page_Admin_Mail.php
r18630 r18631 66 66 $this->arrMagazineTypeAll = $masterData->getMasterData("mtb_magazine_type"); 67 67 68 // ----検索用項目配列68 // 検索用項目配列 69 69 $this->arrHtmlmail = array( "" => "両方", 1 => "HTML", 2 => "TEXT" ); 70 70 71 71 72 // ----配列内容専用項目の配列72 // 配列内容専用項目の配列 73 73 $this->arrRegistColumn = array( 74 74 array( "column" => "template_id", "convert" => "n" ), … … 83 83 ); 84 84 85 // ----メルマガ会員種別85 // メルマガ会員種別 86 86 $this->arrCustomerType = array(1 => "会員", 87 87 2 => "非会員", 88 // 3 => "CSV登録"88 // 3 => "CSV登録" 89 89 ); 90 90 91 // ----検索項目91 // 検索項目 92 92 $this->arrSearchColumn = array( 93 93 array( "column" => "name", "convert" => "aKV"), … … 149 149 function process() { 150 150 151 // ----ページ初期設定151 // ページ初期設定 152 152 $conn = new SC_DBConn(); 153 153 $objView = new SC_AdminView(); … … 221 221 case 'search': 222 222 case 'back': 223 // --入力値コンバート223 // 入力値コンバート 224 224 $this->list_data = $this->lfConvertParam($_POST, $this->arrSearchColumn); 225 225 226 // --入力エラーのチェック226 // 入力エラーのチェック 227 227 $this->arrErr = $this->lfErrorCheck($this->list_data); 228 228 229 // --検索開始229 // 検索開始 230 230 if (empty($this->arrErr)) { 231 231 $this->list_data['name'] = isset($this->list_data['name']) … … 234 234 $this->arrHidden = $this->lfGetHidden($this->list_data); 235 235 236 // --検索データ取得236 // 検索データ取得 237 237 $objSelect = new SC_CustomerList($this->list_data, "magazine"); 238 238 // 生成されたWHERE文を取得する … … 262 262 $col = $objSelect->getMailMagazineColumn($this->lfGetIsMobile($_POST['mail_type'])); 263 263 $this->arrResults = $objQuery->select($col, $from, $where, $arrval); 264 // 現在時刻の取得264 // 現在時刻の取得 265 265 $this->arrNowDate = $this->lfGetNowDate(); 266 266 } … … 270 270 */ 271 271 case 'input': 272 // --入力値コンバート272 // 入力値コンバート 273 273 $this->list_data = $this->lfConvertParam($_POST, $this->arrSearchColumn); 274 // --入力エラーのチェック274 // 入力エラーのチェック 275 275 $this->arrErr = $this->lfErrorCheck($this->list_data); 276 // --エラーなし276 // エラーなし 277 277 if (empty($this->arrErr)) { 278 // --現在時刻の取得278 // 現在時刻の取得 279 279 $this->arrNowDate = $this->lfGetNowDate(); 280 280 $this->arrHidden = $this->lfGetHidden($this->list_data); // hidden要素作成 … … 286 286 */ 287 287 case 'template': 288 // --入力値コンバート288 // 入力値コンバート 289 289 $this->list_data = $this->lfConvertParam($_POST, $this->arrSearchColumn); 290 290 291 // --時刻設定の取得291 // 時刻設定の取得 292 292 $this->arrNowDate['year'] = isset($_POST['send_year']) ? $_POST['send_year'] : ""; 293 293 $this->arrNowDate['month'] = isset($_POST['send_month']) ? $_POST['send_month'] : ""; … … 296 296 $this->arrNowDate['minutes'] = isset($_POST['send_minutes']) ? $_POST['send_minutes'] : ""; 297 297 298 // --入力エラーのチェック298 // 入力エラーのチェック 299 299 $this->arrErr = $this->lfErrorCheck($this->list_data); 300 300 301 // --検索開始301 // 検索開始 302 302 if (empty($this->arrErr)) { 303 303 $this->list_data['name'] = isset($this->list_data['name']) ? SC_Utils_Ex::sfManualEscape($this->list_data['name']) : ""; … … 312 312 } 313 313 314 // --HTMLテンプレートを使用する場合は、HTMLソースを生成してBODYへ挿入314 // HTMLテンプレートを使用する場合は、HTMLソースを生成してBODYへ挿入 315 315 if ( $this->list_data["mail_method"] == 3) { 316 316 $objTemplate = new LC_HTMLtemplate; … … 318 318 $objSiteInfo = new SC_SiteInfo(); 319 319 $objTemplate->arrInfo = $objSiteInfo->data; 320 // メール担当写真の表示320 // メール担当写真の表示 321 321 $objUpFile = new SC_UploadFile(IMAGE_TEMP_URL, IMAGE_SAVE_URL); 322 322 $objUpFile->addFile("メール担当写真", 'charge_image', array('jpg'), IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); … … 337 337 case 'regist_back': 338 338 case 'regist_complete': 339 // --入力値コンバート339 // 入力値コンバート 340 340 $this->arrCheckColumn = array_merge( $this->arrSearchColumn, $this->arrRegistColumn ); 341 341 $this->list_data = $this->lfConvertParam($_POST, $this->arrCheckColumn); 342 342 343 // 現在時刻の取得343 // 現在時刻の取得 344 344 $this->arrNowDate = $this->lfGetNowDate(); 345 345 346 // --入力エラーのチェック346 // 入力エラーのチェック 347 347 $this->arrErr = $this->lfErrorCheck($this->list_data, 1); 348 348 $this->tpl_mainpage = 'mail/input.tpl'; 349 349 $this->arrHidden = $this->lfGetHidden($this->list_data); // hidden要素作成 350 350 351 // --検索開始351 // 検索開始 352 352 if (empty($this->arrErr)) { 353 353 $this->list_data['name'] = … … 358 358 $this->tpl_mainpage = 'mail/input_confirm.tpl'; 359 359 } 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')); 364 364 } 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))); 366 366 } 367 367 exit; … … 389 389 $this->arrCampaignList = $this->lfGetCampaignList($objQuery); 390 390 391 // ----ページ表示391 // ページ表示 392 392 $objView->assignobj($this); 393 393 $objView->display(MAIN_FRAME); … … 421 421 } 422 422 423 // 現在時刻の取得(配信時間デフォルト値)423 // 現在時刻の取得(配信時間デフォルト値) 424 424 function lfGetNowDate(){ 425 425 $nowdate = date("Y/n/j/G/i"); … … 451 451 } 452 452 453 // 配信内容と配信リストを書き込む 453 /** 454 * 配信内容と配信リストを書き込む 455 * 456 * @return string 登録した行の dtb_send_history.send_id の値 457 */ 454 458 function lfRegistData(&$conn, $arrData){ 455 459 … … 461 465 462 466 $dtb_send_history = array(); 463 if(DB_TYPE=='pgsql'){464 $dtb_send_history["send_id"] = $objQuery->nextval('dtb_send_history', 'send_id');465 }466 467 $dtb_send_history["mail_method"] = $arrData['mail_method']; 467 468 $dtb_send_history["subject"] = $arrData['subject']; … … 479 480 $dtb_send_history["create_date"] = "now()"; 480 481 $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 484 485 if ( is_array( $search_data ) ){ 485 486 foreach( $search_data as $line ){ 486 487 $dtb_send_customer = array(); 487 488 $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; 489 490 $dtb_send_customer["email"] = $line["email"]; 490 491 491 $dtb_send_customer["name"] = $line["name01"] . " " . $line["name02"]; 492 493 492 $conn->autoExecute("dtb_send_customer", $dtb_send_customer ); 494 493 } 495 494 } 495 496 return $sendId; 496 497 } 497 498 … … 528 529 529 530 530 // ----HTMLテンプレートを使用する場合、データを取得する。531 // HTMLテンプレートを使用する場合、データを取得する。 531 532 function lfGetHtmlTemplateData($id) { 532 533 … … 559 560 $result = $conn->getAll($sql, array($list_data["sub_product_id" .$j])); 560 561 $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つ以上存在するフラグ 562 563 } 563 564 $l ++; … … 566 567 } 567 568 568 // ---テンプレートの種類を返す569 // テンプレートの種類を返す 569 570 function lfGetTemplateMethod($conn, $templata_id){ 570 571 … … 574 575 } 575 576 576 // ---hidden要素出力用配列の作成577 // hidden要素出力用配列の作成 577 578 function lfGetHidden( $array ){ 578 579 if ( is_array($array) ){ … … 590 591 } 591 592 592 // ----取得文字列の変換593 // 取得文字列の変換 593 594 function lfConvertParam($array, $arrSearchColumn) { 594 595 … … 612 613 613 614 614 // ----入力エラーチェック615 // 入力エラーチェック 615 616 function lfErrorCheck($array, $flag = '') { 616 617 … … 658 659 $objErr->doFunc(array("キャンペーン", "campaign_id", INT_LEN), array("NUM_CHECK")); 659 660 660 // 購入金額(from) > 購入金額(to) の場合はエラーとする661 // 購入金額(from) > 購入金額(to) の場合はエラーとする 661 662 if ( (is_numeric($array["buy_total_from"]) && is_numeric($array["buy_total_to"]) ) && 662 663 ($array["buy_total_from"] > $array["buy_total_to"]) ) { … … 689 690 $sql = "SELECT template_id, subject, mail_method FROM dtb_mailmaga_template WHERE del_flg = 0 "; 690 691 if ($_POST["htmlmail"] == 2 || $_POST['mail_type'] == 2) { 691 $sql .= " AND mail_method = 2 "; // TEXT希望者へのTESTメールテンプレートリスト692 $sql .= " AND mail_method = 2 "; // TEXT希望者へのTESTメールテンプレートリスト 692 693 } 693 694 $sql .= " ORDER BY template_id DESC";
Note: See TracChangeset
for help on using the changeset viewer.