$sql = "SELECT *";
$sql .= ",(SELECT COUNT(*) FROM tblCoopResponse WHERE Coop_ID=tblCooperation.ID) AS Rnum";
$sql .= ",(SELECT COUNT(*) FROM tblCoopPush WHERE Coop_ID=tblCooperation.ID) AS Pnum";
$sql .= " FROM ".$sqlTableList." ";
$sql .= " WHERE ".$sqlCondition;
$sql .= " ORDER BY createDateTime DESC";
$pager->getLimitQuery($sql, $limitFrom, $limitTo, DSN);
$result =& $db->query($sql);
if (DB::isError($result)) { die($result->{$sysDebug}()); }
$RowCounter = $limitFrom + 1;
foreach (range($limitFrom, $limitTo) as $rowNum)
{
if (!$row =& $result->fetchRow(DB_FETCHMODE_ASSOC, $rowNum)) { break; }
?>
|
echo $row['nickname']; ?>:
echo $row['content']; ?> | echo $row['createDateTime']; ?>
if($member_ID!=$row['Member_ID']){ ?>
} ?>
|
|
|
$RowCounter = 0;
$sql = "SELECT * FROM tblCoopResponse";
$sql .= " WHERE status='y' AND Coop_ID='".$row['ID']."'";
$sql .= " ORDER BY createDateTime DESC;";
$ResponseResult = $db->query($sql);
if (DB::isError($ResponseResult)) { die($ResponseResult->{$sysDebug}()); }
while($ResponseRow = $ResponseResult->fetchRow()){
$RowCounter++;
?>
$DEFAULT_DISPLAY_ROWS)?' TabIndex="100" style="display:none"':''; ?>>
|
echo $ResponseRow['nickname']; ?> : echo $ResponseRow['content']; ?> | echo $ResponseRow['createDateTime']; ?> if($member_ID!=$ResponseRow['Member_ID']){ ?>
} ?>
|
|
|
}
?>
|
|
echo $ResponseResult->numRows(); ?>個人留言 | echo $row['Pnum']; ?>人加油打氣 |
if($ResponseResult->numRows()==$DEFAULT_DISPLAY_ROWS){
?>
沒有其它回應
}elseif($ResponseResult->numRows()<=$DEFAULT_DISPLAY_ROWS){
?>
沒有其它回應
}elseif($ResponseResult->numRows()>$DEFAULT_DISPLAY_ROWS){
?>
看其它的回應
}
?>
|
|
|
}
$result->free();
# Close database connection
#----------------------------------------------------------
$db->disconnect();
#----------------------------------------------------------
?>