Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/relations.php

<!DOCTYPE html>
<html lang="en">
<head>   
<title>ข่าวประชาสัมพันธ์โรงเรียนเทศบาลวัดชัยชุมพล | CCP</title>  
<meta name="description" content="ข่าวประชาสัมพันธ์ | โรงเรียนเทศบาลวัดชัยชุมพล | Watchaichumpol municipality school"> 
<?php include 'head.php'; ?>
<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> 
</head> 
<?php include 'header.php'; ?>
<?php    
         include 'admin/function_date.php';
?>
   <?php
       //***แบ่งหน้า***//
    $rows = 6;  
    $sqlnum = "SELECT * FROM news where newstype_id = '002'";
    $result = mysqli_query($link, $sqlnum);
    $row = mysqli_num_rows($result);
    $total_page = ceil($row/$rows);
      if(empty($_GET['page'])){ 
              $page=1;
          } else {
              $page=$_GET['page'];
            }  
          if($page>=$total_page) $page=$total_page; 
          $start=($page-1)*$rows;
   //***แบ่งหน้า***//
   
    $newstype_id = 002;
    $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 $start,$rows";
    $result_type = mysqli_query($link, $sql_type);
    
    //***แบ่งหน้า***//
     if($page > 1)
            {
	    $i = ($rows * ($page-1)) + 1; 
            }
    //***แบ่งหน้า***//
    
    ?> 
<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>ข่าวประชาสัมพันธ์ทั้งหมด</span>
		</div>
	</div>
	<!-- Breadcrumb section end -->


	<!-- Courses section -->
	<section class="full-courses-section spad pt-0">
		<div class="container">
			<div class="row">
                            
                            <?php
                            while ($row_type = mysqli_fetch_array($result_type)) {
                                ?>  
                              <?php
                                $date = $row_type['new_date'];
                                $show_date = displaydate($date);
                                ?>
                             <!-- course item -->
		          <div class="col-xl-6">
		           <div class="blog-item">
                             <a href="news_details.php?news_id=<?php echo $row_type['news_id']; ?>">
                                 <div class="blog-thumb set-bg" data-setbg="admin/images/<?php echo $row_type['news_images']; ?>"></div>                             
				 <div class="blog-content">
					<h4><?php echo $row_type['news_topic']; ?></h4>
                                        </a>
					<div class="blog-meta">
					  <span><i class="fa fa-calendar-o"></i> <?php echo $show_date; ?></span>
					  <span><i class="fa fa-eye"></i> <?php echo $row_type['counter']; ?> ครั้ง</span>
					</div>
					<p><?php echo $row_type['topic_detail']; ?> ...</p>
                                             <h5 style="color: #FF6600;" class="cource-price"><i class="fa fa-share-alt"></i> Share : 
                                                <div class="fb-share-button" 
                                                     data-href="https://www.ccp.ac.th/news_details.php?news_id=<?php echo $row_type['news_id']; ?>" 
                                                     class="fb-xfbml-parse-ignore" data-size="small" data-layout="button_count">
                                                </div>
                                                &nbsp; 
                                            </h5>
                                        
                                 </div>
			</div>
                            </div>
			      <?php  }  ?>	
				<!-- course item -->
			
			</div>
			<div class="text-center">
                         <!-- แบ่งหน้า -->
                            <ul class="site-pageination">    
                                <li>                                
                                    <a <?php if ($page == 1) echo'class="disabled"'; ?> href="relations.php?page=<?php echo $page - 1; ?>">&nbsp;<i class="fa fa-angle-left"></i>  ก่อนหน้า &nbsp;

                                    </a>
                                </li>
                                <?php
                                for ($i = 1; $i <= $total_page; $i++) {
                                    if ($page - 2 >= 2 and ( $i > 2and$i < $page - 2)) {
                                        echo "<li><a href=>...</a></li>";
                                        $i = $page - 2;
                                    }
                                    if ($page + 5 <= $total_page and ( $i >= $page + 3 and $i <= $total_page - 2)) {
                                        echo "<li><a href=>...</a></li>";
                                        $i = $total_page - 1;
                                    }
                                    ?>
                                    <li><a <?php if ($page == $i) echo'class="active"'; ?> href="relations.php?page=<?php echo $i; ?>"> <?php echo $i; ?> </a></li>
                                <?php } ?>
                                <li>
                                    <a <?php if ($page == $total_page) echo'class="disabled"'; ?> href="relations.php?page=<?php echo $page + 1; ?>" >&nbsp; ถัดไป <i class="fa fa-angle-right"></i>&nbsp; 
                                    </a>
                                </li>
                            </ul>
                         <!-- แบ่งหน้า --> 
			</div>
		</div>
	</section>
	<!-- Courses section end-->

<?php include 'footer.php'; ?>	
	
</body>
</html>

Zerion Mini Shell 1.0