</td> </tr> <?php } ?> </tbody> </table> <?php // Get the number of page in total $countSQL = "SELECT COUNT(*) AS noOfRecord "; $sql = $countSQL . $bodySQL . $conditionSQL; $result2 = $db->query($sql); $row2 = $result2->fetch_array(); $noOfPages = Ceil($row2["noOfRecord"] / $GNO_OF_RECORDS_PER_PAGE); if ($searchTxt == "") { // Output the paging string echo GetPagingStr($page, $noOfPages); } else { // Extra parameter to pass as query string $extraParamAry = array(); $extraParamAry["searchTxt"] = $searchTxt; // Output the paging string echo GetPagingStr($page, $noOfPages, $extraParamAry); } ?> <?php } else { echo CONST_ERROR_MESSAGE_NO_DATA; }
?> | <a href="javascript:void(0);" class="btn-del" data-ref="<?php echo $row['msg_id']; ?> ">刪除</a> <?php } ?> </td> </tr> <?php } ?> </tbody> </table> <?php // Get the number of page in total $sql = "SELECT COUNT(*) AS noOfRecord from ( {$selectSQL} ) a "; if (!$mysql->query($sql)) { echo $mysql->error; } else { $row2 = $mysql->data[0]; $noOfPages = Ceil($row2["noOfRecord"] / $GNO_OF_RECORDS_PER_PAGE); // Output the paging string echo GetPagingStr($page, $noOfPages); } } else { // Don't have data in the table echo CONST_ERROR_MESSAGE_NO_DATA; }