setcookie ("workcookie",$REMOTE_ADDR, time()+86400*160); ?> include "left.php"; ?>
include "config.php";
if (!isset($show)) {$show=0;}
$sql_select = "select * from $table where id='$companyid'";
$result = mysql_query ($sql_select,$conID) or die ($sql_select);
$row = mysql_fetch_array($result) ;
$bad=$row["bad"];
$good=$row["good"];
$username=$row["username"];
/////確認是否查詢負面評價
if($j2hcheck ==""){
////計算共有幾筆評價
$total= $bad + $good;
$query = "select * from $tablemark where companyid='$companyid' order by id desc limit $show, $limit";
}elseif($j2hcheck =="1"){
$total= $good;
$query = "select * from $tablemark where companyid='$companyid' and mark='1' order by id desc limit $show, $limit";
}elseif($j2hcheck =="2"){
$total= $bad;
$query = "select * from $tablemark where companyid='$companyid' and mark='2' order by id desc limit $show, $limit";
}
$result=mysql_query($query);
$number = mysql_num_rows($result);
$i = 0;
if ($total == 0){
print " "; print " "; }elseif ($total > 0) { if ($total%$limit!=0) { $totalpage=intval($total/$limit)+1; } else { $totalpage=intval($total/$limit); } $nowpage=intval($show/$limit)+1; print " 共 $total 個評價"; print "/共$totalpage.頁"; } ?> |
評價 | ||
&j2hcheck=1>正評: echo $good ;?> &j2hcheck=0>普通評:0 &j2hcheck=2>負評: echo $bad ;?> >總評價: $j2hmark=$good-$bad; echo $j2hmark; ?> |
while ($i < $number){ $row = mysql_fetch_array($result); $id=$row["id"]; $name=$row["name"]; $mark=$row["mark"]; $message=$row["message"]; $date=$row["date"]; ?>
名稱 | echo $name;?> |
評價 | switch ($mark) { case "1" :echo "優良"; break; case "2" :echo "差"; break; case "0" :echo "普通"; break; } ?> |
評價內容 | echo nl2br($message);?> |