Changeset 1862 for temp/trunk/html/admin/products
- Timestamp:
- 2006/08/24 21:01:30 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/html/admin/products/index.php (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/html/admin/products/index.php
r1810 r1862 3 3 require_once("../require.php"); 4 4 require_once("./index_csv.php"); 5 require_once(ROOT_DIR . "data/lib/ftp.php"); 5 6 6 7 class LC_Page { … … 11 12 function LC_Page() { 12 13 $this->tpl_mainpage = 'products/index.tpl'; 14 $this->tpl_subnavi = 'products/subnavi.tpl'; 13 15 $this->tpl_mainno = 'products'; 14 $this->tpl_subnavi = 'products/subnavi.tpl';15 16 $this->tpl_subno = 'index'; 16 $this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl';17 $this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿';18 19 17 global $arrPageMax; 20 18 $this->arrPageMax = $arrPageMax; … … 25 23 global $arrPRODUCTSTATUS_COLOR; 26 24 $this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR; 27 28 } 29 } 30 31 //$conn = new SC_DBConn(); 25 } 26 } 27 32 28 $objPage = new LC_Page(); 33 29 $objView = new SC_AdminView(); 34 30 $objSess = new SC_Session(); 35 31 $objDate = new SC_Date(); 36 32 … … 51 47 $objSess = new SC_Session(); 52 48 sfIsSuccess($objSess); 53 54 49 //¥¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ 55 50 if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") { … … 88 83 // ¾¦Éʺï½ü 89 84 if ($_POST['mode'] == "delete") { 85 // ¾¦ÉʤËɳ¤Å¤¤¤¿¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë 86 lfDeleteProductFiles($_POST['product_id']); 87 90 88 if($_POST['category_id'] != "") { 91 89 // ¥é¥ó¥¯ÉÕ¤¥ì¥³¡¼¥É¤Îºï½ü … … 100 98 101 99 // ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô 102 sfCategory_Count($objQuery); 103 } 104 100 $objQuery->getall("SELECT category_count();"); 101 } 105 102 106 103 if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") { … … 111 108 112 109 $where = "delete = 0"; 113 114 / / ÆþÎÏ¥¨¥é¡¼¤Ê¤·110 111 /* ÆþÎÏ¥¨¥é¡¼¤Ê¤· */ 115 112 if (count($objPage->arrErr) == 0) { 116 117 foreach ($objPage->arrForm as $key => $val) { 113 foreach ($objPage->arrForm as $key => $val) { 118 114 119 115 $val = sfManualEscape($val); … … 170 166 if ($element != ""){ 171 167 if ($tmp_where == ""){ 172 $tmp_where.="AND (status LIKE ? "; 168 $tmp_where.="AND (status LIKE ? "; 173 169 }else{ 174 170 $tmp_where.="OR status LIKE ? "; … … 180 176 $tmp_where.=")"; 181 177 $where.= "$tmp_where"; 182 } 178 } 183 179 break; 184 180 default: … … 186 182 } 187 183 } 188 184 189 185 $order = "update_date DESC"; 190 186 $objQuery = new SC_Query(); … … 195 191 $option = "ORDER BY $order"; 196 192 // CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ® 197 $arrOutput = sfSwapArray(sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1")); 198 199 if (count($arrOutput) <= 0) break; 200 201 $arrOutputCols = $arrOutput['col']; 202 $arrOutputTitle = $arrOutput['disp_name']; 203 204 $head = sfGetCSVList($arrOutputTitle); 205 206 $data = lfGetProductsCSV($where, $option, $arrval, $arrOutputCols); 207 193 $head = sfGetCSVList($arrPRODUCTS_CVSTITLE); 194 $data = lfGetProductsCSV($where, $option, $arrval); 208 195 // CSV¤òÁ÷¿®¤¹¤ë¡£ 209 196 sfCSVDownload($head.$data); … … 220 207 $col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited"; 221 208 $from = "vw_products_nonclass"; 222 209 223 210 // ¹Ô¿ô¤Î¼èÆÀ 224 211 $linemax = $objQuery->count($from, $where, $arrval); 225 212 $objPage->tpl_linemax = $linemax; // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 226 213 227 214 // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý 228 215 if(is_numeric($_POST['search_page_max'])) { … … 231 218 $page_max = SEARCH_PMAX; 232 219 } 233 220 234 221 // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 235 222 $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX); 223 $objPage->tpl_strnavi = $objNavi->strnavi; // ɽ¼¨Ê¸»úÎó 236 224 $startno = $objNavi->start_row; 237 $objPage->arrPagenavi = $objNavi->arrPagenavi;238 225 239 226 //¥¥ã¥ó¥Ú¡¼¥ó¾¦Éʸ¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊǼ¤¹¤ë … … 246 233 } 247 234 } 248 235 249 236 // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 250 237 $objQuery->setlimitoffset($page_max, $startno); … … 253 240 // ¸¡º÷·ë²Ì¤Î¼èÆÀ 254 241 $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 255 242 256 243 break; 257 244 } … … 269 256 //--------------------------------------------------------------------------------------------------------------------------------------------------------- 270 257 271 / / ¼èÆÀʸ»úÎó¤ÎÊÑ´¹258 /* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹ */ 272 259 function lfConvertParam() { 273 260 global $objPage; … … 291 278 } 292 279 293 / / ¥¨¥é¡¼¥Á¥§¥Ã¥¯280 /* ¥¨¥é¡¼¥Á¥§¥Ã¥¯ */ 294 281 // ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 295 282 function lfCheckError() { 296 283 $objErr = new SC_CheckError(); 284 $objErr->doFunc(array("¾¦ÉÊID", "search_product_id", INT_LEN), array("NUM_CHECK")); 285 $objErr->doFunc(array("µ¬³ÊID", "search_product_class_id", INT_LEN), array("NUM_CHECK")); 297 286 $objErr->doFunc(array("³«»ÏÆü", "search_startyear", "search_startmonth", "search_startday"), array("CHECK_DATE")); 298 287 $objErr->doFunc(array("½ªÎ»Æü", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_DATE")); … … 330 319 } 331 320 321 // ¾¦Éʥ쥳¡¼¥É¤Ëɳ¤Å¤¯²èÁü¤òºï½ü¤¹¤ë 322 function lfDeleteProductFiles($product_id) { 323 global $arrWEB_SERVERS; 324 $objQuery = new SC_Query(); 325 $col = "file1,file2,file3,file4,file5,file6,main_list_image,main_image,main_large_image,sub_large_image1,sub_large_image2,sub_large_image3,sub_large_image4,sub_large_image5,sub_large_image6"; 326 $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($product_id)); 327 foreach($arrRet[0] as $file) { 328 if($file != "") { 329 // ¼«Ê¬¼«¿È¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë 330 $path = IMAGE_SAVE_DIR . $file; 331 if(file_exists($path)) { 332 unlink($path); 333 } 334 // ¼«Ê¬¼«¿È°Ê³°¤Î¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë 335 foreach($arrWEB_SERVERS as $array) { 336 if($array['host'] != $_SERVER["SERVER_ADDR"]) { 337 $path = FTP_IMAGE_SAVE_DIR . $file; 338 sfFtpDelete($array['host'], $array['user'], $array['pass'], $path); 339 } 340 } 341 } 342 } 343 } 344 332 345 ?>
Note: See TracChangeset
for help on using the changeset viewer.
