0){ while($data = mysql_fetch_assoc($sel)){ $total = $total + $data['rating_num']; $rows++; } $perc = ($total/$rows) * 20; //$newPerc = round($perc/5)*5; //return $newPerc.'%'; $newPerc = round($perc,2); return $newPerc.'%'; } else { return '0%'; } } function outOfFive($id){ $total = 0; $rows = 0; $sel = mysql_query("SELECT rating_num FROM yp_ratings WHERE rating_id = '$id'"); if(mysql_num_rows($sel) > 0){ while($data = mysql_fetch_assoc($sel)){ $total = $total + $data['rating_num']; $rows++; } $perc = ($total/$rows); return round($perc,2); //return round(($perc*2), 0)/2; // 3.5 } else { return '0'; } } function getVotes($id){ $sel = mysql_query("SELECT rating_num FROM yp_ratings WHERE rating_id = '$id'"); $rows = mysql_num_rows($sel); if($rows == 0){ $votes = '共 0 票'; } else if($rows == 1){ $votes = '共 1 票'; } else { $votes = '共 '.$rows.' 票'; } return $votes; } function pullRating($id,$show5 = false, $showPerc = false, $showVotes = false, $static = NULL){ // Check if they have already voted... $text = ''; $sel = mysql_query("SELECT id FROM yp_ratings WHERE IP = '".$_SERVER['REMOTE_ADDR']."' AND rating_id = '$id'"); // if(mysql_num_rows($sel) > 0 || $static == 'novote' || isset($_COOKIE['has_voted_'.$id])){ if(mysql_num_rows($sel) > 0 || $static == 'novote'){ if($show5 || $showPerc || $showVotes){ $text .= '
'; } if($show5){ $text .= '評分: '.outOfFive($id).'/5'; } if($showPerc){ $text .= ' ('.getRating($id).')'; } if($showVotes){ $text .= ' ('.getVotes($id).')'; } if($show5 || $showPerc || $showVotes){ $text .= '
'; } return $text.'
'; } else { if($show5 || $showPerc || $showVotes){ $text .= '
'; } if($show5){ $show5bool = 'true'; $text .= '評分: '.outOfFive($id).'/5'; } else { $show5bool = 'false'; } if($showPerc){ $showPercbool = 'true'; $text .= ' ('.getRating($id).')'; } else { $showPercbool = 'false'; } if($showVotes){ $showVotesbool = 'true'; $text .= ' ('.getVotes($id).')'; } else { $showVotesbool = 'false'; } if($show5 || $showPerc || $showVotes){ $text .= '
'; } return $text.'
'; } } // Added in version 1.5 // Fixed sort in version 1.7 function getTopRated($limit, $table, $idfield, $namefield){ $result = ''; $sql = "SELECT COUNT(ratings.id) as rates,ratings.rating_id,".$table.".".$namefield." as thenamefield,ROUND(AVG(ratings.rating_num),2) as rating FROM yp_ratings,".$table." WHERE ".$table.".".$idfield." = ratings.rating_id GROUP BY rating_id ORDER BY rates DESC,rating DESC LIMIT ".$limit.""; $sel = mysql_query($sql); $result .= ''."\n"; return $result; } ?> 寵物用品批發 - 香港寵物黃頁 - PetKD 寵物網 (寵物領養、資訊廣告、用品買賣及寵奴互動平台)
PetKD 寵物網 (寵物領養、資訊廣告、用品買賣及寵奴互動平台) 寵物黃頁 寵物用品批發
贊助網站
共 66 間相關店鋪
利保貿易
類別: 寵物用品批發 評分: (共 2 票)
電話: 26501832 瀏覽: 1167
地址: 觀塘大業街35號福和工業大廈31樓
Skypower Pet Supply Co. Ltd
類別: 寵物用品批發 評分: (共 1 票)
電話: 35824089 瀏覽: 534
地址: 紅磡寶其實利街47號銳光中心9字樓B室
凱旋行
類別: 寵物用品批發 評分: (共 2 票)
電話: 23906089 瀏覽: 1868
地址: 荃灣柴灣角街95號華俊工業大廈4樓4室
五方寵物有限公司
類別: 寵物用品批發 評分: (共 5 票)
電話: 23086347 瀏覽: 1208
地址: 荃灣德士古道98號五方集團中心3樓全層
Easy Loyal Trading Ltd
類別: 寵物用品批發 評分: (共 5 票)
電話: 27118202 瀏覽: 4428
地址: Shop 2, G/F, 98 Tam Kung Road, Tokwawan, Kowloon
聯合水族及寵物用品有限公司
類別: 寵物用品批發 評分: (共 2 票)
電話: 24938231 瀏覽: 952
地址: 荃灣德士古道62-70號寶業大廈B座11樓8室
Niente Group Limited
類別: 寵物用品批發 評分: (共 1 票)
電話: 27302972 瀏覽: 673
地址: 1B,Fu Lam Building, No 6 Hillwood Road, Tsim Sha Tsui, kln
貓潔易卓盛國際貿易有限公司
類別: 寵物用品批發 評分: (共 1 票)
電話: 31071884 瀏覽: 685
地址: Room 807, 8/F Fok Who Factory Building, 5 Sheung Hei Street, San Po Kong , Kowloon, hong kong
共 66 間相關店鋪

本頁店鋪分佈地圖

廣告查詢|聯繫我們|Archiver|手機版|PetKD 寵物網

GMT+8, 2019-8-25 05:20 PM

Copyright © 2019 PetKD 寵物網 保留所有權利 - Powered by Discuz!

回頂部