/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
ajax
/
blog_setting
/
up file
home
<?php include("../../../config/main_function.php"); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $today = date("Y-m-d"); $show_date = date("d/m/Y", strtotime($show_date)); $show_status = mysqli_real_escape_string($connection, $_POST['show_status']); if ($show_status == '1') { $con_status = "active_status = '$show_status' OR active_status = '2'"; }else{ $con_status = "active_status = '$show_status'"; } $temp_start = explode('/', $_POST['date_start']); $date_start = date('Y-m-d', strtotime($temp_start['0'] . "-" . $temp_start['1'] . "-" . $temp_start['2'])); $temp_end = explode('/', $_POST['date_end']); $date_end = date('Y-m-d', strtotime($temp_end['0'] . "-" . $temp_end['1'] . "-" . $temp_end['2'])); $search = mysqli_real_escape_string($connection, $_POST['search']); if ($search != "") { $con_search = "AND blog_title LIKE '%$search%'"; } else { $con_search = ""; } $sql = "SELECT * FROM tbl_blog WHERE $con_status $con_search ORDER BY show_date DESC"; $rs = mysqli_query($connection, $sql) or die($connection->error); $menu_access = explode(",", $_SESSION['menu_access']); ?> <div class="table-responsive animated fadeInDown" style="padding-top:20px;"> <table class="table table-striped table-bordered table-hover dataTable" id="myTable"> <thead> <tr role="row"> <th style="width: 10%;">วันที่ประกาศ</th> <th style="width: 10%;" class="text-center">รูป blog</th> <th style="width: 40%;">ชื่อ blog</th> <th style="width: 5%;">สถานะ</th> <th style="width: 5%;">จัดการ</th> </tr> </thead> <tbody> <?php while ($row = mysqli_fetch_assoc($rs)) { $blog_datetime = date("d/m/Y", strtotime($row['show_date'])); ?> <tr id="tr_<?php echo $row['blog_id'] ?>"> <td><?php echo $blog_datetime ?></td> <td class="text-center"> <div class="col-md-12 col-sm-12"> <h1> <img src="../../../files/blog_files/<?php echo ($row['blog_image'] != "") ? $row['blog_image'] : "no-image.png" ?>" width="150" height="auto" /> </h1> </div> </td> <td><?php echo $row['blog_title'] ?></td> <td> <?php echo ($row['blog_status'] == '0') ? '<span class="badge badge-warning w-100 mb-2">โพสรอตรวจ</span>' : "" ?> <button type="button" class="btn <?php echo ($row['active_status'] == '1') ? "btn-primary" : "btn-danger" ?> btn-block btn-xs" onclick="ChangeStatus(this,'<?php echo $row['blog_id'] ?>')"><?php echo ($row['active_status'] == '1') ? "กำลังแสดง" : "ไม่แสดง" ?></button> <?php if ($row['show_date'] > $today) { ?> <span class="badge badge-warning w-100">( โพสล่วงหน้า )</span> <?php } ?> </td> <td class="text-center"> <div class="col-md-12 col-sm-12"> <?php if ($row['blog_status'] == '0' && in_array(14, $menu_access)) { ?> <button class="btn btn-primary btn-xs btn-block mb-2" onclick="ApprovePost('<?php echo $row['blog_id'] ?>')">อนุมัติโพส</button> <?php } ?> <a href="https://efa.or.th/blog-post-preview?news=<?php echo $row['blog_id'] ?>" target="_blank" class="btn btn-info btn-block btn-xs mb-2"><i class="fa fa-search"></i> ดูรายละเอียด</a> <a href="blog_setting?id=<?php echo $row['blog_id']; ?>" class="btn btn-warning btn-block btn-xs mb-1 "></i> ตั้งค่า Blog</a> <button type="button" class="btn btn-danger btn-block btn-xs mb-2" onclick="DeleteContent('<?php echo $row['blog_id'] ?>')"><i class="fa fa-close"></i> ลบ</button> </div> </td> </tr> <?php } ?> </tbody> </table> </div>