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" />
<!-- Medical Demo Specific Stylesheet -->
<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 $title12;?></title>
<!-- KEYWORDS -->
<meta name="keywords" content="<?php echo $key12;?>" />
<!-- DESCRIPTION -->
<meta name="description" content="<?php echo $des12;?>" />
<style>
#primary-menu ul li#news > a { color:#FFF; font-weight: 600; }
</style>
</head>
<body class="stretched">
<!-- Document Wrapper
============================================= -->
<div id="wrapper" class="clearfix">
<? include "header.php"; ?>
<!-- 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">
<!-- Posts
=============================================
<div id="posts" class="post-grid grid-container post-masonry clearfix"> -->
<div id="posts" class=" padding20 small-thumbs">
<?php
date_default_timezone_set('Asia/Bangkok');
$strSQL4 = "SELECT * FROM news ORDER BY news_id DESC";
$objQuery4 = mysqli_query($objCon,$strSQL4);
switch($_SESSION["lang"])
{
case "th" :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news1 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
case "en" :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news2 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
case "cn" :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news3 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
case "jp" :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news4 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
case "mm" :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news5 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
case "ara" :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news6 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
default :
$sqlp ="SELECT a.*, b.admin_id, b.username
FROM news a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
WHERE a.news1 !=''
";
$objQuery2 = mysqli_query($objCon,$sqlp);
$Num_Rows2 = mysqli_num_rows($objQuery2);
break;
}
$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 news_id DESC LIMIT $Page_Start , $Per_Page";
$QueryP = mysqli_query($objCon,$sqlp);
?>
<?php
while($objResult4 = mysqli_fetch_array($QueryP,MYSQLI_ASSOC))
{
switch($_SESSION["lang"])
{
case "th" :
$news = $objResult4["news1"];
$subtitle = $objResult4["sub1"];
break;
case "en" :
$news = $objResult4["news2"];
$subtitle = $objResult4["sub2"];
break;
case "cn" :
$news = $objResult4["news3"];
$subtitle = $objResult4["sub3"];
break;
case "jp" :
$news = $objResult4["news4"];
$subtitle = $objResult4["sub4"];
break;
case "mm" :
$news = $objResult4["news5"];
$subtitle = $objResult4["sub5"];
break;
case "ara" :
$news = $objResult4["news6"];
$subtitle = $objResult4["sub6"];
break;
default :
$news = $objResult4["news1"];
$subtitle = $objResult4["sub1"];
break;
}
?>
<?php
if($news != "")
{
?>
<div class="entry clearfix">
<div class="entry-image">
<a href="upload_file/<?php echo $objResult4["img"];?>" data-lightbox="image">
<img class="image_fade" src="upload_file/<?php echo $objResult4["img"];?>" alt="Image"></a>
</div>
<div class="entry-c">
<div class="entry-title">
<h2><a href="news-detail.php?news_id=<?php echo $objResult4["news_id"];?>"><?php echo $news;?></a></h2>
</div>
<ul class="entry-meta clearfix">
<li><i class="icon-calendar3"></i> <?php echo date("jS F Y",strtotime($objResult4["newsdate"]));?> </li>
</ul>
<div class="entry-content">
<p><?php echo $subtitle;?></p>
<a href="news-detail.php?news_id=<?php echo $objResult4["news_id"];?>"class="button button-mini button-border button-circle button-blue "><?php echo $read;?></a>
</div>
</div>
</div>
<?php
}else{
}
?>
<?php
}
?>
</div> <!-- End Posts ================================ -->
<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> <!-- # Post Content end -->
</div>
</div>
</section><!-- #content end -->
<? include "footer.php"; ?>
<style type="text/css">
li.activePage a{
/* don't forgot change color */
color: #FFF !important;
background-color: #168c48 !important;
border-color: #168c48 !important;
}
</style>
</body>
</html>
OHA YOOOO