include("public_inc.php");?> connectdb(); charSetThai(); loadControl(); ?> if ($_SERVER['SCRIPT_NAME']) { $scriptname = $_SERVER['SCRIPT_NAME']; } if ($_SERVER['QUERY_STRING']) { $scriptname .= "?".$_SERVER['QUERY_STRING']; } $CarTypePage=10; $currentPage = $_SERVER["PHP_SELF"]; $pageNum = 1; if (isset($_GET['page'])) { $pageNum= $_GET['page']; } $startRowQuery = ($pageNum-1 )* $CarTypePage; $sql = "SELECT * FROM bl_tblcartype WHERE 1 AND OnlineStatus='Y' ORDER BY LocationShow ASC, DateRegister DESC"; $querylimit = sprintf("%s LIMIT %d, %d", $sql, $startRowQuery, $CarTypePage); //$querylimit = sprintf("%s LIMIT %d", $sql, $startRowQuery); $Query= mysql_query($sql); if (isset($_GET['totalRows'])) { $totalRows = $_GET['totalRows']; } else { $allQuery= mysql_query($sql); if($allQuery){ $totalRows = mysql_num_rows($allQuery); } } $totalPages = ceil($totalRows/$CarTypePage); ?>
|