Index: /branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Payment.php
===================================================================
--- /branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 18311)
+++ /branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 18358)
@@ -24,4 +24,5 @@
 // {{{ requires
 require_once(CLASS_PATH . "pages/LC_Page.php");
+require_once(DATA_PATH . 'module/Services/JSON.php');
 
 /**
@@ -30,5 +31,5 @@
  * @package Page
  * @author LOCKON CO.,LTD.
- * @version $Id:LC_Page_Shopping_Payment.php 15532 2007-08-31 14:39:46Z nanasess $
+ * @version $Id:LC_Page_Shopping_Payment.php 15532 2009-10-30 20:04:46Z satou $
  */
 class LC_Page_Shopping_Payment extends LC_Page {
@@ -136,5 +137,6 @@
         // 支払い方法が変更された場合
         case 'payment':
-            // ここのbreakは、意味があるので外さないで下さい。
+            // 配送時間の配列を生成
+            $this->lfSetDelivTime();
             break;
         default:
@@ -150,8 +152,4 @@
         // 支払い方法の画像があるなしを取得（$img_show true:ある false:なし）
         $this->img_show = $this->lfGetImgShow($this->arrPayment);
-        // お届け時間の取得
-        $arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
-        $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
-
         // お届け日一覧の取得
         $this->arrDelivDate = $this->lfGetDelivDate();
@@ -208,5 +206,5 @@
             SC_Utils_Ex::sfDispSiteError(SOLD_OUT, '', true);
         }
-        
+
         $this->arrData = $objDb->sfTotalConfirm(array(), $this, $objCartSess);
 
@@ -370,7 +368,7 @@
             $_POST['use_point'] = "0";
         }
-        
+
         if (!isset($_POST['point_check'])) $_POST['point_check'] = "";
-        
+
         if($_POST['point_check'] == '1') {
             $objErr->doFunc(array("ポイントを使用する", "point_check"), array("EXIST_CHECK"));
@@ -419,5 +417,5 @@
     function lfRegistData($uniqid) {
         $objDb = new SC_Helper_DB_Ex();
-        
+
         $sqlval = $this->objFormParam->getDbArray();
         // 登録データの作成
@@ -526,5 +524,4 @@
     //一時受注テーブルからの情報を格納する
     function lfSetOrderTempData($uniqid) {
-
         $objQuery = new SC_Query();
         $col = "payment_id, use_point, deliv_time_id, message, point_check, deliv_date";
@@ -548,4 +545,16 @@
         return $img_show;
     }
+
+    /* 配送時間の配列を生成 */
+    function lfSetDelivTime() {
+        $objDb = new SC_Helper_DB_Ex();
+        $objJson = new Services_JSON;
+
+        // 配送時間の取得
+        $arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
+        // JSONエンコード
+        echo $objJson->encode($arrRet);
+        exit;
+    }
 }
 ?>
Index: /branches/comu-ver2/data/Smarty/templates/default/shopping/payment.tpl
===================================================================
--- /branches/comu-ver2/data/Smarty/templates/default/shopping/payment.tpl	(revision 18311)
+++ /branches/comu-ver2/data/Smarty/templates/default/shopping/payment.tpl	(revision 18358)
@@ -46,5 +46,5 @@
                     <!--{section name=cnt loop=$arrPayment}-->
                     <tr>
-                        <td class="centertd"><input type="radio" id="pay_<!--{$smarty.section.cnt.iteration}-->" name="<!--{$key}-->" onclick="fnModeSubmit('payment', '', '');" value="<!--{$arrPayment[cnt].payment_id}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" <!--{$arrPayment[cnt].payment_id|sfGetChecked:$arrForm[$key].value}--> />
+                        <td class="centertd"><input type="radio" id="pay_<!--{$smarty.section.cnt.iteration}-->" name="<!--{$key}-->" onclick="fnSetDelivTime('payment','<!--{$key}-->','deliv_time_id');" value="<!--{$arrPayment[cnt].payment_id}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" <!--{$arrPayment[cnt].payment_id|sfGetChecked:$arrForm[$key].value}--> />
                         </td>
                         <td>
@@ -83,5 +83,5 @@
                     <span class="attention"><!--{$arrErr[$key]}--></span>
                     <em>お届け時間：</em>
-                    <select name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
+                    <select name="<!--{$key}-->" id="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
                         <option value="" selected="">指定なし</option>
                         <!--{html_options options=$arrDelivTime selected=$arrForm[$key].value}-->
Index: /branches/comu-ver2/html/user_data/packages/default/js/site.js
===================================================================
--- /branches/comu-ver2/html/user_data/packages/default/js/site.js	(revision 18357)
+++ /branches/comu-ver2/html/user_data/packages/default/js/site.js	(revision 18358)
@@ -382,2 +382,43 @@
 }
 
+// お届け時間のリアル反映
+function fnSetDelivTime(mode, r_key, s_id) {
+    var f_key, f_val;
+    var f_cnt = document.form1.length;
+    var f_data = "mode=" + mode;
+
+    // formデータの形成
+    for (i = 0; i < f_cnt; i++) {
+        f_key = document.form1[i].name;
+        f_val = document.form1[i].value;
+        if (f_key != "mode") {
+            if (f_key == r_key) {
+                if (document.form1[i].checked === true) {
+                    f_data += "&" + f_key + "=" + f_val;
+                }
+            } else {
+                f_data += "&" + f_key + "=" + f_val;
+            }
+        }
+    }
+
+    // AJAX
+    $.ajax({
+        type: "POST",
+        url: document.form1.action,
+        data: f_data,
+        dataType: "json",
+        success: function(data) {
+            var elm_s = "select#" + s_id;
+            var elm_o = elm_s + " option";
+            $(elm_o).remove();
+            $(elm_s).append($('<option>').attr({value: ""}).text("指定なし"));
+            for (i = 0; i < data.length; i++) {
+                if (data[i].time_id > 0) {
+                    $(elm_s).append($('<option>').attr({value: data[i].time_id}).text(data[i].deliv_time));
+                    $(elm_s).width();
+                }
+            }
+        }
+    });
+}
