Ignore:
Timestamp:
2006/08/24 21:01:30 (20 years ago)
Author:
kakinaka
Message:

blank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/admin/products/index.php

    r1810 r1862  
    33require_once("../require.php"); 
    44require_once("./index_csv.php"); 
     5require_once(ROOT_DIR . "data/lib/ftp.php"); 
    56 
    67class LC_Page { 
     
    1112    function LC_Page() { 
    1213        $this->tpl_mainpage = 'products/index.tpl'; 
     14        $this->tpl_subnavi = 'products/subnavi.tpl'; 
    1315        $this->tpl_mainno = 'products'; 
    14         $this->tpl_subnavi = 'products/subnavi.tpl'; 
    1516        $this->tpl_subno = 'index'; 
    16         $this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl'; 
    17         $this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿'; 
    18  
    1917        global $arrPageMax; 
    2018        $this->arrPageMax = $arrPageMax; 
     
    2523        global $arrPRODUCTSTATUS_COLOR; 
    2624        $this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR; 
    27  
    28     } 
    29 } 
    30  
    31 //$conn = new SC_DBConn(); 
     25    } 
     26} 
     27 
    3228$objPage = new LC_Page(); 
    3329$objView = new SC_AdminView(); 
    34  
     30$objSess = new SC_Session(); 
    3531$objDate = new SC_Date(); 
    3632 
     
    5147$objSess = new SC_Session(); 
    5248sfIsSuccess($objSess); 
    53  
    5449//¥­¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ 
    5550if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") { 
     
    8883// ¾¦Éʺï½ü 
    8984if ($_POST['mode'] == "delete") { 
     85    // ¾¦ÉʤËɳ¤Å¤¤¤¿¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë 
     86    lfDeleteProductFiles($_POST['product_id']); 
     87     
    9088    if($_POST['category_id'] != "") { 
    9189        // ¥é¥ó¥¯ÉÕ¤­¥ì¥³¡¼¥É¤Îºï½ü 
     
    10098     
    10199    // ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô 
    102     sfCategory_Count($objQuery);     
    103 } 
    104  
     100    $objQuery->getall("SELECT category_count();");   
     101} 
    105102 
    106103if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") { 
     
    111108 
    112109    $where = "delete = 0"; 
    113  
    114     // ÆþÎÏ¥¨¥é¡¼¤Ê¤· 
     110     
     111    /* ÆþÎÏ¥¨¥é¡¼¤Ê¤· */ 
    115112    if (count($objPage->arrErr) == 0) { 
    116  
    117         foreach ($objPage->arrForm as $key => $val) { 
     113            foreach ($objPage->arrForm as $key => $val) { 
    118114                 
    119115            $val = sfManualEscape($val); 
     
    170166                        if ($element != ""){ 
    171167                            if ($tmp_where == ""){ 
    172                                 $tmp_where.="AND (status LIKE ? "; 
     168                                $tmp_where.="AND (status LIKE ? ";  
    173169                            }else{ 
    174170                                $tmp_where.="OR status LIKE ? "; 
     
    180176                        $tmp_where.=")"; 
    181177                        $where.= "$tmp_where"; 
    182                     } 
     178                    }    
    183179                    break; 
    184180                default: 
     
    186182            } 
    187183        } 
    188  
     184         
    189185        $order = "update_date DESC"; 
    190186        $objQuery = new SC_Query(); 
     
    195191            $option = "ORDER BY $order"; 
    196192            // 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); 
    208195            // CSV¤òÁ÷¿®¤¹¤ë¡£ 
    209196            sfCSVDownload($head.$data); 
     
    220207            $col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited"; 
    221208            $from = "vw_products_nonclass"; 
    222  
     209                 
    223210            // ¹Ô¿ô¤Î¼èÆÀ 
    224211            $linemax = $objQuery->count($from, $where, $arrval); 
    225212            $objPage->tpl_linemax = $linemax;               // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 
    226  
     213             
    227214            // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý 
    228215            if(is_numeric($_POST['search_page_max'])) {  
     
    231218                $page_max = SEARCH_PMAX; 
    232219            } 
    233  
     220             
    234221            // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 
    235222            $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX); 
     223            $objPage->tpl_strnavi = $objNavi->strnavi;      // ɽ¼¨Ê¸»úÎó 
    236224            $startno = $objNavi->start_row; 
    237             $objPage->arrPagenavi = $objNavi->arrPagenavi; 
    238225             
    239226            //¥­¥ã¥ó¥Ú¡¼¥ó¾¦Éʸ¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊǼ¤¹¤ë 
     
    246233                } 
    247234            } 
    248  
     235             
    249236            // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 
    250237            $objQuery->setlimitoffset($page_max, $startno); 
     
    253240            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    254241            $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 
    255  
     242             
    256243            break; 
    257244        } 
     
    269256//--------------------------------------------------------------------------------------------------------------------------------------------------------- 
    270257 
    271 // ¼èÆÀʸ»úÎó¤ÎÊÑ´¹  
     258/* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹ */ 
    272259function lfConvertParam() { 
    273260    global $objPage; 
     
    291278} 
    292279 
    293 // ¥¨¥é¡¼¥Á¥§¥Ã¥¯  
     280/* ¥¨¥é¡¼¥Á¥§¥Ã¥¯ */ 
    294281// ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
    295282function lfCheckError() { 
    296283    $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")); 
    297286    $objErr->doFunc(array("³«»ÏÆü", "search_startyear", "search_startmonth", "search_startday"), array("CHECK_DATE")); 
    298287    $objErr->doFunc(array("½ªÎ»Æü", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_DATE")); 
     
    330319} 
    331320 
     321// ¾¦Éʥ쥳¡¼¥É¤Ëɳ¤Å¤¯²èÁü¤òºï½ü¤¹¤ë 
     322function 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 
    332345?> 
Note: See TracChangeset for help on using the changeset viewer.