Index: temp/branches/ec-cube-beta/html/admin/contents/campaign_design.php
===================================================================
--- temp/branches/ec-cube-beta/html/admin/contents/campaign_design.php	(revision 10864)
+++ temp/branches/ec-cube-beta/html/admin/contents/campaign_design.php	(revision 10872)
@@ -23,4 +23,5 @@
 $objPage = new LC_Page();
 $objView = new SC_AdminView();
+$objQuery = new SC_Query();
 
 // Ç§¾Ú²ÄÈÝ¤ÎÈ½Äê
@@ -35,62 +36,50 @@
 }
 
-// ¥Ç¡¼¥¿¹¹¿·½èÍý
-if ($division != ''){
-	/*
-	// ¥×¥ì¥Ó¥å¡¼ÍÑ¥Æ¥ó¥×¥ì¡¼¥È¤Ë½ñ¤­¹þ¤ß	
-	$fp = fopen($pre_DIR.$division.'.tpl',"w");
-	fwrite($fp, $_POST[$division]);
-	fclose($fp);
+// ¥Ç¥£¥ì¥¯¥È¥êÌ¾¤ò¼èÆÀÌ¾		
+$directory_name = $objQuery->get("dtb_campaign", "directory_name", "campaign_id = ?", array($campaign_id));
+// ¥­¥ã¥ó¥Ú¡¼¥ó¥Æ¥ó¥×¥ì¡¼¥È³ÊÇ¼¥Ç¥£¥ì¥¯¥È¥ê
+switch($arrForm['status']) {
+	case 'active':
+		$status = CAMPAIGN_TEMPLATE_ACTIVE;
+		break;
+	case 'end':
+		$status = CAMPAIGN_TEMPLATE_END;
+		break;
+	default:
+		$status = CAMPAIGN_TEMPLATE_ACTIVE;
+		break;
+}
+$campaign_dir = CAMPAIGN_PATH . $directory_name . "/" .$status;
 
-	// ÅÐÏ¿»þ¤Ï¥×¥ì¥Ó¥å¡¼ÍÑ¥Æ¥ó¥×¥ì¡¼¥È¤ò¥³¥Ô¡¼¤¹¤ë
-	if ($_POST['mode'] == 'confirm'){
-		copy($pre_DIR.$division.".tpl", USER_INC_PATH . $division . ".tpl");
-		// ´°Î»¥á¥Ã¥»¡¼¥¸¡Ê¥×¥ì¥Ó¥å¡¼»þ¤ÏÉ½¼¨¤·¤Ê¤¤¡Ë
-		$objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');";
-		
-		// ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤ÎÉý¤ò¸µ¤ËÌá¤¹(½èÍý¤ÎÅý°ì¤Î¤¿¤á)
-		$_POST['header_row'] = "";
-		$_POST['footer_row'] = "";
-	}else if ($_POST['mode'] == 'preview'){
-		if ($division == "header") $objPage->header_prev = "on";
-		if ($division == "footer") $objPage->footer_prev = "on";
-	}
-
-	// ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß(¥×¥ì¥Ó¥å¡¼¥Ç¡¼¥¿)
-	$header_data = file_get_contents($pre_DIR . "header.tpl");
+switch($_POST['mode']) {
+case 'regist':
+		// ÅÐÏ¿»þ¤Ï¥×¥ì¥Ó¥å¡¼ÍÑ¥Æ¥ó¥×¥ì¡¼¥È¤ò¥³¥Ô¡¼¤¹¤ë
+		if ($_POST['mode'] == 'confirm'){
+			copy($pre_DIR.$division.".tpl", USER_INC_PATH . $division . ".tpl");
+			// ´°Î»¥á¥Ã¥»¡¼¥¸¡Ê¥×¥ì¥Ó¥å¡¼»þ¤ÏÉ½¼¨¤·¤Ê¤¤¡Ë
+			$objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');";
+			
+			// ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤ÎÉý¤ò¸µ¤ËÌá¤¹(½èÍý¤ÎÅý°ì¤Î¤¿¤á)
+			$_POST['header_row'] = "";
+			$_POST['footer_row'] = "";
+		}else if ($_POST['mode'] == 'preview'){
+			if ($division == "header") $objPage->header_prev = "on";
+			if ($division == "footer") $objPage->footer_prev = "on";
+		}
 	
-	// ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß(¥×¥ì¥Ó¥å¡¼¥Ç¡¼¥¿)
-	$footer_data = file_get_contents($pre_DIR . "footer.tpl");
-	*/
-} else {
-	/*
-	// post¤Ç¥Ç¡¼¥¿¤¬ÅÏ¤µ¤ì¤Ê¤±¤ì¤Ð¿·µ¬ÆÉ¤ß¹þ¤ß¤ÈÈ½ÃÇ¤ò¤·¡¢¥×¥ì¥Ó¥å¡¼ÍÑ¥Ç¡¼¥¿¤òÀµµ¬¤Î¥Ç¡¼¥¿¤Ç¾å½ñ¤­¤¹¤ë
-	if (!is_dir($pre_DIR)) {
-		mkdir($pre_DIR);
-	}
-	copy(USER_INC_PATH . "header.tpl", $pre_DIR . "header.tpl");
-	copy(USER_INC_PATH . "footer.tpl", $pre_DIR . "footer.tpl");
-	
-	// ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß
-	$header_data = file_get_contents(USER_INC_PATH . "header.tpl");
-	// ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß
-	$footer_data = file_get_contents(USER_INC_PATH . "footer.tpl");
-	*/
+	break;
+default:	
+	break;
 }
 
-// ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤ËÉ½¼¨
-$objPage->header_data = $header_data;
-$objPage->footer_data = $footer_data;
+// ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß
+$objPage->header_data = file_get_contents($campaign_dir . "header.tpl");	
+// ¥³¥ó¥Æ¥ó¥Ä¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß
+$objPage->contents_data = file_get_contents($campaign_dir . "contents.tpl");	
+// ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß
+$objPage->footer_data = file_get_contents($campaign_dir . "footer.tpl");	
 
-if ($_POST['header_row'] != ''){
-	$objPage->header_row = $_POST['header_row'];
-}
-
-if ($_POST['footer_row'] != ''){
-	$objPage->footer_row = $_POST['footer_row'];
-}
-
-// ¥Ö¥é¥¦¥¶¥¿¥¤¥×
-$objPage->browser_type = $_POST['browser_type'];
+// ¥Õ¥©¡¼¥à¤ÎÃÍ¤ò³ÊÇ¼
+$objPage->arrForm = $arrForm;
 
 // ²èÌÌ¤ÎÉ½¼¨
Index: temp/branches/ec-cube-beta/data/Smarty/templates/admin/contents/campaign_design.tpl
===================================================================
--- temp/branches/ec-cube-beta/data/Smarty/templates/admin/contents/campaign_design.tpl	(revision 10871)
+++ temp/branches/ec-cube-beta/data/Smarty/templates/admin/contents/campaign_design.tpl	(revision 10872)
@@ -9,9 +9,9 @@
 <form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->" >
 <input type="hidden" name="mode" value="">
+<input type="hidden" name="campaign_id" value="<!--{$arrForm.campaign_id}-->">
+<input type="hidden" name="status" value="<!--{$arrForm.status}-->">
 <input type="hidden" name="header_row" value="">
 <input type="hidden" name="contents_row" value="">
 <input type="hidden" name="footer_row" value="">
-<input type="hidden" name="campaign_id" value="">
-<input type="hidden" name="status" value="">
 <table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
 	<tr valign="top">
