Index: temp/trunk/html/admin/products/index2.php
===================================================================
--- temp/trunk/html/admin/products/index2.php	(revision 1730)
+++ temp/trunk/html/admin/products/index2.php	(revision 1732)
@@ -11,10 +11,7 @@
 	function LC_Page() {
 		$this->tpl_mainpage = 'products/test.tpl';
+		$this->tpl_subnavi = 'products/subnavi.tpl';
 		$this->tpl_mainno = 'products';
-		$this->tpl_subnavi = 'products/subnavi.tpl';
 		$this->tpl_subno = 'index';
-		$this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl';
-		$this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿';
-
 		global $arrPageMax;
 		$this->arrPageMax = $arrPageMax;
@@ -25,12 +22,10 @@
 		global $arrPRODUCTSTATUS_COLOR;
 		$this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR;
-
-	}
-}
-
-$conn = new SC_DBConn();
+	}
+}
+
 $objPage = new LC_Page();
 $objView = new SC_AdminView();
-
+$objSess = new SC_Session();
 $objDate = new SC_Date();
 
@@ -48,21 +43,7 @@
 $objPage->arrEndDay = $objDate->getDay();
 
-session_destroy();
-
 // Ç§¾Ú²ÄÈÝ¤ÎÈ½Äê
 $objSess = new SC_Session();
-//sfIsSuccess($objSess);
-
-sfprintr($_SESSION);
-
-//¥­¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ
-if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") {
-	$objQuery = new SC_Query();
-	$search_data = $objQuery->get("dtb_campaign", "search_condition", "campaign_id = ? ", array($_POST['campaign_id']));
-	$arrSearch = unserialize($search_data);
-	foreach ($arrSearch as $key => $val) {
-		$_POST[$key] = $val;
-	}
-}
+sfIsSuccess($objSess);
 
 // POSTÃÍ¤Î°ú¤­·Ñ¤®
@@ -71,5 +52,5 @@
 // ¸¡º÷¥ï¡¼¥É¤Î°ú¤­·Ñ¤®
 foreach ($_POST as $key => $val) {
-	if (ereg("^search_", $key) || ereg("^campaign_", $key)) {
+	if (ereg("^search_", $key)) {
 		switch($key) {
 			case 'search_product_flag':
@@ -102,11 +83,7 @@
 	$objQuery = new SC_Query();
 	$objQuery->delete("dtb_products_class", "product_id = ?", array($_POST['product_id']));
-	
-	// ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô
-	sfCategory_Count($objQuery);	
-}
-
-
-if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") {
+}
+
+if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all") {
 	// ÆþÎÏÊ¸»ú¤Î¶¯À©ÊÑ´¹
 	lfConvertParam();
@@ -115,9 +92,8 @@
 
 	$where = "delete = 0";
-
-	// ÆþÎÏ¥¨¥é¡¼¤Ê¤·
+	
+	/* ÆþÎÏ¥¨¥é¡¼¤Ê¤· */
 	if (count($objPage->arrErr) == 0) {
-
-		foreach ($objPage->arrForm as $key => $val) {
+			foreach ($objPage->arrForm as $key => $val) {
 				
 			$val = sfManualEscape($val);
@@ -128,12 +104,4 @@
 			
 			switch ($key) {
-				case 'search_product_id':
-					$where .= " AND product_id = ?";
-					$arrval[] = $val;
-					break;
-				case 'search_product_class_id':
-					$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_class_id = ?)";
-					$arrval[] = $val;
-					break;
 				case 'search_name':
 					$where .= " AND name ILIKE ?";
@@ -149,4 +117,6 @@
 				case 'search_product_code':
 					$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)";
+					$where .= " OR product_code ILIKE ?";
+					$arrval[] = "%$val%";
 					$arrval[] = "%$val%";
 					break;
@@ -157,5 +127,5 @@
 					break;
 				case 'search_endyear':
-					$date = sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']);
+					$date = sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday'], true);
 					$where.= " AND update_date <= ?";
 					$arrval[] = $date;
@@ -174,5 +144,5 @@
 						if ($element != ""){
 							if ($tmp_where == ""){
-								$tmp_where.="AND (status LIKE ? ";
+								$tmp_where.="AND (status LIKE ? "; 
 							}else{
 								$tmp_where.="OR status LIKE ? ";
@@ -181,8 +151,9 @@
 						}
 					}
-					if ($tmp_where != ""){
-						$tmp_where.=")";
-						$where.= "$tmp_where";
-					}
+					
+						if ($tmp_where != ""){
+							$tmp_where.=")";
+							$where.= "$tmp_where";
+						}	
 					break;
 				default:
@@ -190,5 +161,5 @@
 			}
 		}
-
+		
 		$order = "update_date DESC";
 		$objQuery = new SC_Query();
@@ -199,15 +170,6 @@
 			$option = "ORDER BY $order";
 			// CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ®
-			$arrOutput = sfSwapArray(sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1"));
-			
-			if (count($arrOutput) <= 0) break;
-			
-			$arrOutputCols = $arrOutput['col'];
-			$arrOutputTitle = $arrOutput['disp_name'];
-			
-			$head = sfGetCSVList($arrOutputTitle);
-			
-			$data = lfGetProductsCSV($where, $option, $arrval, $arrOutputCols);
-
+			$head = sfGetCSVList($arrPRODUCTS_CVSTITLE);
+			$data = lfGetProductsCSV($where, $option, $arrval);
 			// CSV¤òÁ÷¿®¤¹¤ë¡£
 			sfCSVDownload($head.$data);
@@ -217,4 +179,5 @@
 			// ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æºï½ü
 			$where = "product_id IN (SELECT product_id FROM vw_products_nonclass WHERE $where)";
+			$sqlval['rank'] = 0;
 			$sqlval['delete'] = 1;
 			$objQuery->update("dtb_products", $sqlval, $where, $arrval);
@@ -224,9 +187,9 @@
 			$col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited";
 			$from = "vw_products_nonclass";
-
+				
 			// ¹Ô¿ô¤Î¼èÆÀ
 			$linemax = $objQuery->count($from, $where, $arrval);
 			$objPage->tpl_linemax = $linemax;				// ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ
-
+			
 			// ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý
 			if(is_numeric($_POST['search_page_max'])) {	
@@ -235,20 +198,9 @@
 				$page_max = SEARCH_PMAX;
 			}
-
+			
 			// ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ
 			$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
+			$objPage->tpl_strnavi = $objNavi->strnavi;		// É½¼¨Ê¸»úÎó
 			$startno = $objNavi->start_row;
-			$objPage->arrPagenavi = $objNavi->arrPagenavi;
-			
-			//¥­¥ã¥ó¥Ú¡¼¥ó¾¦ÉÊ¸¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊÇ¼¤¹¤ë
-			if($_POST['search_mode'] == 'campaign') {
-				$arrRet = $objQuery->select($col, $from, $where, $arrval);
-				if(count($arrRet) > 0) {
-					$arrRet = sfSwapArray($arrRet);
-					$pid = implode("-", $arrRet['product_id']);
-					$objPage->arrHidden['campaign_product_id'] = $pid;
-				}
-			}
-
 			// ¼èÆÀÈÏ°Ï¤Î»ØÄê(³«»Ï¹ÔÈÖ¹æ¡¢¹Ô¿ô¤Î¥»¥Ã¥È)
 			$objQuery->setlimitoffset($page_max, $startno);
@@ -256,6 +208,5 @@
 			$objQuery->setorder($order);
 			// ¸¡º÷·ë²Ì¤Î¼èÆÀ
-			$objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval);
-
+			$objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval);	
 			break;
 		}
@@ -273,5 +224,5 @@
 //---------------------------------------------------------------------------------------------------------------------------------------------------------
 
-// ¼èÆÀÊ¸»úÎó¤ÎÊÑ´¹ 
+/* ¼èÆÀÊ¸»úÎó¤ÎÊÑ´¹ */
 function lfConvertParam() {
 	global $objPage;
@@ -295,5 +246,5 @@
 }
 
-// ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
+/* ¥¨¥é¡¼¥Á¥§¥Ã¥¯ */
 // ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
 function lfCheckError() {
@@ -333,4 +284,2 @@
 	return $arrRet;
 }
-
-?>
Index: temp/trunk/data/lib/slib.php
===================================================================
--- temp/trunk/data/lib/slib.php	(revision 1730)
+++ temp/trunk/data/lib/slib.php	(revision 1732)
@@ -1745,8 +1745,8 @@
 			// ¥»¥Ã¥·¥ç¥ó³«»Ï
 			session_start();
-			
+
+						
 			sfprintr("session start!!");
 		}
-
 	}
 }
