Index: /branches/version-2_4/data/Smarty/templates/default/admin/order/edit.tpl
===================================================================
--- /branches/version-2_4/data/Smarty/templates/default/admin/order/edit.tpl	(revision 18531)
+++ /branches/version-2_4/data/Smarty/templates/default/admin/order/edit.tpl	(revision 18712)
@@ -573,5 +573,4 @@
                                 </td>
                             </tr>
-                            <!--{assign var=key value="deliv_date"}-->
                             <tr class="fs12n">
                                 <td bgcolor="#f2f1ec" colspan="6">▼お届け日指定</td>
@@ -579,14 +578,15 @@
                             <tr class="fs12n">
                                 <td bgcolor="#ffffff" colspan="6">
-                                  <span class="attention"><!--{$arrErr.deliv_date_year}--></span> 
-                                  <select name="deliv_date_year" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"> 
-                                    <!--{html_options options=$arrYearDelivDate selected=$arrForm.deliv_date_year.value|default:""}--> 
-                                  </select>年 
-                                  <select name="deliv_date_month" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"> 
-                                    <!--{html_options options=$arrMonthDelivDate selected=$arrForm.deliv_date_month.value|default:""}--> 
-                                  </select>月 
-                                  <select name="deliv_date_day" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"> 
-                                    <!--{html_options options=$arrDayDelivDate selected=$arrForm.deliv_date_day.value|default:""}--> 
+																	<!--{assign var=key value="deliv_date_year"}-->
+                                  <select name="deliv_date_year" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
+                                    <!--{html_options options=$arrYearDelivDate selected=$arrForm.deliv_date_year.value|default:""}-->
+                                  </select>年
+                                  <select name="deliv_date_month" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
+                                    <!--{html_options options=$arrMonthDelivDate selected=$arrForm.deliv_date_month.value|default:""}-->
+                                  </select>月
+                                  <select name="deliv_date_day" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
+                                    <!--{html_options options=$arrDayDelivDate selected=$arrForm.deliv_date_day.value|default:""}-->
                                   </select>日
+																	<span class="red12"><!--{$arrErr[$key]}--></span>
                                 </td>
                             </tr>
Index: /branches/version-2_4/data/class/SC_Date.php
===================================================================
--- /branches/version-2_4/data/class/SC_Date.php	(revision 16741)
+++ /branches/version-2_4/data/class/SC_Date.php	(revision 18712)
@@ -22,135 +22,152 @@
  */
 
-/*　日時表示用クラス */
+/* 日時表示用クラス */
 class SC_Date {
-	var $start_year;
-	var $month;
-	var $day;
-	var $end_year;
-	
-	// コンストラクタ
-	function SC_Date($start_year='', $end_year='') {
-		if ( $start_year ) 	$this->setStartYear($start_year);	
-		if ( $end_year )	$this->setEndYear($end_year);
-	}
-	
-	function setStartYear($year){
-		$this->start_year = $year;
-	}
-	
-	function getStartYear(){
-		return $this->start_year;
-	}
-	
-	function setEndYear($endYear) {
-		$this->end_year = $endYear;	
-	}
-	
-	function getEndYear() {
-		return $this->end_year;
-	}
-	
-	function setMonth($month){
-		$this->month = $month;			
-	}
-	
-	function setDay ($day){
-		$this->day = $day;
-	}
-			
-	function getYear($year = '', $default = ''){
-		if ( $year ) $this->setStartYear($year);
-		
-		$year = $this->start_year;
-		if ( ! $year ) $year = DATE("Y");
-		
-		$end_year = $this->end_year;
-		if ( ! $end_year ) $end_year = (DATE("Y") + 3);
-		
-		$year_array = array();
-		
-		for ($i=$year; $i<=($end_year); $i++){		
-			$year_array[$year] = $i;
-			if($year == $default) {
-				$year_array['----'] = "----";
-			}
-			$year++;
-		}
-		return $year_array;
-	}
-	
-	function getZeroYear($year = ''){
-		if ( $year ) $this->setStartYear($year);
-		
-		$year = $this->start_year;
-		if ( ! $year ) $year = DATE("Y");
-		
-		$end_year = $this->end_year;
-		if ( ! $end_year ) $end_year = (DATE("Y") + 3);
-		
-		$year_array = array();
-		
-		for ($i=$year; $i<=($end_year); $i++){
-			$key = substr($i, -2);
-			$year_array[$key] = $key;
-		}
-		return $year_array;
-	}
-	
-	function getZeroMonth(){
-	
-		$month_array = array();
-		for ($i=1; $i <= 12; $i++){
-			$val = sprintf("%02d", $i);
-			$month_array[$val] = $val;
-		}
-		return $month_array;
-	}	
-	
-	
-	function getMonth(){
-	
-		$month_array = array();
-		for ($i=0; $i < 12; $i++){		
-			$month_array[$i + 1 ] = $i + 1;
-		}
-		return $month_array;
-	}	
-	
-	function getDay(){	
-		
-		$day_array = array();
-		for ($i=0; $i < 31; $i++){		
-			$day_array[ $i + 1 ] = $i + 1;
-		}
-		
-		return $day_array;
-	}
+    var $start_year;
+    var $month;
+    var $day;
+    var $end_year;
+    
+    // コンストラクタ
+    function SC_Date($start_year='', $end_year='') {
+        if ( $start_year )  $this->setStartYear($start_year);
+        if ( $end_year )    $this->setEndYear($end_year);
+    }
+    
+    function setStartYear($year){
+        $this->start_year = $year;
+    }
+    
+    function getStartYear(){
+        return $this->start_year;
+    }
+    
+    function setEndYear($endYear) {
+        $this->end_year = $endYear;
+    }
+    
+    function getEndYear() {
+        return $this->end_year;
+    }
+    
+    function setMonth($month){
+        $this->month = $month;
+    }
+    
+    function setDay ($day){
+        $this->day = $day;
+    }
+    
+    /**
+     * 年プルダウン用の配列を返す
+     * FIXME $default_year に一致いる行が無かった場合、先頭か末尾に付加すべきと思われる。
+     * @param string $year    XMLファイル名
+     * @param bool|string $default_year
+     *     false  「選択なし」は含めない。
+     *     true   「選択なし」は含める。
+     *     string 「選択なし」は指定された値の下に付加する。
+     * @param string $default_key
+     */
+    function getYear($year = '', $default_year = false, $default_key = '----') {
+        if ( $year ) $this->setStartYear($year);
+        
+        $year = $this->start_year;
+        if ( ! $year ) $year = DATE("Y");
+        
+        $end_year = $this->end_year;
+        if ( ! $end_year ) $end_year = (DATE("Y") + 3);
+        
+        $year_array = array();
+        
+        if ($default_year === true) {
+            $year_array[$default_key] = '----';
+        }
+        
+        for ($i = $year; $i <= $end_year; $i++) {
+            $year_array[$i] = $i;
+            if ($default_year !== true && strlen($default_year) >= 1 && $i == $default_year) {
+                $year_array[$default_key] = '----';
+            }
+        }
+        return $year_array;
+    }
+    
+    function getZeroYear($year = ''){
+        if ( $year ) $this->setStartYear($year);
+        
+        $year = $this->start_year;
+        if ( ! $year ) $year = DATE("Y");
+        
+        $end_year = $this->end_year;
+        if ( ! $end_year ) $end_year = (DATE("Y") + 3);
+        
+        $year_array = array();
+        
+        for ($i = $year; $i <= $end_year; $i++) {
+            $key = substr($i, -2);
+            $year_array[$key] = $key;
+        }
+        return $year_array;
+    }
+    
+    function getZeroMonth(){
+    
+        $month_array = array();
+        for ($i=1; $i <= 12; $i++){
+            $val = sprintf("%02d", $i);
+            $month_array[$val] = $val;
+        }
+        return $month_array;
+    }   
+    
+    
+    function getMonth($default = false) {
+        $month_array = array();
+        
+        if ($default) $month_array[''] = '--';
+        
+        for ($i=0; $i < 12; $i++){
+            $month_array[$i + 1 ] = $i + 1;
+        }
+        return $month_array;
+    }   
+    
+    function getDay($default = false) {
+        $day_array = array();
+        
+        if ($default) $day_array[''] = '--';
+        
+        for ($i=0; $i < 31; $i++){
+            $day_array[ $i + 1 ] = $i + 1;
+        }
+        
+        return $day_array;
+    }
 
-	function getHour(){	
-		
-		$day_array = array();
-		for ($i=0; $i<=23; $i++){		
-			$hour_array[$i] = $i;
-		}
-		
-		return $hour_array;
-	}
+    function getHour(){
+        
+        $day_array = array();
+        for ($i=0; $i<=23; $i++){
+            $hour_array[$i] = $i;
+        }
+        
+        return $hour_array;
+    }
 
-	function getMinutes(){	
-		
-		$minutes_array = array();
-		for ($i=0; $i<=59; $i++){		
-			$minutes_array[$i] = $i;
-		}
-		
-		return $minutes_array;
-	}
-	
-	function getMinutesInterval(){	
-		
-		$minutes_array = array("00"=>"00", "30"=>"30");		
-		return $minutes_array;
-	}	
+    function getMinutes(){
+        
+        $minutes_array = array();
+        for ($i=0; $i<=59; $i++){
+            $minutes_array[$i] = $i;
+        }
+        
+        return $minutes_array;
+    }
+    
+    function getMinutesInterval(){
+        
+        $minutes_array = array("00"=>"00", "30"=>"30");
+        return $minutes_array;
+    }
 }
 ?>
Index: /branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
===================================================================
--- /branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 18527)
+++ /branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 18712)
@@ -111,5 +111,5 @@
         $objSiteInfo = new SC_SiteInfo();
         $objDb = new SC_Helper_DB_Ex();
-        $objDate = new SC_Date(1901); 
+        $objDate = new SC_Date(1970);
         $this->arrYearDelivDate = $objDate->getYear('', date('Y'), '');
         $this->arrMonthDelivDate = $objDate->getMonth(true);
@@ -381,5 +381,7 @@
         $this->objFormParam->addParam("お届け時間ID", "deliv_time_id", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
         $this->objFormParam->addParam("対応状況", "status", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
-        $this->objFormParam->addParam("お届け日", "deliv_date", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
+        $this->objFormParam->addParam("お届け日(年)", "deliv_date_year", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $this->objFormParam->addParam("お届け日(月)", "deliv_date_month", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+        $this->objFormParam->addParam("お届け日(日)", "deliv_date_day", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
         $this->objFormParam->addParam("お支払方法名称", "payment_method");
         $this->objFormParam->addParam("お届け時間", "deliv_time");
@@ -410,5 +412,5 @@
         $this->objFormParam->addParam("受注日", "create_date");
         $this->objFormParam->addParam("発送日", "commit_date");
-        $this->objFormParam->addParam("お届け日", "deliv_date"); 
+        $this->objFormParam->addParam("お届け日", "deliv_date");
     }
 
@@ -424,9 +426,13 @@
             $this->objFormParam->setValue('total_point', $total_point);
             $this->objFormParam->setValue('point', $point);
-            $delivDate = split(" ", $arrRet[0]["deliv_date"]);
-            $delivDate = split("-", $delivDate[0]);
-            $this->objFormParam->setValue('deliv_date_year', $delivDate[0]);
-            $this->objFormParam->setValue('deliv_date_month', isset($delivDate[1]) ? $delivDate[1] : "");
-            $this->objFormParam->setValue('deliv_date_day', isset($delivDate[2]) ? $delivDate[2] : "");
+            // XXX お届け日の処理
+            if (!empty($arrRet[0]["deliv_date"])) {
+                $delivDate = mb_strcut($arrRet[0]["deliv_date"], 0, 8);
+                $delivDate = split("/", $delivDate);
+                $ts = mktime(0, 0, 0, $delivDate[1], $delivDate[2], $delivDate[0]);
+                $this->objFormParam->setValue('deliv_date_year', date("Y", $ts));
+                $this->objFormParam->setValue('deliv_date_month', date("n", $ts));
+                $this->objFormParam->setValue('deliv_date_day', date("j", $ts));
+            }
             $this->arrForm = $arrRet[0];
 
@@ -466,13 +472,9 @@
         $arrRet =  $this->objFormParam->getHashArray();
         $objErr = new SC_CheckError($arrRet);
-        $objErr->arrErr = $this->objFormParam->checkError();
-
         $objErr->doFunc(array("お届け日", "deliv_date_year", "deliv_date_month", "deliv_date_day"), array("CHECK_DATE"));
-
         if (count($objErr->arrErr) >= 1) {
             return $objErr->arrErr;
         }
-
-        return $objErr->arrErr;
+        return $this->objFormParam->checkError();
     }
 
@@ -557,11 +559,17 @@
         $sqlval['update_date'] = 'Now()';
 
-        if (strlen($sqlval['deliv_date_year']) >= 0) {
-            $sqlval['deliv_date'] = $sqlval['deliv_date_year'] . '-' . $sqlval['deliv_date_month'] . '-' . $sqlval['deliv_date_day'];
+        // XXX お届け日の処理
+        if (!empty($sqlval['deliv_date_year'])) {
+            $ts = mktime(0, 0, 0, $sqlval['deliv_date_month'], $sqlval['deliv_date_day'], $sqlval['deliv_date_year']);
+            $sqlval['deliv_date'] = date("y/m/d", $ts);
+            $masterData = new SC_DB_MasterData();
+            $arrWDAY = $masterData->getMasterData("mtb_wday");
+            $sqlval['deliv_date'] .= sprintf("(%s)", $arrWDAY[date("w", $ts)]);
+        } else {
+            $sqlval['deliv_date'] = "";
         }
         unset($sqlval['deliv_date_year']);
         unset($sqlval['deliv_date_month']);
         unset($sqlval['deliv_date_day']);
-
         unset($sqlval['total_point']);
         unset($sqlval['point']);
@@ -714,4 +722,17 @@
         }
 
+        // XXX お届け日の処理
+        if (!empty($sqlval['deliv_date_year'])) {
+            $ts = mktime(0, 0, 0, $sqlval['deliv_date_month'], $sqlval['deliv_date_day'], $sqlval['deliv_date_year']);
+            $sqlval['deliv_date'] = date("y/m/d", $ts);
+            $masterData = new SC_DB_MasterData();
+            $arrWDAY = $masterData->getMasterData("mtb_wday");
+            $sqlval['deliv_date'] .= sprintf("(%s)", $arrWDAY[date("w", $ts)]);
+
+        }
+        unset($sqlval['deliv_date_year']);
+        unset($sqlval['deliv_date_month']);
+        unset($sqlval['deliv_date_day']);
+
         unset($sqlval['total_point']);
         unset($sqlval['point']);
