Changeset 11949
- Timestamp:
- 2007/03/22 16:40:42 (17 years ago)
- Location:
- branches/dev/html/admin/products
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev/html/admin/products/index_csv.php
r211 r11949 29 29 ); 30 30 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 31 49 // CSV½ÐÎϥǡ¼¥¿¤òºîÀ®¤¹¤ë¡£(¾¦ÉÊ) 32 50 function lfGetProductsCSV($where, $option, $arrval, $arrOutputCols) { … … 72 90 // ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£ 73 91 $data .= lfMakeReviewCSV($list_data[$i]); 92 } 93 return $data; 94 } 95 96 // CSV½ÐÎϥǡ¼¥¿¤òºîÀ®¤¹¤ë¡£(¥È¥é¥Ã¥¯¥Ð¥Ã¥¯) 97 function 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]); 74 112 } 75 113 return $data; … … 139 177 } 140 178 179 // ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£(¥È¥é¥Ã¥¯¥Ð¥Ã¥¯) 180 function 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 141 205 ?> -
branches/dev/html/admin/products/trackback.php
r11941 r11949 49 49 sfIsSuccess($objSess); 50 50 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 "; 55 55 56 56 // ¸¡º÷¥ï¡¼¥É¤Î°ú¤·Ñ¤® … … 63 63 // ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Îºï½ü 64 64 if ($_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'])); 66 66 } 67 67 … … 69 69 70 70 //ºï½ü¤µ¤ì¤Æ¤¤¤Ê¤¤¾¦Éʤò¸¡º÷ 71 $where=" tra.del_flg = 0 AND pro.del_flg = 0";71 $where="A.del_flg = 0 AND B.del_flg = 0"; 72 72 $objPage->arrForm = $_POST; 73 73 … … 89 89 $val = ereg_replace(" ", "%", $val); 90 90 $val = ereg_replace("¡¡", "%", $val); 91 $where.= " AND tra.blog_name ILIKE ? ";91 $where.= " AND A.blog_name ILIKE ? "; 92 92 $arrval[] = "%$val%"; 93 93 break; … … 96 96 $val = ereg_replace(" ", "%", $val); 97 97 $val = ereg_replace("¡¡", "%", $val); 98 $where.= " AND tra.title ILIKE ? ";98 $where.= " AND A.title ILIKE ? "; 99 99 $arrval[] = "%$val%"; 100 100 break; … … 103 103 $val = ereg_replace(" ", "%", $val); 104 104 $val = ereg_replace("¡¡", "%", $val); 105 $where.= " AND tra.url ILIKE ? ";105 $where.= " AND A.url ILIKE ? "; 106 106 $arrval[] = "%$val%"; 107 107 break; … … 109 109 case 'search_status': 110 110 if (isset($_POST['search_status'])) { 111 $where.= " AND tra.status = ? ";111 $where.= " AND A.status = ? "; 112 112 $arrval[] = $val; 113 113 } … … 117 117 $val = ereg_replace(" ", "%", $val); 118 118 $val = ereg_replace("¡¡", "%", $val); 119 $where.= " AND pro.name ILIKE ? ";119 $where.= " AND B.name ILIKE ? "; 120 120 $arrval[] = "%$val%"; 121 121 break; … … 124 124 $val = ereg_replace(" ", "%", $val); 125 125 $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 ? )"; 127 127 $arrval[] = "%$val%"; 128 128 break; … … 131 131 if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) { 132 132 $date = sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']); 133 $where.= " AND tra.create_date >= ? ";133 $where.= " AND A.create_date >= ? "; 134 134 $arrval[] = $date; 135 135 } … … 142 142 $end_date = date("Y/m/d",strtotime("1 day" ,strtotime($date))); 143 143 144 $where.= " AND tra.create_date <= cast('$end_date' as date) ";144 $where.= " AND A.create_date <= cast('$end_date' as date) "; 145 145 } 146 146 break; … … 151 151 } 152 152 153 $order = " tra.create_date DESC";153 $order = "A.create_date DESC"; 154 154 155 155 // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý … … 182 182 if ($_POST['mode'] == 'csv'){ 183 183 // ¥ª¥×¥·¥ç¥ó¤Î»ØÄê 184 $option = "ORDER BY trackback_id";184 $option = "ORDER BY A.trackback_id"; 185 185 // CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ® 186 $head = sfGetCSVList($arr REVIEW_CVSTITLE);187 $data = lfGet ReviewCSV($where, '', $arrval);186 $head = sfGetCSVList($arrTRACKBACK_CVSTITLE); 187 $data = lfGetTrackbackCSV($where, '', $arrval); 188 188 // CSV¤òÁ÷¿®¤¹¤ë¡£ 189 189 sfCSVDownload($head.$data);
Note: See TracChangeset
for help on using the changeset viewer.