Changeset 15072 for branches


Ignore:
Timestamp:
2007/07/19 12:48:39 (17 years ago)
Author:
adati
Message:

岩田さん指摘事項対応

Location:
branches/dev/data/downloads/module/mdl_ebis_tag
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/data/downloads/module/mdl_ebis_tag/ebis_tag.php

    r15060 r15072  
    88 */ 
    99 
    10 //require_once("./require.php"); 
    11 //require_once MODULE_PATH . 'ebis_tag_conf.php'; 
    12  
    1310// ǧ¾Ú³Îǧ 
    1411$objSess = new SC_Session(); 
     
    2118        //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê 
    2219        $this->tpl_mainpage  = MODULE_PATH . 'mdl_ebis_tag/ebis_tag.tpl'; 
    23         $this->tpl_subtitle  = 'EBiS¥¿¥°Ëä¤á¹þ¤ßµ¡Ç½'; 
     20        $this->tpl_subtitle  = 'AD EBiS¥¿¥°Ëä¤á¹þ¤ßµ¡Ç½'; 
    2421        $this->tpl_uniqid    = ''; 
    2522         
     
    8481/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */ 
    8582function lfInitParam($objFormParam) { 
    86     $objFormParam->addParam("¥æ¡¼¥¶ID", "user", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
    87     $objFormParam->addParam("¥Ñ¥¹¥ï¡¼¥É", "pass", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
    8883    $objFormParam->addParam("¥í¥°¥¤¥óURL", "login_url", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "URL_CHECK")); 
    8984    $objFormParam->addParam("EBiS°ú¿ô", "cid", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
     
    10398} 
    10499 
    105 /* CSV¼èÆÀ */ 
     100/** 
     101 * ¥«¥Æ¥´¥êʸ»úÎó¤ò¼èÆÀ(¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä) 
     102 *  
     103 * @param int $category_id ¥«¥Æ¥´¥êID 
     104 * @param str $sep ¥«¥Æ¥´¥ê¤Î¶èÀÚ¤êʸ»ú 
     105 * return ¥«¥Æ¥´¥êʸ»úÎó(¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä) 
     106 */  
     107function lfGetCategoriesStr($category_id, $sep = ' > ') { 
     108    $tbl_category = 'dtb_category'; 
     109     
     110    // ¿Æ¥«¥Æ¥´¥êID¤ÎÇÛÎó 
     111    $arrParentsCatId = sfGetParents(null, $tbl_category, 'parent_category_id', 'category_id', $category_id); 
     112     
     113    // WHERE¶ç¤ò¹½ÃÛ 
     114    $where = str_repeat('category_id = ? OR ' , count($arrParentsCatId)); 
     115    $where = preg_replace('/OR $/', '', $where); 
     116 
     117    // ¥«¥Æ¥´¥ê̾¤ò¼èÆÀ 
     118    $objQuery = new SC_Query(); 
     119    $arrRet   = $objQuery->select('category_name', $tbl_category, $where, $arrParentsCatId); 
     120     
     121    // ¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê...¤ò¹½ÃÛ 
     122    $categories_str = ''; 
     123    foreach($arrRet as $category) { 
     124        $categories_str .= $category['category_name'] . $sep; 
     125    } 
     126     
     127    return $categories_str; 
     128} 
     129 
     130/** CSV¼èÆÀ **/ 
    106131function lgGetCsvData() { 
    107     $csv  = lfGetDetailPageCSV(); 
     132    $csv  = '"¥Ú¡¼¥¸ID","¥¿¥¤¥È¥ë","URL"' . "\n"; 
     133    $csv .= lfGetDetailPageCSV(); 
    108134    $csv .= lfGetListPageCSV(); 
    109135    $csv .= lfGetFrontPageCSV(); 
     
    111137} 
    112138 
    113 /* ¾¦Éʾܺ٥ڡ¼¥¸¤ÎCSV¤ò¼èÆÀ */ 
     139/** ¾¦Éʾܺ٥ڡ¼¥¸¤ÎCSV¤ò¼èÆÀ **/ 
    114140function lfGetDetailPageCSV() { 
    115141    $table    = 'dtb_products'; 
    116     $colmuns  = 'product_id, name'; 
     142    $colmuns  = 'product_id, name, category_id'; 
    117143    $objQuery = new SC_Query(); 
    118144     
     
    120146     
    121147    $arrCSV = array(); 
    122     foreach ($arrRet as $key => $product) { 
     148    foreach ($arrRet as $index => $product) { 
    123149        $id  = $product['product_id']; 
    124150        $url = SITE_URL . 'products/detail.php?product_id='; 
    125         $title = str_replace('"', '\"', $product['name']); 
    126          
    127         $arrCSV[$key]['page_id']    = '"' . 'detail-p' . $id . '"'; 
    128         $arrCSV[$key]['page_title'] = '"' . $title . '"'; 
    129         $arrCSV[$key]['url']        = '"' . $url . $id . '"'; 
     151        $title = lfGetCategoriesStr($product['category_id']) . $product['name']; 
     152         
     153        $arrCSV[$index]['page_id']    = 'detail-p' . $id; 
     154        $arrCSV[$index]['page_title'] = $title; 
     155        $arrCSV[$index]['url']        = $url . $id; 
    130156    } 
    131157     
     
    133159} 
    134160 
    135 /* ¾¦ÉÊ°ìÍ÷¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ */ 
     161/** ¾¦ÉÊ°ìÍ÷¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ **/ 
    136162function lfGetListPageCSV() { 
    137163    $table    = 'dtb_category'; 
     
    142168     
    143169    $arrCSV = array(); 
    144     foreach ($arrRet as $key => $category) { 
     170    foreach ($arrRet as $index => $category) { 
    145171        $id  = $category['category_id']; 
    146172        $url = SITE_URL . 'products/list.php?category_id='; 
    147         $title = str_replace('"', '\"', $category['category_name']); 
    148          
    149         $arrCSV[$key]['page_id']    = '"' . 'list-c' . $id . '"'; 
    150         $arrCSV[$key]['page_title'] = '"' . $title . '"'; 
    151         $arrCSV[$key]['url']        = '"' . $url . $id . '"'; 
     173        $title = $category['category_name']; 
     174         
     175        $arrCSV[$index]['page_id']    = 'list-c' . $id; 
     176        $arrCSV[$index]['page_title'] = $title; 
     177        $arrCSV[$index]['url']        = $url . $id; 
    152178    } 
    153179    return lfCreateCSV($arrCSV); 
     
    156182function lfCreateCSV ($arrCSV) { 
    157183    $csv_str = ''; 
    158     foreach ($arrCSV as $csv) { 
    159         $csv_str .= join(',', $csv) . "\n"; 
    160     } 
     184    $max = count($arrCSV); 
     185    for ($i=0; $i < $max; $i++) { 
     186        foreach (array('page_id', 'page_title', 'url') as $key) { 
     187            $arrCSV[$i][$key] = sprintf( 
     188                '"%s"', 
     189                str_replace('"', '""', $arrCSV[$i][$key]) 
     190            ); 
     191        } 
     192        $csv_str .= join(',', $arrCSV[$i]) . "\n"; 
     193    } 
     194     
    161195    return $csv_str; 
    162196} 
    163197 
    164 /* ¤½¤Î¾¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ */ 
     198/** ¤½¤Î¾¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ **/ 
    165199function lfGetFrontPageCSV() { 
    166200    // ¹àÌÜÄɲäκݤϲ¼µ­Ï¢ÁÛÇÛÎó¤òÄɲᣠ
    167201    // page_title,url¤ÏǤ°Õ¡¢¤Ê¤¤¾ì¹ç¤Ïpage_id¤«¤é¼«Æ°À¸À®¤µ¤ì¤ë 
    168     // 'page_id' => 'top', 'page_title' => '' , 'url' => 'index.php' 
     202    // 'page_id' => 'top', 'page_title' => '¥È¥Ã¥×' , 'url' => 'index.php' 
    169203    $arrList = array( 
    170         array('page_id' => 'top', 'page_title' => '' , 'url' => 'index.php'), 
    171         array('page_id' => 'abouts_index'), 
    172         array('page_id' => 'cart_index'), 
    173         array('page_id' => 'contact_index'), 
    174         array('page_id' => 'contact_confirm', 'page_title' => '', 'url' => 'contact/index.php'), 
    175         array('page_id' => 'contact_complete'), 
    176         array('page_id' => 'order_index'), 
    177         array('page_id' => 'entry_kiyaku'), 
    178         array('page_id' => 'entry_index'), 
    179         array('page_id' => 'entry_confirm', 'page_title' => '', 'url' => 'entry/index.php'), 
    180         array('page_id' => 'regist_complete', 'page_title' => '', 'url' => 'entry/complete.php'), 
    181         array('page_id' => 'products_favorite'), 
    182         array('page_id' => 'shopping_deliv'), 
    183         array('page_id' => 'shopping_payment'), 
    184         array('page_id' => 'shopping_confirm'), 
    185         array('page_id' => 'thanks', 'page_title' => '', 'url' => 'shopping/complete.php'), 
    186         array('page_id' => 'mypage_index'), 
    187         array('page_id' => 'mypage_change'), 
    188         array('page_id' => 'mypage_change_confirm', 'page_title' => '', 'url' => 'mypage/change.php'), 
    189         array('page_id' => 'mypage_change_complete', 'page_title' => '', 'url' => 'mypage/change_complete.php'), 
     204        array('page_id' => 'top', 'page_title' => '¥È¥Ã¥×' , 'url' => 'index.php'), 
     205        array('page_id' => 'abouts_index', 'page_title' => 'Åö¥µ¥¤¥È¤Ë¤Ä¤¤¤Æ'), 
     206        array('page_id' => 'cart_index', 'page_title' => 'Ç㤤ʪ¤«¤´¡Ê¥È¥Ã¥×¡Ë'), 
     207        array('page_id' => 'contact_index', 'page_title' => '¤ªÌ䤤¹ç¤ï¤»¡ÊÆþÎÏ¡Ë'), 
     208        array('page_id' => 'contact_confirm', 'page_title' => '¤ªÌ䤤¹ç¤ï¤»¡Ê³Îǧ¡Ë', 'url' => 'contact/index.php'), 
     209        array('page_id' => 'contact_complete', 'page_title' => '¤ªÌ䤤¹ç¤ï¤»¡Ê´°Î»¡Ë'), 
     210        array('page_id' => 'order_index', 'page_title' => '¹ØÆþ¡ÊÆþÎÏ¡Ë'), 
     211        array('page_id' => 'entry_kiyaku', 'page_title' => '¤´ÍøÍѵ¬Ìó'), 
     212        array('page_id' => 'entry_index', 'page_title' => '²ñ°÷ÅÐÏ¿¡ÊÆþÎÏ'), 
     213        array('page_id' => 'entry_confirm', 'page_title' => '²ñ°÷ÅÐÏ¿¡Ê³Îǧ¡Ë', 'url' => 'entry/index.php'), 
     214        array('page_id' => 'regist_complete', 'page_title' => '²ñ°÷ÅÐÏ¿¡Ê´°Î»¡Ë', 'url' => 'entry/complete.php'), 
     215        array('page_id' => 'shopping_deliv', 'page_title' => '¹ØÆþ¡Ê¤ªÆϤ±Àè»ØÄê¡Ë'), 
     216        array('page_id' => 'shopping_payment', 'page_title' => '¹ØÆþ¡Ê¤ª»Ùʧ¤¤ÊýË¡»ØÄê¡Ë'), 
     217        array('page_id' => 'shopping_confirm', 'page_title' => '¹ØÆþ¡Ê³Îǧ¡Ë'), 
     218        array('page_id' => 'thanks', 'page_title' => '¹ØÆþ¡Ê´°Î»', 'url' => 'shopping/complete.php'), 
     219        array('page_id' => 'mypage_index', 'page_title' => 'MY¥Ú¡¼¥¸¡Ê¥È¥Ã¥×¡Ë'), 
     220        array('page_id' => 'mypage_change', 'page_title' => 'MY¥Ú¡¼¥¸ > ²ñ°÷ÅÐÏ¿ÆâÍÆÊѹ¹¡ÊÆþÎÏ¡Ë'), 
     221        array('page_id' => 'mypage_change_confirm', 'page_title' => 'MY¥Ú¡¼¥¸ > ²ñ°÷ÅÐÏ¿ÆâÍÆÊѹ¹¡Ê³Îǧ¡Ë', 'url' => 'mypage/change.php'), 
     222        array('page_id' => 'mypage_change_complete', 'page_title' => 'MY¥Ú¡¼¥¸ > ²ñ°÷ÅÐÏ¿ÆâÍÆÊѹ¹¡Ê´°Î»¡Ë', 'url' => 'mypage/change_complete.php'), 
    190223    ); 
    191224     
     
    205238    return lfCreateCSV($arrList); 
    206239} 
     240 
    207241?> 
  • branches/dev/data/downloads/module/mdl_ebis_tag/ebis_tag.tpl

    r15049 r15072  
    7575                                     
    7676                                    <table width="440" border="0" cellspacing="1" cellpadding="8" summary=" "> 
    77                                         <tr class="fs12n"> 
    78                                             <td width="90" bgcolor="#f3f3f3">¥æ¡¼¥¶ID<span class="red">¢¨</span></td> 
    79                                             <td width="337" bgcolor="#ffffff"> 
    80                                             <span class="red"><!--{$arrErr.user}--></span> 
    81                                             <input type="text" name="user" size="30" style="<!--{$arrErr.user|sfGetErrorColor}-->" value="<!--{$arrForm.user.value}-->" class="box30" maxlength="50"/> 
    82                                             </td> 
    83                                         </tr>    
    84                                         <tr class="fs12n"> 
    85                                             <td width="90" bgcolor="#f3f3f3">¥Ñ¥¹¥ï¡¼¥É<span class="red">¢¨</span></td> 
    86                                             <td width="337" bgcolor="#ffffff"> 
    87                                             <span class="red"><!--{$arrErr.pass}--></span> 
    88                                             <input type="password" name="pass" size="30" style="<!--{$arrErr.pass|sfGetErrorColor}-->" value="<!--{$arrForm.pass.value}-->" class="box30" maxlength="50"/> 
    89                                             </td> 
    90                                         </tr> 
    9177                                        <tr class="fs12n"> 
    9278                                            <td width="90" bgcolor="#f3f3f3">¥í¥°¥¤¥óURL<span class="red">¢¨</span></td> 
Note: See TracChangeset for help on using the changeset viewer.