Changeset 1732 for temp/trunk


Ignore:
Timestamp:
2006/08/24 17:55:54 (20 years ago)
Author:
kakinaka
Message:

blank

Location:
temp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/data/lib/slib.php

    r1730 r1732  
    17451745            // ¥»¥Ã¥·¥ç¥ó³«»Ï 
    17461746            session_start(); 
    1747              
     1747 
     1748                         
    17481749            sfprintr("session start!!"); 
    17491750        } 
    1750  
    17511751    } 
    17521752} 
  • temp/trunk/html/admin/products/index2.php

    r1730 r1732  
    1111    function LC_Page() { 
    1212        $this->tpl_mainpage = 'products/test.tpl'; 
     13        $this->tpl_subnavi = 'products/subnavi.tpl'; 
    1314        $this->tpl_mainno = 'products'; 
    14         $this->tpl_subnavi = 'products/subnavi.tpl'; 
    1515        $this->tpl_subno = 'index'; 
    16         $this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl'; 
    17         $this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿'; 
    18  
    1916        global $arrPageMax; 
    2017        $this->arrPageMax = $arrPageMax; 
     
    2522        global $arrPRODUCTSTATUS_COLOR; 
    2623        $this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR; 
    27  
    28     } 
    29 } 
    30  
    31 $conn = new SC_DBConn(); 
     24    } 
     25} 
     26 
    3227$objPage = new LC_Page(); 
    3328$objView = new SC_AdminView(); 
    34  
     29$objSess = new SC_Session(); 
    3530$objDate = new SC_Date(); 
    3631 
     
    4843$objPage->arrEndDay = $objDate->getDay(); 
    4944 
    50 session_destroy(); 
    51  
    5245// ǧ¾Ú²ÄÈݤÎȽÄê 
    5346$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 } 
     47sfIsSuccess($objSess); 
    6748 
    6849// POSTÃͤΰú¤­·Ñ¤® 
     
    7152// ¸¡º÷¥ï¡¼¥É¤Î°ú¤­·Ñ¤® 
    7253foreach ($_POST as $key => $val) { 
    73     if (ereg("^search_", $key) || ereg("^campaign_", $key)) { 
     54    if (ereg("^search_", $key)) { 
    7455        switch($key) { 
    7556            case 'search_product_flag': 
     
    10283    $objQuery = new SC_Query(); 
    10384    $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 
     87if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all") { 
    11188    // ÆþÎÏʸ»ú¤Î¶¯À©ÊÑ´¹ 
    11289    lfConvertParam(); 
     
    11592 
    11693    $where = "delete = 0"; 
    117  
    118     // ÆþÎÏ¥¨¥é¡¼¤Ê¤· 
     94     
     95    /* ÆþÎÏ¥¨¥é¡¼¤Ê¤· */ 
    11996    if (count($objPage->arrErr) == 0) { 
    120  
    121         foreach ($objPage->arrForm as $key => $val) { 
     97            foreach ($objPage->arrForm as $key => $val) { 
    12298                 
    12399            $val = sfManualEscape($val); 
     
    128104             
    129105            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; 
    138106                case 'search_name': 
    139107                    $where .= " AND name ILIKE ?"; 
     
    149117                case 'search_product_code': 
    150118                    $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%"; 
    151121                    $arrval[] = "%$val%"; 
    152122                    break; 
     
    157127                    break; 
    158128                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); 
    160130                    $where.= " AND update_date <= ?"; 
    161131                    $arrval[] = $date; 
     
    174144                        if ($element != ""){ 
    175145                            if ($tmp_where == ""){ 
    176                                 $tmp_where.="AND (status LIKE ? "; 
     146                                $tmp_where.="AND (status LIKE ? ";  
    177147                            }else{ 
    178148                                $tmp_where.="OR status LIKE ? "; 
     
    181151                        } 
    182152                    } 
    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                        }    
    187158                    break; 
    188159                default: 
     
    190161            } 
    191162        } 
    192  
     163         
    193164        $order = "update_date DESC"; 
    194165        $objQuery = new SC_Query(); 
     
    199170            $option = "ORDER BY $order"; 
    200171            // 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); 
    212174            // CSV¤òÁ÷¿®¤¹¤ë¡£ 
    213175            sfCSVDownload($head.$data); 
     
    217179            // ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æºï½ü 
    218180            $where = "product_id IN (SELECT product_id FROM vw_products_nonclass WHERE $where)"; 
     181            $sqlval['rank'] = 0; 
    219182            $sqlval['delete'] = 1; 
    220183            $objQuery->update("dtb_products", $sqlval, $where, $arrval); 
     
    224187            $col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited"; 
    225188            $from = "vw_products_nonclass"; 
    226  
     189                 
    227190            // ¹Ô¿ô¤Î¼èÆÀ 
    228191            $linemax = $objQuery->count($from, $where, $arrval); 
    229192            $objPage->tpl_linemax = $linemax;               // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 
    230  
     193             
    231194            // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý 
    232195            if(is_numeric($_POST['search_page_max'])) {  
     
    235198                $page_max = SEARCH_PMAX; 
    236199            } 
    237  
     200             
    238201            // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 
    239202            $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX); 
     203            $objPage->tpl_strnavi = $objNavi->strnavi;      // ɽ¼¨Ê¸»úÎó 
    240204            $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  
    253205            // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 
    254206            $objQuery->setlimitoffset($page_max, $startno); 
     
    256208            $objQuery->setorder($order); 
    257209            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    258             $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 
    259  
     210            $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval);     
    260211            break; 
    261212        } 
     
    273224//--------------------------------------------------------------------------------------------------------------------------------------------------------- 
    274225 
    275 // ¼èÆÀʸ»úÎó¤ÎÊÑ´¹  
     226/* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹ */ 
    276227function lfConvertParam() { 
    277228    global $objPage; 
     
    295246} 
    296247 
    297 // ¥¨¥é¡¼¥Á¥§¥Ã¥¯  
     248/* ¥¨¥é¡¼¥Á¥§¥Ã¥¯ */ 
    298249// ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
    299250function lfCheckError() { 
     
    333284    return $arrRet; 
    334285} 
    335  
    336 ?> 
Note: See TracChangeset for help on using the changeset viewer.