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