Index: branches/version-2_11-dev/data/class/SC_SelectSql.php
===================================================================
--- branches/version-2_11-dev/data/class/SC_SelectSql.php	(revision 20764)
+++ branches/version-2_11-dev/data/class/SC_SelectSql.php	(revision 21269)
@@ -88,4 +88,5 @@
     //--　期間検索（○年○月○日か~○年○月○日まで）
     function selectTermRange($from_year, $from_month, $from_day, $to_year, $to_month, $to_day, $column) {
+        $return = array();
 
         // 開始期間の構築
@@ -102,5 +103,6 @@
         // 開始期間だけ指定の場合
         if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && ( $to_year == "" ) && ( $to_month == "" ) && ( $to_day == "" ) ) {
-            $this->setWhere( $column ." >= '" . $date1 . "'");
+            $this->setWhere( $column .' >= ?');
+            $return[] = $date1;
         }
 
@@ -108,11 +110,16 @@
         if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) &&
             ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) {
-            $this->setWhere( $column ." >= '" . $date1 ."' AND ". $column . " < date('" . $date2 . "')" );
+            $this->setWhere( $column . ' >= ? AND ' . $column . ' < date(?)' );
+            $return[] = $date1;
+            $return[] = $date2;
         }
 
         // 終了期間だけ指定の場合
         if( ( $from_year == "" ) && ( $from_month == "" ) && ( $from_day == "" ) && ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) {
-            $this->setWhere( $column ." < date('" . $date2 . "')");
-        }
+            $this->setWhere( $column . ' < date(?)');
+            $return[] = $date2;
+        }
+
+        return $return;
     }
 
Index: branches/version-2_11-dev/data/class/SC_CustomerList.php
===================================================================
--- branches/version-2_11-dev/data/class/SC_CustomerList.php	(revision 21118)
+++ branches/version-2_11-dev/data/class/SC_CustomerList.php	(revision 21269)
@@ -213,6 +213,6 @@
         if( is_numeric( $this->arrSql["search_buy_total_from"] ) || is_numeric( $this->arrSql["search_buy_total_to"] ) ) {
             $arrBuyTotal = $this->selectRange($this->arrSql["search_buy_total_from"], $this->arrSql["search_buy_total_to"], "buy_total");
-            foreach ($arrBuyTotal as $data1) {
-                $this->arrVal[] = $data1;
+            foreach ($arrBuyTotal as $data) {
+                $this->arrVal[] = $data;
             }
         }
@@ -223,6 +223,6 @@
         if( is_numeric( $this->arrSql["search_buy_times_from"] ) || is_numeric( $this->arrSql["search_buy_times_to"] ) ) {
             $arrBuyTimes = $this->selectRange($this->arrSql["search_buy_times_from"], $this->arrSql["search_buy_times_to"], "buy_times");
-            foreach ($arrBuyTimes as $data2) {
-                $this->arrVal[] = $data2;
+            foreach ($arrBuyTimes as $data) {
+                $this->arrVal[] = $data;
             }
         }
@@ -240,8 +240,6 @@
             $arrBirth = $this->selectTermRange($this->arrSql['search_b_start_year'], $this->arrSql['search_b_start_month'], $this->arrSql['search_b_start_day']
                       , $this->arrSql['search_b_end_year'], $this->arrSql['search_b_end_month'], $this->arrSql['search_b_end_day'], 'birth');
-            if (is_array($arrBirth)) {
-                foreach ($arrBirth as $data3) {
-                    $this->arrVal[] = $data3;
-                }
+            foreach ($arrBirth as $data) {
+                $this->arrVal[] = $data;
             }
         }
@@ -266,8 +264,6 @@
             $arrRegistTime = $this->selectTermRange($this->arrSql['search_start_year'], $this->arrSql['search_start_month'], $this->arrSql['search_start_day']
                             , $this->arrSql['search_end_year'], $this->arrSql['search_end_month'], $this->arrSql['search_end_day'], $regdate_col);
-            if (is_array($arrRegistTime)) {
-                foreach ($arrRegistTime as $data4) {
-                    $this->arrVal[] = $data4;
-                }
+            foreach ($arrRegistTime as $data) {
+                $this->arrVal[] = $data;
             }
         }
@@ -285,8 +281,6 @@
             $arrRegistTime = $this->selectTermRange($this->arrSql['search_buy_start_year'], $this->arrSql['search_buy_start_month'], $this->arrSql['search_buy_start_day']
                             , $this->arrSql['search_buy_end_year'], $this->arrSql['search_buy_end_month'], $this->arrSql['search_buy_end_day'], "last_buy_date");
-            if (is_array($arrRegistTime)) {
-                foreach ($arrRegistTime as $data4) {
-                    $this->arrVal[] = $data4;
-                }
+            foreach ($arrRegistTime as $data) {
+                $this->arrVal[] = $data;
             }
         }
