/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
ajax
/
certification
/
up file
home
<?php include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $list = []; $sql = "SELECT * FROM `tbl_certification_lot` ORDER BY create_datetime DESC"; $result = mysqli_query($connection, $sql); while ($row = mysqli_fetch_assoc($result)) { $sql_count = "SELECT COUNT(*) AS count FROM tbl_certification_lot_member WHERE certification_lot_id = '{$row["certification_lot_id"]}'"; $res_count = mysqli_query($connection, $sql_count); $row_count = mysqli_fetch_assoc($res_count); $data = [ "certification_lot_id" => $row["certification_lot_id"], "create_note" => $row["create_note"], "certification_date" => $row["certification_date"], "effective_date" => $row["effective_date"], "member_count" => $row_count['count'] ]; array_push($list, $data); } ?> <table class="table table-striped table-bordered"> <thead> <tr> <th>#</th> <th>วันที่รับรอง</th> <th>วันที่มีผล</th> <th>จำนวนสมาชิก</th> <th>หมายเหตุ</th> <th style="width: 10%;" class="text-center">ข้อมูล</th> </tr> </thead> <tbody> <?php foreach ($list as $row) : ?> <tr> <td><?php echo $i += 1; ?></td> <td><?php echo date('d/m/Y', strtotime($row['certification_date'])); ?></td> <td><?php echo date('d/m/Y', strtotime($row['effective_date'])) ?></td> <td><?php echo $row['member_count']; ?></td> <td><?php echo $row['create_note']; ?></td> <td class="text-center"> <button class="btn btn-warning btn-sm w-100 mb-2" onclick="GetModalEditCer('<?php echo $row['certification_lot_id']; ?>')">แก้ไข</button> <a href="certification_detail.php?id=<?php echo $row['certification_lot_id']; ?>" class="btn btn-primary btn-sm w-100 mb-2"><i class="fa fa-search"></i> ดูข้อมูล</a> <button class="btn btn-danger btn-sm w-100 mb-2" onclick="DeleteData('<?php echo $row['certification_lot_id']; ?>')">ลบรอบ</button> </td> </tr> <?php endforeach; ?> </tbody> </table>