Changeset 15072
- Timestamp:
- 2007/07/19 12:48:39 (16 years ago)
- 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 8 8 */ 9 9 10 //require_once("./require.php");11 //require_once MODULE_PATH . 'ebis_tag_conf.php';12 13 10 // ǧ¾Ú³Îǧ 14 11 $objSess = new SC_Session(); … … 21 18 //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê 22 19 $this->tpl_mainpage = MODULE_PATH . 'mdl_ebis_tag/ebis_tag.tpl'; 23 $this->tpl_subtitle = ' EBiS¥¿¥°Ëä¤á¹þ¤ßµ¡Ç½';20 $this->tpl_subtitle = 'AD EBiS¥¿¥°Ëä¤á¹þ¤ßµ¡Ç½'; 24 21 $this->tpl_uniqid = ''; 25 22 … … 84 81 /* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */ 85 82 function 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"));88 83 $objFormParam->addParam("¥í¥°¥¤¥óURL", "login_url", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "URL_CHECK")); 89 84 $objFormParam->addParam("EBiS°ú¿ô", "cid", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); … … 103 98 } 104 99 105 /* CSV¼èÆÀ */ 100 /** 101 * ¥«¥Æ¥´¥êʸ»úÎó¤ò¼èÆÀ(¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä) 102 * 103 * @param int $category_id ¥«¥Æ¥´¥êID 104 * @param str $sep ¥«¥Æ¥´¥ê¤Î¶èÀÚ¤êʸ»ú 105 * return ¥«¥Æ¥´¥êʸ»úÎó(¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä¥«¥Æ¥´¥ê¡ä) 106 */ 107 function 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¼èÆÀ **/ 106 131 function lgGetCsvData() { 107 $csv = lfGetDetailPageCSV(); 132 $csv = '"¥Ú¡¼¥¸ID","¥¿¥¤¥È¥ë","URL"' . "\n"; 133 $csv .= lfGetDetailPageCSV(); 108 134 $csv .= lfGetListPageCSV(); 109 135 $csv .= lfGetFrontPageCSV(); … … 111 137 } 112 138 113 /* ¾¦Éʾܺ٥ڡ¼¥¸¤ÎCSV¤ò¼èÆÀ*/139 /** ¾¦Éʾܺ٥ڡ¼¥¸¤ÎCSV¤ò¼èÆÀ **/ 114 140 function lfGetDetailPageCSV() { 115 141 $table = 'dtb_products'; 116 $colmuns = 'product_id, name ';142 $colmuns = 'product_id, name, category_id'; 117 143 $objQuery = new SC_Query(); 118 144 … … 120 146 121 147 $arrCSV = array(); 122 foreach ($arrRet as $ key=> $product) {148 foreach ($arrRet as $index => $product) { 123 149 $id = $product['product_id']; 124 150 $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; 130 156 } 131 157 … … 133 159 } 134 160 135 /* ¾¦ÉʰìÍ÷¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ*/161 /** ¾¦ÉʰìÍ÷¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ **/ 136 162 function lfGetListPageCSV() { 137 163 $table = 'dtb_category'; … … 142 168 143 169 $arrCSV = array(); 144 foreach ($arrRet as $ key=> $category) {170 foreach ($arrRet as $index => $category) { 145 171 $id = $category['category_id']; 146 172 $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; 152 178 } 153 179 return lfCreateCSV($arrCSV); … … 156 182 function lfCreateCSV ($arrCSV) { 157 183 $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 161 195 return $csv_str; 162 196 } 163 197 164 /* ¤½¤Î¾¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ*/198 /** ¤½¤Î¾¥Ú¡¼¥¸¤ÎCSV¤ò¼èÆÀ **/ 165 199 function lfGetFrontPageCSV() { 166 200 // ¹àÌÜÄɲäκݤϲ¼µÏ¢ÁÛÇÛÎó¤òÄɲᣠ167 201 // page_title,url¤ÏǤ°Õ¡¢¤Ê¤¤¾ì¹ç¤Ïpage_id¤«¤é¼«Æ°À¸À®¤µ¤ì¤ë 168 // 'page_id' => 'top', 'page_title' => ' ' , 'url' => 'index.php'202 // 'page_id' => 'top', 'page_title' => '¥È¥Ã¥×' , 'url' => 'index.php' 169 203 $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'), 190 223 ); 191 224 … … 205 238 return lfCreateCSV($arrList); 206 239 } 240 207 241 ?> -
branches/dev/data/downloads/module/mdl_ebis_tag/ebis_tag.tpl
r15049 r15072 75 75 76 76 <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>91 77 <tr class="fs12n"> 92 78 <td width="90" bgcolor="#f3f3f3">¥í¥°¥¤¥óURL<span class="red">¢¨</span></td>
Note: See TracChangeset
for help on using the changeset viewer.