include('public_inc.php');?>
include ('include_less.php') ?>
connectdb();
charSetThai();
loadControl();
/*loadControlAddr(1);*/
?>
Thai Kenwa
include ('include_stylesheet.php') ?>
include ('include_head.php') ?>
if ($_SERVER['SCRIPT_NAME']) {
$scriptname = $_SERVER['SCRIPT_NAME'];
}
if ($_SERVER['QUERY_STRING']) {
$scriptname .= "?".$_SERVER['QUERY_STRING'];
}
$Con_DataPage=8;
$currentPage = $_SERVER["PHP_SELF"];
$range = 5; // จำนวนแสดงหน้าและหลังเลขหน้าที่เลือก
$pageNum = 1;
if (isset($_GET['page'])) {
$pageNum= $_GET['page'];
}
$startRowQuery = ($pageNum-1 )* $Con_DataPage;
$sql = "SELECT * FROM tkw_tblproducts_type WHERE PTypeOnlineStatus='Y' AND LangRefer = 1 ORDER BY PTypeLocationShow ASC";
$querylimit = sprintf("%s LIMIT %d, %d", $sql, $startRowQuery, $Con_DataPage);
$result= mysql_query($querylimit);
if (isset($_GET['totalRows'])) {
$totalRows = $_GET['totalRows'];
} else {
$allQuery= mysql_query($sql);
if($allQuery){
$totalRows = mysql_num_rows($allQuery);
}
}
$totalPages = ceil($totalRows/$Con_DataPage);
?>
$pagegoto = ($pageNum-1) * $Con_DataPage; // หาหน้าที่จะกระโดดไป
$pagestart = $pageNum - $range;
$pageend = $pageNum + $range;
if ($pagestart <= 1) {
$pagestart = 1;
}
if ($pageend >= $totalPages) {
$pageend = $totalPages;
}
?>
if($totalRows > 0){
$iData=1;
while($rowData = mysql_fetch_array($result)){
$DataGroupID = convertToText(stripStr($rowData["GroupRefer"]));
$DataTitle = convertToText(stripStr($rowData["PTypeTitle"]));
$DataShortDetail = convertToText(stripStr($rowData["PTypeDesciption"]));
$DataImagesName = convertToText(stripStr($rowData["PTypeIcon"]));
if (is_file($ListPathImgProduct.$DataImagesName)) {
$ProRec_PThumbnailShow = "";
}else {
$ProRec_PThumbnailShow = "";
}
?>
}else{?>
}?>
$iData++;}?>
}@mysql_free_result($result);?>
include ('include_footer.php') ?>