Changeset 1732 for temp/trunk
- Timestamp:
- 2006/08/24 17:55:54 (20 years ago)
- Location:
- temp/trunk
- Files:
-
- 3 edited
-
data/Smarty/templates/admin/products/test.tpl (modified) (previous)
-
data/lib/slib.php (modified) (1 diff)
-
html/admin/products/index2.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/data/lib/slib.php
r1730 r1732 1745 1745 // ¥»¥Ã¥·¥ç¥ó³«»Ï 1746 1746 session_start(); 1747 1747 1748 1748 1749 sfprintr("session start!!"); 1749 1750 } 1750 1751 1751 } 1752 1752 } -
temp/trunk/html/admin/products/index2.php
r1730 r1732 11 11 function LC_Page() { 12 12 $this->tpl_mainpage = 'products/test.tpl'; 13 $this->tpl_subnavi = 'products/subnavi.tpl'; 13 14 $this->tpl_mainno = 'products'; 14 $this->tpl_subnavi = 'products/subnavi.tpl';15 15 $this->tpl_subno = 'index'; 16 $this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl';17 $this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿';18 19 16 global $arrPageMax; 20 17 $this->arrPageMax = $arrPageMax; … … 25 22 global $arrPRODUCTSTATUS_COLOR; 26 23 $this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR; 27 28 } 29 } 30 31 $conn = new SC_DBConn(); 24 } 25 } 26 32 27 $objPage = new LC_Page(); 33 28 $objView = new SC_AdminView(); 34 29 $objSess = new SC_Session(); 35 30 $objDate = new SC_Date(); 36 31 … … 48 43 $objPage->arrEndDay = $objDate->getDay(); 49 44 50 session_destroy();51 52 45 // ǧ¾Ú²ÄÈݤÎȽÄê 53 46 $objSess = new SC_Session(); 54 //sfIsSuccess($objSess); 55 56 sfprintr($_SESSION); 57 58 //¥¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ 59 if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") { 60 $objQuery = new SC_Query(); 61 $search_data = $objQuery->get("dtb_campaign", "search_condition", "campaign_id = ? ", array($_POST['campaign_id'])); 62 $arrSearch = unserialize($search_data); 63 foreach ($arrSearch as $key => $val) { 64 $_POST[$key] = $val; 65 } 66 } 47 sfIsSuccess($objSess); 67 48 68 49 // POSTÃͤΰú¤·Ñ¤® … … 71 52 // ¸¡º÷¥ï¡¼¥É¤Î°ú¤·Ñ¤® 72 53 foreach ($_POST as $key => $val) { 73 if (ereg("^search_", $key) || ereg("^campaign_", $key)) {54 if (ereg("^search_", $key)) { 74 55 switch($key) { 75 56 case 'search_product_flag': … … 102 83 $objQuery = new SC_Query(); 103 84 $objQuery->delete("dtb_products_class", "product_id = ?", array($_POST['product_id'])); 104 105 // ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô 106 sfCategory_Count($objQuery); 107 } 108 109 110 if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") { 85 } 86 87 if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all") { 111 88 // ÆþÎÏʸ»ú¤Î¶¯À©ÊÑ´¹ 112 89 lfConvertParam(); … … 115 92 116 93 $where = "delete = 0"; 117 118 / / ÆþÎÏ¥¨¥é¡¼¤Ê¤·94 95 /* ÆþÎÏ¥¨¥é¡¼¤Ê¤· */ 119 96 if (count($objPage->arrErr) == 0) { 120 121 foreach ($objPage->arrForm as $key => $val) { 97 foreach ($objPage->arrForm as $key => $val) { 122 98 123 99 $val = sfManualEscape($val); … … 128 104 129 105 switch ($key) { 130 case 'search_product_id':131 $where .= " AND product_id = ?";132 $arrval[] = $val;133 break;134 case 'search_product_class_id':135 $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_class_id = ?)";136 $arrval[] = $val;137 break;138 106 case 'search_name': 139 107 $where .= " AND name ILIKE ?"; … … 149 117 case 'search_product_code': 150 118 $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)"; 119 $where .= " OR product_code ILIKE ?"; 120 $arrval[] = "%$val%"; 151 121 $arrval[] = "%$val%"; 152 122 break; … … 157 127 break; 158 128 case 'search_endyear': 159 $date = sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday'] );129 $date = sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday'], true); 160 130 $where.= " AND update_date <= ?"; 161 131 $arrval[] = $date; … … 174 144 if ($element != ""){ 175 145 if ($tmp_where == ""){ 176 $tmp_where.="AND (status LIKE ? "; 146 $tmp_where.="AND (status LIKE ? "; 177 147 }else{ 178 148 $tmp_where.="OR status LIKE ? "; … … 181 151 } 182 152 } 183 if ($tmp_where != ""){ 184 $tmp_where.=")"; 185 $where.= "$tmp_where"; 186 } 153 154 if ($tmp_where != ""){ 155 $tmp_where.=")"; 156 $where.= "$tmp_where"; 157 } 187 158 break; 188 159 default: … … 190 161 } 191 162 } 192 163 193 164 $order = "update_date DESC"; 194 165 $objQuery = new SC_Query(); … … 199 170 $option = "ORDER BY $order"; 200 171 // CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ® 201 $arrOutput = sfSwapArray(sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1")); 202 203 if (count($arrOutput) <= 0) break; 204 205 $arrOutputCols = $arrOutput['col']; 206 $arrOutputTitle = $arrOutput['disp_name']; 207 208 $head = sfGetCSVList($arrOutputTitle); 209 210 $data = lfGetProductsCSV($where, $option, $arrval, $arrOutputCols); 211 172 $head = sfGetCSVList($arrPRODUCTS_CVSTITLE); 173 $data = lfGetProductsCSV($where, $option, $arrval); 212 174 // CSV¤òÁ÷¿®¤¹¤ë¡£ 213 175 sfCSVDownload($head.$data); … … 217 179 // ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æºï½ü 218 180 $where = "product_id IN (SELECT product_id FROM vw_products_nonclass WHERE $where)"; 181 $sqlval['rank'] = 0; 219 182 $sqlval['delete'] = 1; 220 183 $objQuery->update("dtb_products", $sqlval, $where, $arrval); … … 224 187 $col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited"; 225 188 $from = "vw_products_nonclass"; 226 189 227 190 // ¹Ô¿ô¤Î¼èÆÀ 228 191 $linemax = $objQuery->count($from, $where, $arrval); 229 192 $objPage->tpl_linemax = $linemax; // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 230 193 231 194 // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý 232 195 if(is_numeric($_POST['search_page_max'])) { … … 235 198 $page_max = SEARCH_PMAX; 236 199 } 237 200 238 201 // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 239 202 $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX); 203 $objPage->tpl_strnavi = $objNavi->strnavi; // ɽ¼¨Ê¸»úÎó 240 204 $startno = $objNavi->start_row; 241 $objPage->arrPagenavi = $objNavi->arrPagenavi;242 243 //¥¥ã¥ó¥Ú¡¼¥ó¾¦Éʸ¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊǼ¤¹¤ë244 if($_POST['search_mode'] == 'campaign') {245 $arrRet = $objQuery->select($col, $from, $where, $arrval);246 if(count($arrRet) > 0) {247 $arrRet = sfSwapArray($arrRet);248 $pid = implode("-", $arrRet['product_id']);249 $objPage->arrHidden['campaign_product_id'] = $pid;250 }251 }252 253 205 // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 254 206 $objQuery->setlimitoffset($page_max, $startno); … … 256 208 $objQuery->setorder($order); 257 209 // ¸¡º÷·ë²Ì¤Î¼èÆÀ 258 $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 259 210 $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 260 211 break; 261 212 } … … 273 224 //--------------------------------------------------------------------------------------------------------------------------------------------------------- 274 225 275 / / ¼èÆÀʸ»úÎó¤ÎÊÑ´¹226 /* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹ */ 276 227 function lfConvertParam() { 277 228 global $objPage; … … 295 246 } 296 247 297 / / ¥¨¥é¡¼¥Á¥§¥Ã¥¯248 /* ¥¨¥é¡¼¥Á¥§¥Ã¥¯ */ 298 249 // ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 299 250 function lfCheckError() { … … 333 284 return $arrRet; 334 285 } 335 336 ?>
Note: See TracChangeset
for help on using the changeset viewer.
