MINI MINI MANI MO
<?
session_start();
if($_SESSION["lang"] == "") $_SESSION["lang"] = "th" ;
?>
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<!-- Stylesheets
============================================= -->
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,600,700|Montserrat:400,700|Crete+Round:400italic" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Kanit" rel="stylesheet">
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/swiper.css" type="text/css" />
<link rel="stylesheet" href="css/medical.css" type="text/css" />
<link rel="stylesheet" href="css/dark.css" type="text/css" />
<link rel="stylesheet" href="css/font-icons.css" type="text/css" />
<link rel="stylesheet" href="css/medical-icons.css" type="text/css" />
<link rel="stylesheet" href="css/animate.css" type="text/css" />
<link rel="stylesheet" href="css/magnific-popup.css" type="text/css" />
<link rel="stylesheet" href="css/fonts.css" type="text/css" />
<link rel="stylesheet" href="css/responsive.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?php
if($_SESSION["lang"] == "th")
{
?><link href="css/th.css" rel="stylesheet"><?php
}
elseif($_SESSION["lang"] == "en")
{
?><link href="css/en.css" rel="stylesheet"><?php
}
elseif($_SESSION["lang"] == "cn")
{
?><link href="css/cn.css" rel="stylesheet"><?php
}
elseif($_SESSION["lang"] == "jp")
{
?><link href="css/jp.css" rel="stylesheet"><?php
}
elseif($_SESSION["lang"] == "mm")
{
?><link href="css/mm.css" rel="stylesheet"><?php
}
elseif($_SESSION["lang"] == "ara")
{
?><link href="css/ara.css" rel="stylesheet"><?php
}
?>
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
<link rel="stylesheet" href="css/colors.php?color=168c48" type="text/css" />
<? include "include/titledata.php"; ?>
<!-- Document Title
============================================= -->
<title><?php echo $title6;?></title>
<!-- KEYWORDS -->
<meta name="keywords" content="<?php echo $key6;?>" />
<!-- DESCRIPTION -->
<meta name="description" content="<?php echo $des6;?>" />
<style>
.form-control.error { border: 2px solid red; }
#primary-menu ul li#know > a { color:#FFF!important; }
li.activePage a, li.control-page a {
color: #FFF !important; background-color: #168c48 !important; border-color: #168c48 !important;
}
</style>
</head>
<body class="stretched">
<!-- Document Wrapper
============================================= -->
<div id="wrapper" class="clearfix">
<? include "header.php"; ?>
<?
$cat_id = null;
if(isset($_GET['cat_id']))
{
$cat_id = $_GET['cat_id'];
}
$strSQL = "SELECT * FROM know_cat where cat_id ='".$cat_id."'";
$objQuery = mysqli_query($objCon,$strSQL);
$objResult = mysqli_fetch_array($objQuery,MYSQLI_ASSOC);
?>
<!-- Page Title
============================================= -->
<section id="page-title">
<div class="container clearfix">
<ol class="breadcrumb">
<li><a href="index.php">หน้าแรก</a></li>
<li>ความรู้ทางการแพทย์</li>
</ol>
</div>
</section><!-- #page-title end -->
<!-- Content
============================================= -->
<section id="content">
<div class="content-wrap">
<div class="container clearfix">
<!-- Post Content
============================================= -->
<div class="postcontent nobottommargin clearfix">
<div class="heading-block">
<?php
if($objResult["category"] != "")
{
?>
<h2><?php echo $objResult["category"];?> </h2>
<?php
}else{
?>
<h2 class="color"> ความรู้ทางการแพทย์ </h2>
<?php
}
?>
</div>
<!-- Posts
============================================= -->
<div id="posts" class="small-thumbs">
<?php
if($cat_id != "")
{
?>
<?php
date_default_timezone_set('Asia/Bangkok');
$sqlp = "SELECT * FROM knowledge
where cat_id ='".$cat_id."'
";
$objQuery6 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery6);
$Per_Page = 6; // Per Page
error_reporting( error_reporting() & ~E_NOTICE );
$Page = $_REQUEST["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows2<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows2 % $Per_Page)==0)
{
$Num_Pages =($Num_Rows2/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows2/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$sqlp .=" order by know_id DESC LIMIT $Page_Start , $Per_Page";
$QueryP = mysqli_query($objCon,$sqlp);
?>
<?php
}else{
?>
<?php
date_default_timezone_set('Asia/Bangkok');
$sqlp = "SELECT * FROM knowledge
";
$objQuery6 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery6);
$Per_Page = 6; // Per Page
error_reporting( error_reporting() & ~E_NOTICE );
$Page = $_REQUEST["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows2<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows2 % $Per_Page)==0)
{
$Num_Pages =($Num_Rows2/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows2/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$sqlp .=" order by know_id DESC LIMIT $Page_Start , $Per_Page";
$QueryP = mysqli_query($objCon,$sqlp);
?>
<?php
}
?>
<?php
while($objResult6 = mysqli_fetch_array($QueryP,MYSQLI_ASSOC))
{
?>
<div class="entry clearfix">
<div class="entry-image">
<a href="detail.php?cat_id=<?php echo $objResult6["cat_id"];?>&know_id=<?php echo $objResult6["know_id"];?>"><img class="image_fade" src="upload_file/<?php echo $objResult6["img"];?>" alt="<?php echo $objResult6["know"];?>"></a>
</div>
<div class="entry-c">
<div class="entry-title">
<h2><a href="detail.php?cat_id=<?php echo $objResult6["cat_id"];?>&know_id=<?php echo $objResult6["know_id"];?>"><?php echo $objResult6["know"];?></a></h2>
</div>
<ul class="entry-meta clearfix">
<li><i class="icon-calendar3"></i> <?php echo date("jS F Y",strtotime($objResult6["knowdate"]));?></li>
</ul>
<div class="entry-content">
<p><?php echo $objResult6["sub"];?></p>
</div>
</div>
</div>
<?php
}
?>
</div><!-- #posts end -->
<div class="center">
<ul class="pagination">
<?php
if($Prev_Page)
{
echo "<li class='control-prev'><a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page' aria-label='Previous'><span aria-hidden='true'>«</span></a></li>";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "<li><a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a></li>";
}
else
{
echo "<li class='active'><a> $i </a></li>";
}
}
if($Page!=$Num_Pages)
{
echo "<li class='control-next'><a href='$_SERVER[SCRIPT_NAME]?Page=$Next_Page' aria-label='Next'><span aria-hidden='true'>»</span></a></li>";
}
?>
</ul>
</div>
</div><!-- .postcontent end -->
<!-- Sidebar
============================================= -->
<div class="sidebar nobottommargin col_last clearfix">
<div class="sidebar-widgets-wrap">
<div class="widget clearfix">
<div class="fancy-title title-dotted-border"><h4>ความรู้ทางการแพทย์ </h4></div>
<ul class="iconlist" style="padding-left:10px;">
<?php
$strSQL5 = "SELECT * FROM know_cat ORDER BY cat_id";
$objQuery5 = mysqli_query($objCon,$strSQL5);
?>
<?php
while($objResult5 = mysqli_fetch_array($objQuery5,MYSQLI_ASSOC))
{
?>
<li><a href="knowledge.php?cat_id=<?php echo $objResult5["cat_id"];?>"><i class="icon-double-angle-right"></i> <?php echo $objResult5["category"];?></a></li>
<?php
}
?>
</ul>
</div>
</div>
</div><!-- .sidebar end -->
</div>
</div>
</section><!-- #content end -->
<? include "footer.php"; ?>
</body>
</html>
OHA YOOOO