Mini Shell
<!DOCTYPE html>
<html lang="en">
<head>
<?php include 'head.php'; ?>
<?php
include 'admin/function_date.php';
$news_id = $_GET['news_id'];
$sql = "SELECT * FROM news INNER JOIN newstype ON news.newstype_id = newstype.newstype_id WHERE news_id = '$news_id' ";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
//*** นับจำนวนผู้อ่านบทความ ***//
$sql_counter = "UPDATE news SET counter = counter+1 WHERE news_id = '$news_id'";
$result_counter = mysqli_query($link, $sql_counter);
//*** นับจำนวนผู้อ่านบทความ ***//
?>
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v3.2"></script>
<title><?php echo $row['news_topic']; ?></title>
<meta name="description" content="<?php echo $row['topic_detail']; ?>">
<meta property="og:url" content="https://www.ccp.ac.th/news_details.php?news_id=<?php echo $row['news_id']; ?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<?php echo $row['news_topic']; ?>" />
<meta property="og:description" content="<?php echo $row['topic_detail']; ?>" />
<meta property="og:image" content="https://www.ccp.ac.th/admin/images/<?php echo $row['news_images']; ?>" />
</head>
<?php include 'header.php'; ?>
<body>
<!-- Breadcrumb section -->
<div class="site-breadcrumb">
<div class="container">
<a href="index.php"><i class="fa fa-home"></i> หน้าหลัก</a> <i class="fa fa-angle-right"></i>
<span><?php echo $row['newstype_detail']; ?></span>
</div>
</div>
<!-- Breadcrumb section end -->
<?php
$date1 = $row['new_date'];
$show_date1 = displaydate($date1);
?>
<!-- Blog page section -->
<section class="blog-page-section spad pt-0">
<div class="container">
<div class="row">
<div class="col-lg-8 post-list">
<div class="post-item">
<div class="post-content">
<h3><a href="single-blog.html"><?php echo $row['news_topic']; ?></a></h3>
<div class="post-meta">
<span><i class="fa fa-calendar-o"></i> <?php echo $show_date1; ?> </span>
<span data-toggle="tooltip" data-placement="top" title="ผู้เขียนข่าว" ><i class="fa fa-pencil-square-o"></i> <?php echo $row['user_author']; ?> </span>
</div>
<?php echo $row['news_detail']; ?>
<br>
<img src="admin/images/<?php echo $row['news_images']; ?>">
</div>
<div class="fb-comments" data-href="https://www.ccp.ac.th/news_details.php?news_id=<?php echo $row['news_id']; ?>"
data-numposts="5" data-order-by="reverse_time" >
</div>
</div>
</div>
<!-- sidebar -->
<?php
$newstype_id = $row['newstype_id'];
$sql_type = "SELECT * FROM news INNER JOIN newstype ON news.newstype_id = newstype.newstype_id WHERE news.newstype_id = $newstype_id ORDER BY news_id DESC LIMIT 4";
$result_type = mysqli_query($link, $sql_type);
?>
<div class="col-sm-8 col-md-5 col-lg-4 col-xl-3 offset-xl-1 offset-0 pl-xl-0 sidebar">
<!-- widget -->
<div class="widget">
<form class="search-widget">
<input type="text" placeholder="ค้นหา...">
<button><i class="ti-search"></i></button>
</form>
</div>
<!-- widget -->
<div class="widget">
<h5 class="widget-title"><?php echo $row['newstype_detail']; ?></h5>
<div class="recent-post-widget">
<?php
while ($row_type = mysqli_fetch_array($result_type)) {
?>
<?php
$date2 = $row_type['new_date'];
$show_date2 = displaydate($date2);
?>
<!-- recent post -->
<div class="rp-item">
<a href="news_details.php?news_id=<?php echo $row_type['news_id']; ?>">
<div class="rp-thumb set-bg" data-setbg="admin/images/<?php echo $row_type['news_images']; ?>"></div>
<div class="rp-content">
<h6><?php echo $row_type['news_topic']; ?></h6>
<p><i class="fa fa-calendar-o"></i> <?php echo $show_date2; ?></p>
</div>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- widget -->
</div>
</div>
</div>
</section>
<!-- Blog page section end -->
<?php include 'footer.php'; ?>
</body>
</html>
Zerion Mini Shell 1.0