Index: branches/dev/html/admin/basis/preview.php
===================================================================
--- branches/dev/html/admin/basis/preview.php	(revision 13726)
+++ branches/dev/html/admin/basis/preview.php	(revision 13752)
@@ -13,5 +13,5 @@
 
 	function LC_Page() {
-		$this->tpl_mainpage = 'mail/preview.tpl';
+		$this->tpl_mainpage = 'basis/preview.tpl';
 	}
 }
@@ -28,56 +28,7 @@
 
 
-if ( $_POST['body'] ){
+if ( $_POST['preview'] ){
 	$objPage->body = $_POST['body'];
-
-// HTML¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È¤Î¥×¥ì¥Ó¥å¡¼
-} elseif ($_REQUEST["method"] == "template" && sfCheckNumLength($_REQUEST['id'])) {
-
-	$sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ?";
-	$result = $conn->getAll($sql, array($_REQUEST["id"]));
-	$objPage->list_data = $result[0];
-	
-	//¥á¡¼¥ëÃ´Åö¼Ì¿¿¤ÎÉ½¼¨
-	$objUpFile = new SC_UploadFile(IMAGE_TEMP_URL, IMAGE_SAVE_URL);
-	$objUpFile->addFile("¥á¡¼¥ëÃ´Åö¼Ì¿¿", 'charge_image', array('jpg'), IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
-	$objUpFile->setDBFileList($objPage->list_data);
-	// FormÍÑÇÛÎó¤òÅÏ¤¹¡£
-	$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL);
-	
-	// ¥á¥¤¥ó¾¦ÉÊ¤Î¾ðÊó¼èÆÀ
-	$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($objPage->list_data["main_product_id"]));
-	$objPage->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 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($objPage->list_data["sub_product_id" .$j])) {
-			$result = $conn->getAll($sql, array($objPage->list_data["sub_product_id" .$j]));
-			$objPage->list_data["sub"][$k][$l] = $result[0];
-			$objPage->list_data["sub"][$k]["data_exists"] = "OK";	//Åö³ºÃÊ¤Ë¥Ç¡¼¥¿¤¬£±¤Ä°Ê¾åÂ¸ºß¤¹¤ë¥Õ¥é¥°
-		}
-		$l ++;
-	}
-	$objPage->tpl_mainpage = 'mail/html_template.tpl';
-
-} elseif ( sfCheckNumLength($_GET['send_id']) || sfCheckNumLength($_GET['id'])){
-	if (is_numeric($_GET["send_id"])) {
-		$id = $_GET["send_id"];
-		$sql = "SELECT body, mail_method FROM dtb_send_history WHERE send_id = ?";
-	} else {
-		$sql = "SELECT body, mail_method FROM dtb_mailmaga_template WHERE template_id = ?";
+		$sql = "SELECT header, footer,send_type FROM dtb_mailtemplate WHERE template_id = ?";
 		$id = $_GET['id'];
 	}
