Index: anches/feature-module-update/html/admin/mail/htmlmail_select.php
===================================================================
--- /branches/feature-module-update/html/admin/mail/htmlmail_select.php	(revision 15532)
+++ 	(revision )
@@ -1,135 +1,0 @@
-<?php
-/*
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- */
-require_once("../require.php");
-
-class LC_Page {
-	
-	var $arrForm;
-	
-	function LC_Page() {
-		$this->tpl_mainpage = 'mail/htmlmail_select.tpl';
-		$this->tpl_mainno = 'mail';
-	}
-}
-
-$conn = new SC_DBConn();
-$objPage = new LC_Page();
-$objView = new SC_AdminView();
-$objSess = new SC_Session();
-
-// 認証可否の判定
-sfIsSuccess($objSess);
-
-if ($_POST['mode'] == "search") {
-	
-	// POST値の引き継ぎ
-	$objPage->arrForm = $_POST;
-	// 入力文字の強制変換
-	lfConvertParam();
-	
-	// 削除されていない。公開商品である。
-	$where = "del_flg = 0 AND status = 1";
-	
-	/* 入力エラーなし */
-	foreach ($objPage->arrForm as $key => $val) {
-		if($val == "") {
-			continue;
-		}
-		
-		switch ($key) {
-			case 'search_name':
-				$where .= " AND name ILIKE ?";
-				$arrval[] = "%$val%";
-				break;
-			case 'search_category_id':
-				// 子カテゴリIDの取得
-				$arrRet = sfGetChildsID("dtb_category", "parent_category_id", "category_id", $val);
-				$tmp_where = "";
-				foreach ($arrRet as $val) {
-					if($tmp_where == "") {
-						$tmp_where.= " AND ( category_id = ?";
-					} else {
-						$tmp_where.= " OR category_id = ?";
-					}
-					$arrval[] = $val;
-				}
-				$where.= $tmp_where . " )";
-				break;
-			case 'search_product_code':
-				$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)";
-				$where .= " OR product_code ILIKE ?";
-				$arrval[] = "%$val%";
-				$arrval[] = "%$val%";
-				break;
-			default:
-				break;
-		}
-	}
-	
-	$order = "update_date DESC";
-	
-	// 読み込む列とテーブルの指定
-	$col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
-	$from = "vw_products_nonclass AS noncls ";
-		
-	$objQuery = new SC_Query();
-	// 行数の取得
-	$linemax = $objQuery->count($from, $where, $arrval);
-	$objPage->tpl_linemax = $linemax;				// 何件が該当しました。表示用
-	
-	// ページ送りの処理
-	if(is_numeric($_POST['search_page_max'])) {	
-		$page_max = $_POST['search_page_max'];
-	} else {
-		$page_max = SEARCH_PMAX;
-	}
-	
-	// ページ送りの取得
-	$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
-	$objPage->tpl_strnavi = $objNavi->strnavi;		// 表示文字列
-	$startno = $objNavi->start_row;
-	
-	// 取得範囲の指定(開始行番号、行数のセット)
-	$objQuery->setlimitoffset($page_max, $startno);
-
-	// 表示順序
-	$objQuery->setorder($order);
-	// 検索結果の取得
-	$objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval);
-		
-}
-
-$objPage->arrCatList = sfGetCategoryList();
-$objPage->name = $_GET['name'];
-
-
-$objView->assignobj($objPage);
-$objView->display($objPage->tpl_mainpage);
-
-/* 取得文字列の変換 */
-function lfConvertParam() {
-	global $objPage;
-	/*
-	 *	文字列の変換
-	 *	K :  「半角(ﾊﾝｶｸ)片仮名」を「全角片仮名」に変換
-	 *	C :  「全角ひら仮名」を「全角かた仮名」に変換
-	 *	V :  濁点付きの文字を一文字に変換。"K","H"と共に使用します	
-	 *	n :  「全角」数字を「半角(ﾊﾝｶｸ)」に変換
-	 */
-	$arrConvList['search_name'] = "KVa";
-	$arrConvList['search_product_code'] = "KVa";
-	
-	// 文字変換
-	foreach ($arrConvList as $key => $val) {
-		// POSTされてきた値のみ変換する。
-		if(isset($objPage->arrForm[$key])) {
-			$objPage->arrForm[$key] = mb_convert_kana($objPage->arrForm[$key] ,$val);
-		}
-	}
-}
-
-?>
Index: anches/feature-module-update/html/admin/mail/htmlmail.php
===================================================================
--- /branches/feature-module-update/html/admin/mail/htmlmail.php	(revision 15532)
+++ 	(revision )
@@ -1,369 +1,0 @@
-<?php
-/*
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- */
-require_once("../require.php");
-
-class LC_Page {
-	
-	var $arrForm;
-	
-	var $arrTempProduct;
-	var $subProductNum;
-	var $arrFileName;
-	
-	
-	function LC_Page() {
-		$this->tpl_mainpage = 'mail/htmlmail.tpl';
-		$this->tpl_mainno = 'mail';
-		$this->tpl_subnavi = 'mail/subnavi.tpl';
-		$this->tpl_subno = "template";
-	}
-}
-
-
-class LC_Products{
-	
-	var $conn;
-	var $arrProduct;
-	var $arrProductKey;
-	
-	function LC_Products ($conn=""){
-		
-		$DB_class_name = "SC_DbConn";
-		if ( is_object($conn)){
-			if ( is_a($conn, $DB_class_name)){
-				// $connが$DB_class_nameのインスタンスである
-				$this->conn = $conn;
-			}
-		} else {
-			if (class_exists($DB_class_name)){
-				//$DB_class_nameのインスタンスを作成する
-				$this->conn = new SC_DbConn();			
-			}
-		}
-	}
-	
-	function setProduct($keyname, $id) {
-		
-		if ( sfCheckNumLength($id) ){
-			$result = $this->getProductData($id);
-		}
-		
-		if ( $result && (in_array($keyname, $this->arrProductKey) ) ){
-	
-			$this->arrProduct["${keyname}"] = $result;
-		}
-	}	
-	
-	function getProductData($id){
-		$conn = $this->conn;
-		// 商品情報を取得する
-		$sql = "SELECT * FROM dtb_products WHERE product_id = ?";
-		$result = $conn->getAll($sql, array($id));
-		if ( is_array($result) ){
-			$return = $result[0];
-		}
-		return $return;	
-	}
-
-	function getProductImageData($id){
-		$conn = $this->conn;
-		// 商品画像情報を取得する
-		$sql = "SELECT main_image FROM dtb_products WHERE product_id = ?";
-		$result = $conn->getAll($sql, array($id));
-		if ( is_array($result) ){
-			$return = $result[0]["main_image"];
-		}
-		return $return;	
-	}
-	function setHiddenList($arrPOST) {
-		foreach($this->arrProductKey as $val) {
-			$key = "temp_" . $val;
-			if($arrPOST[$key] != "") {
-				$this->setProduct($val, $arrPOST[$key]);
-			}
-		}
-	}
-}
-
-// 登録カラム
-$arrRegist = array(
-					  "subject", "charge_image", "mail_method", "header", "main_title", "main_comment", "main_product_id", "sub_title", "sub_comment"
-					, "sub_product_id01", "sub_product_id02", "sub_product_id03", "sub_product_id04", "sub_product_id05", "sub_product_id06", "sub_product_id07"
-					, "sub_product_id08", "sub_product_id09", "sub_product_id10", "sub_product_id11", "sub_product_id12"
-					);
-					
-// 既存の登録済み商品から画像表示を必要とする項目リスト					
-$arrFileList = array(
-						"main_product_id", "sub_product_id01", "sub_product_id02", "sub_product_id03", "sub_product_id04", "sub_product_id05"
-						, "sub_product_id06", "sub_product_id07", "sub_product_id08", "sub_product_id09", "sub_product_id10", "sub_product_id11", "sub_product_id12"
-					);
-
-$conn = new SC_DBConn();
-$objPage = new LC_Page();
-$objView = new SC_AdminView();
-$objSess = new SC_Session();
-$objQuery = new SC_Query();
-
-// 認証可否の判定
-sfIsSuccess($objSess);
-
-
-// 画像処理クラス設定
-$objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
-$objUpFile->addFile("メール担当写真", 'charge_image', array('jpg'),IMAGE_SIZE, true, HTMLMAIL_IMAGE_WIDTH, HTMLMAIL_IMAGE_HEIGHT);
-
-// POST値の引継ぎ&入力値の変換
-$objPage->arrForm = lfConvData($_POST);
-
-// Hiddenからのデータを引き継ぐ
-$objUpFile->setHiddenFileList($_POST);
-
-switch ($_POST['mode']){
-	
-	//画像アップロード
-	case 'upload_image':
-	// 画像保存処理
-	$objPage->arrErr[$_POST['image_key']] = $objUpFile->makeTempFile($_POST['image_key']);
-	break;
-	
-	//確認
-	case 'confirm':
-	
-	// エラーチェック
-	$objPage->arrErr = lfErrorCheck($objPage->arrForm);
-	//ファイル存在チェック
-	$objPage->arrErr = array_merge((array)$objPage->arrErr, (array)$objUpFile->checkEXISTS());
-		
-	//エラーなしの場合、確認ページへ
-	 if (!$objPage->arrErr){
-		// 	アップロードファイル情報配列を渡す。
-		$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL);
-		//削除要求のあった画像を表示しない
-		for($i = 1; $i <= HTML_TEMPLATE_SUB_MAX; $i++) {
-			if($_POST['delete_sub'.$i] == "1") {
-				$arrSub['delete'][$i] = "on";
-			}else{
-				$arrSub['delete'][$i] = "";
-			}
-		}
-		$objPage->arrSub = $arrSub;
-		$objPage->tpl_mainpage = 'mail/htmlmail_confirm.tpl';
-	 }
-	break;
-	
-	// 確認ページからの戻り
-	case 'return':
-	break;
-	
-	//　テンプレート登録
-	case 'complete':
-	// 入力値の変換
-	$objPage->arrForm = lfConvData($_POST);
-	$objPage->arrErr = lfErrorCheck($objPage->arrForm);	// 入力エラーチェック
-
-	// アップロード画像をセーブディレクトリに移行
-	$objUpFile->moveTempFile();
-
-	// DB登録
-	if (is_numeric($objPage->arrForm["template_id"])) {	//　編集時
-		lfUpdateData($arrRegist);
-	} else {
-		ifRegistData($arrRegist);
-	}
-	$objPage->tpl_mainpage = 'mail/htmlmail_complete.tpl';
-	break;
-}
-
-// 検索結果からの編集時
-if ($_GET["mode"] == "edit" && is_numeric($_GET["template_id"])) {
-	$objPage->edit_mode = "on";
-	//テンプレート情報読み込み
-	lfSetRegistData($_GET["template_id"]);
-	// DBデータから画像ファイル名の読込
-	$objUpFile->setDBFileList($objPage->arrForm);
-
-}
-
-if ($_GET['mode'] != 'edit'){
-//登録情報の読み込み
-$objPage->arrFileName = lfGetProducts();
-}
-
-// HIDDEN用に配列を渡す。
-$objPage->arrHidden = array_merge((array)$objPage->arrHidden, (array)$objUpFile->getHiddenFileList());
-// アップロードファイル情報配列を渡す。
-$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL);
-
-$objView->assignobj($objPage);
-$objView->display(MAIN_FRAME);
-
-//-------------------------------------------------------------------------------------------------------------------------
-
-/* 商品画像の読み込み */
-function lfGetProducts() {
-	global $objQuery;
-	
-	if ($_POST['main_product_id'] != ""){
-	$MainFile = $objQuery->select("main_image, name, product_id", "dtb_products", "product_id=?", array($_POST['main_product_id']));
-	$arrFileName[0] = $MainFile[0];
-	}
-	for($i = 1; $i <= HTML_TEMPLATE_SUB_MAX; $i++) {
-		$sub_keyname = "sub_product_id" . sprintf("%02d", $i);
-		if($_POST[$sub_keyname] != "") {
-			$arrSubFile = $objQuery->select("main_image, name, product_id", "dtb_products", "product_id = ?", array($_POST[$sub_keyname]));
-			$arrFileName[$i] = $arrSubFile[0];
-		}
-	}
-	return $arrFileName;
-}
-
-/* 登録済みデータ読み込み */
-function lfSetRegistData($template_id) {
-	global $objQuery;
-	global $objPage;
-	$arrRet = $objQuery->select("*", "dtb_mailmaga_template", "template_id=?", array($template_id));
-	$arrProductid = $arrRet[0];
-	//画像以外の情報取得
-	$objPage->arrForm = $arrRet[0];
-		if ($arrProductid['main_product_id'] != ""){
-			$MainFile = $objQuery->select("main_image, name, product_id", "dtb_products", "product_id=?", array($arrProductid['main_product_id']));
-			$arrFileName[0] = $MainFile[0];
-		}
-	for ($i=1; $i<=HTML_TEMPLATE_SUB_MAX; $i++){
-		if ($arrProductid['sub_product_id'.sprintf("%02d", $i)] != ""){
-			$arrSubFile = $objQuery->select("main_image, name, product_id", "dtb_products", "product_id=?", array($arrProductid['sub_product_id'.sprintf("%02d", $i)]));
-			$arrFileName[$i] = $arrSubFile[0];
-		}
-	}
-	//画像の情報取得
-	$objPage->arrFileName = $arrFileName;
-	
-	return $objPage;
-}
-
-// 編集データ取得
-function lfGetEditData($id, $arrIdData) {
-	global $conn;
-
-	// DB登録情報
-	$sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ? AND del_flg = 0";
-	$result = $conn->getAll($sql, array($id));
-
-	//　画像ファイル名
-	for ($i = 0; $i < count($arrIdData); $i ++) {
-		$data = "";
-		if (is_numeric($result[0][ $arrIdData[$i] ]) ) {
-			$sql = "SELECT name,product_id,main_image FROM dtb_products WHERE product_id = ?";
-			$data = $conn->getAll($sql, array($result[0][ $arrIdData[$i] ]));
-		}
-		$arrFileName[] = $data[0];
-	}
- 	
-	return array($result[0], $arrFileName);
-}
-
-// 確認データ取得
-function lfGetConfirmData($arrPOST, $arrIdData) {
-	global $conn;
-	//　画像ファイル名
-	for ($i = 0; $i < count($arrIdData); $i ++) {
-		$data = "";
-		if (is_numeric($arrPOST[ $arrIdData[$i] ]) ) {
-			$sql = "SELECT name,product_id,main_image FROM dtb_products WHERE product_id = ?";
-			$data = $conn->getAll($sql, array($arrPOST[ $arrIdData[$i] ]));
-		}
-		$arrFileName[] = $data[0];
-	}
- 	return array($arrPOST, $arrFileName);
-}
-
-// データベース登録
-function ifRegistData($arrRegist) {
-	global $conn;
-	global $objUpFile;
-
-	foreach ($arrRegist as $data) {
-		if (strlen($_POST[$data]) > 0) {
-			$arrRegistValue[$data] = $_POST[$data];
-		}
-	}
-	$arrRegistValue["creator_id"] = $_SESSION["member_id"];		// 登録者ID（管理画面）
-	$uploadfile = $objUpFile->getDBFileList();
-	//削除要求のあった商品を削除する
-	for ($i = 1; $i <= HTML_TEMPLATE_SUB_MAX; $i++){
-		if ($_POST['delete_sub'.$i] == '1'){
-			$arrRegistValue['sub_product_id'.sprintf("%02d", $i)] = NULL;
-		}
-	}
-	$arrRegistValue = array_merge($arrRegistValue, $uploadfile);
-	$conn->autoExecute("dtb_mailmaga_template", $arrRegistValue);
-}
-
-// データ更新
-function lfUpdateData($arrRegist) {
-	global $conn;
-	global $objUpFile;
-
-	foreach ($arrRegist as $data) {
-		if (strlen($_POST[$data]) > 0) {
-			$arrRegistValue[$data] = $_POST[$data];
-		}
-	}
-	$arrRegistValue["creator_id"] = $_SESSION["member_id"];	
-	$arrRegistValue["update_date"] = "NOW()";
-	$uploadfile = $objUpFile->getDBFileList();
-	//削除要求のあった商品を削除する
-	for ($i = 1; $i <= HTML_TEMPLATE_SUB_MAX; $i++){
-		if ($_POST['delete_sub'.$i] == '1'){
-			$arrRegistValue['sub_product_id'.sprintf("%02d", $i)] = NULL;
-		}
-	}
-	$arrRegistValue = array_merge($arrRegistValue, $uploadfile);
-	
-	$conn->autoExecute("dtb_mailmaga_template", $arrRegistValue, "template_id = ". addslashes($_POST["template_id"]));
-}
-
-// 入力値変換
-function lfConvData( $data ){
-	
-	 // 文字列の変換（mb_convert_kanaの変換オプション）							
-	$arrFlag = array(
-					  "header" => "aKV"
-					 ,"subject" => "aKV"
-					 ,"main_title" => "aKV"
- 					 ,"main_comment" => "aKV"
- 					 ,"main_product_id" => "aKV"
- 					 ,"sub_title" => "aKV"
-					 ,"sub_comment" => "aKV"
-				);
-		
-	if ( is_array($data) ){
-		foreach ($arrFlag as $key=>$line) {
-			$data[$key] = mb_convert_kana($data[$key], $line);
-		}
-	}
-
-	return $data;
-}
-
-// 入力エラーチェック
-function lfErrorCheck($array) {
-	$objErr = new SC_CheckError($array);
-	
-	$objErr->doFunc(array("メール形式", "mail_method"), array("EXIST_CHECK", "ALNUM_CHECK"));
-	$objErr->doFunc(array("Subject", "subject", STEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("ヘッダーテキスト", 'header', LTEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK") );
-	$objErr->doFunc(array("メイン商品タイトル", 'main_title', STEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK") );
-	$objErr->doFunc(array("メイン商品コメント", 'main_comment', LTEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("メイン商品画像", "main_product_id"), array("EXIST_CHECK"));
-	$objErr->doFunc(array("サブ商品群タイトル", "sub_title", STEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("サブ商品群コメント", "sub_comment", LTEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));
-	
-	return $objErr->arrErr;
-}
-
-?>
Index: anches/feature-module-update/html/admin/mail/inc_mailmagazine.php
===================================================================
--- /branches/feature-module-update/html/admin/mail/inc_mailmagazine.php	(revision 15532)
+++ 	(revision )
@@ -1,271 +1,0 @@
-<?php
-/*
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- *
- * CSV配信機能実装のため、共通部分を外部ファイル化しました。<br>
- * @author hirokazu_fukuda
- * @version 2005/12/27
- */
-
-
-//---- 検索用項目配列
-$objPage->arrHtmlmail = array( "" => "両方",  1 => "HTML", 2 => "TEXT" );
-
-
-//---- 配列内容専用項目の配列
-$arrRegistColumn = array(
-							 array(  "column" => "template_id",		"convert" => "n" )
-							,array(  "column" => "mail_method",		"convert" => "n" )
-							,array(  "column" => "send_year",		"convert" => "n" )
-							,array(  "column" => "send_month", 		"convert" => "n" )
-							,array(  "column" => "send_day",		"convert" => "n" )
-							,array(  "column" => "send_hour",		"convert" => "n" )
-							,array(  "column" => "send_minutes",	"convert" => "n" )
-							,array(  "column" => "subject",			"convert" => "aKV" )
-							,array(  "column" => "body",			"convert" => "KV" )
-						);
-
-//---- メルマガ会員種別
-$arrCustomerType = array(
-						1 => "会員",
-						2 => "非会員",
-						//3 => "CSV登録"
-						);
-
-//---- 検索項目
-$arrSearchColumn = array(
-							array(  "column" => "name",				"convert" => "aKV"),
-							array(  "column" => "pref",				"convert" => "n" ),
-							array(  "column" => "kana",				"convert" => "CKV"),
-							array(  "column" => "sex",				"convert" => "" ),
-							array(  "column" => "tel",				"convert" => "n" ),
-							array(  "column" => "job",				"convert" => "" ),
-							array(  "column" => "email",			"convert" => "a" ),
-							array(  "column" => "email_mobile",		"convert" => "a" ),							
-							array(  "column" => "htmlmail",			"convert" => "n" ),
-							array(  "column" => "customer",			"convert" => "" ),
-							array(  "column" => "buy_total_from",	"convert" => "n" ),
-							array(  "column" => "buy_total_to",		"convert" => "n" ),
-							array(  "column" => "buy_times_from",	"convert" => "n" ),
-							array(  "column" => "buy_times_to",		"convert" => "n" ),
-							array(  "column" => "birth_month",		"convert" => "n" ),
-							array(  "column" => "b_start_year",		"convert" => "n" ),
-							array(  "column" => "b_start_month",	"convert" => "n" ),
-							array(  "column" => "b_start_day",		"convert" => "n" ),
-							array(  "column" => "b_end_year",		"convert" => "n" ),
-							array(  "column" => "b_end_month",		"convert" => "n" ),
-							array(  "column" => "b_end_day",		"convert" => "n" ),
-							array(  "column" => "start_year",		"convert" => "n" ),
-							array(  "column" => "start_month",		"convert" => "n" ),
-							array(  "column" => "start_day",		"convert" => "n" ),
-							array(  "column" => "end_year",			"convert" => "n" ),
-							array(  "column" => "end_month",		"convert" => "n" ),
-							array(  "column" => "end_day",			"convert" => "n" ),
-							array(  "column" => "buy_start_year",	"convert" => "n" ),
-							array(  "column" => "buy_start_month",	"convert" => "n" ),
-							array(  "column" => "buy_start_day",	"convert" => "n" ),
-							array(  "column" => "buy_end_year",		"convert" => "n" ),
-							array(  "column" => "buy_end_month",	"convert" => "n" ),
-							array(  "column" => "buy_end_day",		"convert" => "n" ),
-							array(  "column" => "buy_product_code",	"convert" => "aKV" )
-							,array(  "column" => "buy_product_name",	"convert" => "aKV" )
-							,array(  "column" => "category_id",	"convert" => "" )			
-							,array(  "column" => "buy_total_from",	"convert" => "n" )		
-							,array(  "column" => "buy_total_to",	"convert" => "n" )
-							,array(  "column" => "campaign_id",	"convert" => "" )
-							,array(  "column" => "mail_type",			"convert" => "" )
-
-					);
-
-//--------------------------------------------------------------------------------------------------------------------------------------
-
-//---- HTMLテンプレートを使用する場合、データを取得する。	
-function lfGetHtmlTemplateData($id) {
-	
-	global $conn;
-	$sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ?";
-	$result = $conn->getAll($sql, array($id));
-	$list_data = $result[0];
-
-	// メイン商品の情報取得
-	$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 = ?";
-	$main = $conn->getAll($sql, array($list_data["main_product_id"]));
-	$list_data["main"] = $main[0];
-
-	// サブ商品の情報取得
-	$sql = "SELECT product_id, name, main_list_image, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass AS allcls WHERE product_id = ?";
-	$k = 0;
-	$l = 0;
-	for ($i = 1; $i <= 12; $i ++) {
-		if ($l == 4) {
-			$l = 0;
-			$k ++;
-		}
-		$result = "";
-		$j = sprintf("%02d", $i);
-		if ($i > 0 && $i < 5 ) $k = 0;
-		if ($i > 4 && $i < 9 ) $k = 1;
-		if ($i > 8 && $i < 13 ) $k = 2;	
-		
-		if (is_numeric($list_data["sub_product_id" .$j])) {
-			$result = $conn->getAll($sql, array($list_data["sub_product_id" .$j]));
-			$list_data["sub"][$k][$l] = $result[0];
-			$list_data["sub"][$k]["data_exists"] = "OK";	//当該段にデータが１つ以上存在するフラグ
-		}
-		$l ++;
-	}
-	return $list_data;
-}
-
-//---   テンプレートの種類を返す
-function lfGetTemplateMethod($conn, $templata_id){
-	
-	if ( sfCheckNumLength($template_id) ){
-		$sql = "SELECT mail_method FROM dtb_mailmaga_template WEHRE template_id = ?";
-	}	
-}
-
-//---   hidden要素出力用配列の作成
-function lfGetHidden( $array ){
-	if ( is_array($array) ){
-		foreach( $array as $key => $val ){
-			if ( is_array( $val )){
-				for ( $i=0; $i<count($val); $i++){
-					$return[ $key.'['.$i.']'] = $val[$i];
-				}				
-			} else {
-				$return[$key] = $val;			
-			}
-		}
-	}
-	return $return;
-}
-
-//----　取得文字列の変換
-function lfConvertParam($array, $arrSearchColumn) {
-	
-	// 文字変換
-	foreach ($arrSearchColumn as $data) {
-		$arrConvList[ $data["column"] ] = $data["convert"];
-	}
-
-	$new_array = array();
-	foreach ($arrConvList as $key => $val) {
-		if ( strlen($array[$key]) > 0 ){						// データのあるものだけ返す
-			$new_array[$key] = $array[$key];
-			if( strlen($val) > 0) {
-				$new_array[$key] = mb_convert_kana($new_array[$key] ,$val);
-			}
-		}
-	}
-	return $new_array;
-	
-}
-
-
-//---- 入力エラーチェック
-function lfErrorCheck($array, $flag = '') {
-
-	// flag は登録時用
-	
-	$objErr = new SC_CheckError($array);
-	
-	$objErr->doFunc(array("顧客コード", "customer_id", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("都道府県", "pref", 2), array("NUM_CHECK","MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("顧客名", "name", STEXT_LEN), array("MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("顧客名(カナ)", "kana", STEXT_LEN), array("KANA_CHECK", "MAX_LENGTH_CHECK"));
-
-	$objErr->doFunc(array('メールアドレス', "email", STEXT_LEN) ,array("EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("電話番号", "tel", TEL_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
-		
-	$objErr->doFunc(array("購入回数(開始)", "buy_times_from", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
-	$objErr->doFunc(array("購入回数(終了)", "buy_times_to", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
-	if ((is_numeric($array["buy_total_from"]) && is_numeric($array["buy_total_to"]) ) && ($array["buy_times_from"] > $array["buy_times_to"]) ) $objErr->arrErr["buy_times_from"] .= "※ 購入回数の指定範囲が不正です。";
-	
-	$objErr->doFunc(array("誕生月", "birth_month", 2), array("NUM_CHECK","MAX_LENGTH_CHECK"));
-	
-	$objErr->doFunc(array("誕生日(開始日)", "b_start_year", "b_start_month", "b_start_day",), array("CHECK_DATE"));
-	$objErr->doFunc(array("誕生日(終了日)", "b_end_year", "b_end_month", "b_end_day"), array("CHECK_DATE"));	
-	$objErr->doFunc(array("誕生日(開始日)","誕生日(終了日)", "b_start_year", "b_start_month", "b_start_day", "b_end_year", "b_end_month", "b_end_day"), array("CHECK_SET_TERM"));
-	
-	$objErr->doFunc(array("登録・更新日(開始日)", "start_year", "start_month", "start_day",), array("CHECK_DATE"));
-	$objErr->doFunc(array("登録・更新日(終了日)", "end_year", "end_month", "end_day"), array("CHECK_DATE"));	
-	$objErr->doFunc(array("登録・更新日(開始日)","登録・更新日(終了日)", "start_year", "start_month", "start_day", "end_year", "end_month", "end_day"), array("CHECK_SET_TERM"));
-	
-	$objErr->doFunc(array("最終購入日(開始日)", "buy_start_year", "buy_start_month", "buy_start_day",), array("CHECK_DATE"));
-	$objErr->doFunc(array("最終購入(終了日)", "buy_end_year", "buy_end_month", "buy_end_day"), array("CHECK_DATE"));	
-	$objErr->doFunc(array("最終購入日(開始日)","登録・更新日(終了日)", "buy_start_year", "buy_start_month", "buy_start_day", "buy_end_year", "buy_end_month", "buy_end_day"), array("CHECK_SET_TERM"));
-	
-	$objErr->doFunc(array("購入商品コード", "buy_product_code", STEXT_LEN), array("MAX_LENGTH_CHECK"));
-
-	$objErr->doFunc(array("購入商品名", "buy_product_name", STEXT_LEN), array("MAX_LENGTH_CHECK"));
-	
-	$objErr->doFunc(array("購入金額(開始)", "buy_total_from", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));	
-	$objErr->doFunc(array("購入金額(終了)", "buy_total_to", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));	
-
-	$objErr->doFunc(array("キャンペーン", "campaign_id", INT_LEN), array("NUM_CHECK"));	
-		
-	//購入金額(from) ＞ 購入金額(to) の場合はエラーとする
-	if ( (is_numeric($array["buy_total_from"]) && is_numeric($array["buy_total_to"]) ) && 
-		 ($array["buy_total_from"] > $array["buy_total_to"]) ) {
-		 $objErr->arrErr["buy_total_from"] .= "※ 購入金額の指定範囲が不正です。";
-	 }
-
-	if ( $flag ){
-		$objErr->doFunc(array("テンプレート", "template_id"), array("EXIST_CHECK", "NUM_CHECK"));
-		$objErr->doFunc(array("メール送信法法", "mail_method"), array("EXIST_CHECK", "NUM_CHECK"));
-		
-		if(MELMAGA_BATCH_MODE) {
-			$objErr->doFunc(array("配信日（年）","send_year"), array("EXIST_CHECK", "NUM_CHECK"));
-			$objErr->doFunc(array("配信日（月）","send_month"), array("EXIST_CHECK", "NUM_CHECK"));
-			$objErr->doFunc(array("配信日（日）","send_day"), array("EXIST_CHECK", "NUM_CHECK"));
-			$objErr->doFunc(array("配信日（時）","send_hour"), array("EXIST_CHECK", "NUM_CHECK"));
-			$objErr->doFunc(array("配信日（分）","send_minutes"), array("EXIST_CHECK", "NUM_CHECK"));
-			$objErr->doFunc(array("配信日", "send_year", "send_month", "send_day"), array("CHECK_DATE"));
-			$objErr->doFunc(array("配信日", "send_year", "send_month", "send_day","send_hour", "send_minutes"), array("ALL_EXIST_CHECK"));
-		}
-		$objErr->doFunc(array("Subject", "subject", STEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));
-		$objErr->doFunc(array("本文", 'body', LLTEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));	// HTMLテンプレートを使用しない場合
-	}
-	
-	return $objErr->arrErr;
-}
-
-/* テンプレートIDとsubjectの配列を返す */ 
-function getTemplateList($conn){
-	global $arrMagazineTypeAll;
-	
-	$sql = "SELECT template_id, subject, mail_method FROM dtb_mailmaga_template WHERE del_flg = 0 ";
-	if ($_POST["htmlmail"] == 2 || $_POST['mail_type'] == 2) {
-		$sql .= " AND mail_method = 2 ";	//TEXT希望者へのTESTメールテンプレートリスト
-	}
-	$sql .= " ORDER BY template_id DESC";
-	$result = $conn->getAll($sql);
-	
-	if ( is_array($result) ){ 
-		foreach( $result as $line ){
-			$return[$line['template_id']] = "【" . $arrMagazineTypeAll[$line['mail_method']] . "】" . $line['subject'];  
-		}
-	}
-	
-	return $return;
-}
-
-/* テンプレートIDからテンプレートデータを取得 */ 
-function getTemplateData($conn, $id){
-	
-	if ( sfCheckNumLength($id) ){
-		$sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ? ORDER BY template_id DESC";
-		$result = $conn->getAll( $sql, array($id) );
-		if ( is_array($result) ) {
-			$return = $result[0];
-		}
-	}
-	return $return;
-}
-
-
-
-?>
