Changeset 11949


Ignore:
Timestamp:
2007/03/22 16:40:42 (17 years ago)
Author:
inoue
Message:

プロトタイプ

Location:
branches/dev/html/admin/products
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/html/admin/products/index_csv.php

    r211 r11949  
    2929                        ); 
    3030 
     31$arrTRACKBACK_CVSTITLE = array( 
     32                        '¾¦ÉÊ̾', 
     33                        '¥Ö¥í¥°Ì¾', 
     34                        '¥Ö¥í¥°µ­»ö¥¿¥¤¥È¥ë', 
     35                        '¥Ö¥í¥°µ­»öÆâÍÆ', 
     36                        '¾õÂÖ', 
     37                        'Åê¹ÆÆü' 
     38                        ); 
     39 
     40$arrTRACKBACK_CVSCOL = array(  
     41                        'B.name', 
     42                        'A.blog_name', 
     43                        'A.title', 
     44                        'A.excerpt', 
     45                        'A.status', 
     46                        'A.create_date' 
     47                        ); 
     48 
    3149// CSV½ÐÎϥǡ¼¥¿¤òºîÀ®¤¹¤ë¡£(¾¦ÉÊ) 
    3250function lfGetProductsCSV($where, $option, $arrval, $arrOutputCols) { 
     
    7290        // ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£ 
    7391        $data .= lfMakeReviewCSV($list_data[$i]); 
     92    } 
     93    return $data; 
     94} 
     95 
     96// CSV½ÐÎϥǡ¼¥¿¤òºîÀ®¤¹¤ë¡£(¥È¥é¥Ã¥¯¥Ð¥Ã¥¯) 
     97function lfGetTrackbackCSV($where, $option, $arrval) { 
     98    global $arrTRACKBACK_CVSCOL; 
     99 
     100    $from = "dtb_trackback AS A INNER JOIN dtb_products AS B on A.product_id = B.product_id "; 
     101    $cols = sfGetCommaList($arrTRACKBACK_CVSCOL); 
     102     
     103    $objQuery = new SC_Query(); 
     104    $objQuery->setoption($option); 
     105     
     106    $list_data = $objQuery->select($cols, $from, $where, $arrval);   
     107 
     108    $max = count($list_data); 
     109    for($i = 0; $i < $max; $i++) { 
     110        // ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£ 
     111        $data .= lfMakeTrackbackCSV($list_data[$i]); 
    74112    } 
    75113    return $data; 
     
    139177} 
    140178 
     179// ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£(¥È¥é¥Ã¥¯¥Ð¥Ã¥¯) 
     180function lfMakeTrackbackCSV($list) { 
     181    global $arrTrackBackStatus; 
     182    global $arrDISP; 
     183     
     184    $line = ""; 
     185     
     186    foreach($list as $key => $val) { 
     187        $tmp = ""; 
     188        switch($key) { 
     189            case 'status': 
     190                $tmp = $arrTrackBackStatus[$val]; 
     191                break; 
     192            default: 
     193                $tmp = $val; 
     194                break; 
     195        } 
     196 
     197        $tmp = ereg_replace("[\",]", " ", $tmp); 
     198        $line .= "\"".$tmp."\","; 
     199    } 
     200    // ʸËö¤Î","¤òÊÑ´¹ 
     201    $line = ereg_replace(",$", "\n", $line); 
     202    return $line; 
     203} 
     204 
    141205?> 
  • branches/dev/html/admin/products/trackback.php

    r11941 r11949  
    4949sfIsSuccess($objSess); 
    5050 
    51 // ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤Î¥«¥é¥à¤Î¼èÆÀ 
    52 $select="trackback_id, tra.product_id, tra.blog_name, tra.title, tra.url, "; 
    53 $select.="tra.excerpt, tra.status, tra.create_date, tra.update_date, pro.name"; 
    54 $from = "dtb_trackback AS tra LEFT JOIN dtb_products AS pro ON tra.product_id = pro.product_id "; 
     51// ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤Î¥«¥é¥à¤Î¼èÆÀ(view¤È¤Î·ë¹ç¤Î¤¿¤á¡¢¥Æ¡¼¥Ö¥ë¤òA¤ÈÄêµÁ¤·¤Æ¤ª¤¯) 
     52$select = "A.trackback_id, A.product_id, A.blog_name, A.title, A.url, "; 
     53$select .= "A.excerpt, A.status, A.create_date, A.update_date, B.name"; 
     54$from = "dtb_trackback AS A LEFT JOIN dtb_products AS B ON A.product_id = B.product_id "; 
    5555 
    5656// ¸¡º÷¥ï¡¼¥É¤Î°ú¤­·Ñ¤® 
     
    6363// ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Îºï½ü 
    6464if ($_POST['mode'] == "delete") { 
    65     $objQuery->exec("UPDATE dtb_trackback SET del_flg = 1 WHERE trackback_id=?", array($_POST['trackback_id'])); 
     65    $objQuery->exec("UPDATE dtb_trackback SET del_flg = 1 WHERE trackback_id = ?", array($_POST['trackback_id'])); 
    6666} 
    6767     
     
    6969     
    7070    //ºï½ü¤µ¤ì¤Æ¤¤¤Ê¤¤¾¦Éʤò¸¡º÷ 
    71     $where="tra.del_flg = 0 AND pro.del_flg = 0"; 
     71    $where="A.del_flg = 0 AND B.del_flg = 0"; 
    7272    $objPage->arrForm = $_POST; 
    7373 
     
    8989                    $val = ereg_replace(" ", "%", $val); 
    9090                    $val = ereg_replace("¡¡", "%", $val); 
    91                     $where.= " AND tra.blog_name ILIKE ? "; 
     91                    $where.= " AND A.blog_name ILIKE ? "; 
    9292                    $arrval[] = "%$val%"; 
    9393                    break; 
     
    9696                    $val = ereg_replace(" ", "%", $val); 
    9797                    $val = ereg_replace("¡¡", "%", $val); 
    98                     $where.= " AND tra.title ILIKE ? "; 
     98                    $where.= " AND A.title ILIKE ? "; 
    9999                    $arrval[] = "%$val%"; 
    100100                    break; 
     
    103103                    $val = ereg_replace(" ", "%", $val); 
    104104                    $val = ereg_replace("¡¡", "%", $val); 
    105                     $where.= " AND tra.url ILIKE ? "; 
     105                    $where.= " AND A.url ILIKE ? "; 
    106106                    $arrval[] = "%$val%"; 
    107107                    break; 
     
    109109                case 'search_status': 
    110110                    if (isset($_POST['search_status'])) { 
    111                         $where.= " AND tra.status = ? "; 
     111                        $where.= " AND A.status = ? "; 
    112112                        $arrval[] = $val; 
    113113                    } 
     
    117117                    $val = ereg_replace(" ", "%", $val); 
    118118                    $val = ereg_replace("¡¡", "%", $val); 
    119                     $where.= " AND pro.name ILIKE ? "; 
     119                    $where.= " AND B.name ILIKE ? "; 
    120120                    $arrval[] = "%$val%"; 
    121121                    break; 
     
    124124                    $val = ereg_replace(" ", "%", $val); 
    125125                    $val = ereg_replace("¡¡", "%", $val); 
    126                     $where.= " AND pro.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? )"; 
     126                    $where.= " AND B.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? )"; 
    127127                    $arrval[] = "%$val%"; 
    128128                    break; 
     
    131131                    if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) { 
    132132                        $date = sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']); 
    133                         $where.= " AND tra.create_date >= ? "; 
     133                        $where.= " AND A.create_date >= ? "; 
    134134                        $arrval[] = $date; 
    135135                    } 
     
    142142                        $end_date = date("Y/m/d",strtotime("1 day" ,strtotime($date))); 
    143143                         
    144                         $where.= " AND tra.create_date <= cast('$end_date' as date) "; 
     144                        $where.= " AND A.create_date <= cast('$end_date' as date) "; 
    145145                    } 
    146146                    break; 
     
    151151    } 
    152152     
    153     $order = "tra.create_date DESC"; 
     153    $order = "A.create_date DESC"; 
    154154     
    155155    // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý 
     
    182182    if ($_POST['mode'] == 'csv'){ 
    183183        // ¥ª¥×¥·¥ç¥ó¤Î»ØÄê 
    184         $option = "ORDER BY trackback_id"; 
     184        $option = "ORDER BY A.trackback_id"; 
    185185        // CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ® 
    186         $head = sfGetCSVList($arrREVIEW_CVSTITLE); 
    187         $data = lfGetReviewCSV($where, '', $arrval); 
     186        $head = sfGetCSVList($arrTRACKBACK_CVSTITLE); 
     187        $data = lfGetTrackbackCSV($where, '', $arrval); 
    188188        // CSV¤òÁ÷¿®¤¹¤ë¡£ 
    189189        sfCSVDownload($head.$data); 
Note: See TracChangeset for help on using the changeset viewer.