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

blank

File:
1 edited

Legend:

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

    r1862 r1863  
    33require_once("../require.php"); 
    44require_once("./index_csv.php"); 
    5 require_once(ROOT_DIR . "data/lib/ftp.php"); 
    65 
    76class LC_Page { 
     
    1211    function LC_Page() { 
    1312        $this->tpl_mainpage = 'products/index.tpl'; 
     13        $this->tpl_mainno = 'products'; 
    1414        $this->tpl_subnavi = 'products/subnavi.tpl'; 
    15         $this->tpl_mainno = 'products'; 
    1615        $this->tpl_subno = 'index'; 
     16        $this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl'; 
     17        $this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿'; 
     18 
    1719        global $arrPageMax; 
    1820        $this->arrPageMax = $arrPageMax; 
     
    2325        global $arrPRODUCTSTATUS_COLOR; 
    2426        $this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR; 
    25     } 
    26 } 
    27  
     27 
     28    } 
     29} 
     30 
     31//$conn = new SC_DBConn(); 
    2832$objPage = new LC_Page(); 
    2933$objView = new SC_AdminView(); 
    30 $objSess = new SC_Session(); 
     34 
    3135$objDate = new SC_Date(); 
    3236 
     
    4751$objSess = new SC_Session(); 
    4852sfIsSuccess($objSess); 
     53 
    4954//¥­¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ 
    5055if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") { 
     
    8388// ¾¦Éʺï½ü 
    8489if ($_POST['mode'] == "delete") { 
    85     // ¾¦ÉʤËɳ¤Å¤¤¤¿¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë 
    86     lfDeleteProductFiles($_POST['product_id']); 
    87      
    8890    if($_POST['category_id'] != "") { 
    8991        // ¥é¥ó¥¯ÉÕ¤­¥ì¥³¡¼¥É¤Îºï½ü 
     
    98100     
    99101    // ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô 
    100     $objQuery->getall("SELECT category_count();");   
    101 } 
     102    sfCategory_Count($objQuery);     
     103} 
     104 
    102105 
    103106if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") { 
     
    108111 
    109112    $where = "delete = 0"; 
    110      
    111     /* ÆþÎÏ¥¨¥é¡¼¤Ê¤· */ 
     113 
     114    // ÆþÎÏ¥¨¥é¡¼¤Ê¤· 
    112115    if (count($objPage->arrErr) == 0) { 
    113             foreach ($objPage->arrForm as $key => $val) { 
     116 
     117        foreach ($objPage->arrForm as $key => $val) { 
    114118                 
    115119            $val = sfManualEscape($val); 
     
    166170                        if ($element != ""){ 
    167171                            if ($tmp_where == ""){ 
    168                                 $tmp_where.="AND (status LIKE ? ";  
     172                                $tmp_where.="AND (status LIKE ? "; 
    169173                            }else{ 
    170174                                $tmp_where.="OR status LIKE ? "; 
     
    176180                        $tmp_where.=")"; 
    177181                        $where.= "$tmp_where"; 
    178                     }    
     182                    } 
    179183                    break; 
    180184                default: 
     
    182186            } 
    183187        } 
    184          
     188 
    185189        $order = "update_date DESC"; 
    186190        $objQuery = new SC_Query(); 
     
    191195            $option = "ORDER BY $order"; 
    192196            // 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 
    195208            // CSV¤òÁ÷¿®¤¹¤ë¡£ 
    196209            sfCSVDownload($head.$data); 
     
    207220            $col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited"; 
    208221            $from = "vw_products_nonclass"; 
    209                  
     222 
    210223            // ¹Ô¿ô¤Î¼èÆÀ 
    211224            $linemax = $objQuery->count($from, $where, $arrval); 
    212225            $objPage->tpl_linemax = $linemax;               // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 
    213              
     226 
    214227            // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý 
    215228            if(is_numeric($_POST['search_page_max'])) {  
     
    218231                $page_max = SEARCH_PMAX; 
    219232            } 
    220              
     233 
    221234            // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 
    222235            $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX); 
    223             $objPage->tpl_strnavi = $objNavi->strnavi;      // ɽ¼¨Ê¸»úÎó 
    224236            $startno = $objNavi->start_row; 
     237            $objPage->arrPagenavi = $objNavi->arrPagenavi; 
    225238             
    226239            //¥­¥ã¥ó¥Ú¡¼¥ó¾¦Éʸ¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊǼ¤¹¤ë 
     
    233246                } 
    234247            } 
    235              
     248 
    236249            // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 
    237250            $objQuery->setlimitoffset($page_max, $startno); 
     
    240253            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    241254            $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 
    242              
     255 
    243256            break; 
    244257        } 
     
    256269//--------------------------------------------------------------------------------------------------------------------------------------------------------- 
    257270 
    258 /* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹ */ 
     271// ¼èÆÀʸ»úÎó¤ÎÊÑ´¹  
    259272function lfConvertParam() { 
    260273    global $objPage; 
     
    278291} 
    279292 
    280 /* ¥¨¥é¡¼¥Á¥§¥Ã¥¯ */ 
     293// ¥¨¥é¡¼¥Á¥§¥Ã¥¯  
    281294// ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
    282295function lfCheckError() { 
    283296    $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")); 
    286297    $objErr->doFunc(array("³«»ÏÆü", "search_startyear", "search_startmonth", "search_startday"), array("CHECK_DATE")); 
    287298    $objErr->doFunc(array("½ªÎ»Æü", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_DATE")); 
     
    319330} 
    320331 
    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  
    345332?> 
Note: See TracChangeset for help on using the changeset viewer.