<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal" >ยกเลิกลงทะเบียน <?php echo $row['subject_id']?></button>
<a href="sqlenroll.php?action=delete&delete_id=<?php echo $row['subject_id']?>"> <button type="button" class="btn btn-danger">ยืนยัน</button> </a>
<?php require('connectsql.php') ;?> <?php include('stylesheet.php');?> <?php include('navbar.php');?> <div class="container-fluid"> <nav class="navbar navbar-expand-lg navbar-light"> <form class="form-inline my-2"> <img src="images/add.svg" height="32" width="32"/> <label class="ml-1" for="inputEmail4"> รายวิชาทั้งหมดที่เปิดสอน</label> </form> </nav> <table class="table table-hover"> <thead> <tr> <th scope="col">รหัสวิชา</th> <th scope="col">ชื่อวิชา</th> <th scope="col">ผู้สอน</th> <th scope="col">จำนวนชั่วโมงเรียน</th> <th scope="col">ค่าลงทะเบียน</th> <th scope="col">จำนวนผู้เรียนที่ลงเรียน</th> <th scope="col">ลงทะเบียนเรียน</th> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM tb_subject LEFT JOIN tb_teacher ON tb_subject.subject_teacher = tb_teacher.teacher_id"; $result = mysqli_query($conn,$sql); if(mysqli_num_rows($result)>0){ $i = 1 ; while($row = $result->fetch_assoc()) { $fname = $row['teacher_fname']; $lname = $row['teacher_lname']; $id = $row['subject_id']; ?> <tr> <td scope="row"><?php echo $row['subject_code']; ?></th> <td data-toggle="popover" title="วันที่เรียน" data-content="<?php echo $row['subject_date']; ?>"><ins><?php echo $row['subject_name']; ?></ins> </td> <td><?php echo $fname.' '.$lname; ?></td> <td><?php echo $row['subject_studyhours']; ?></td> <td><?php echo $row['subject_cost']; ?></td> <td><?php echo $row['subject_totalstudent']; ?></td> <td> <?php $sqll = "SELECT * FROM tb_enroll WHERE subject_id = '$id' "; $resultt = mysqli_query($conn,$sqll); if(mysqli_num_rows($resultt)==0) { ?> <a href="enrolldetail.php?page=enroll&subject_id=<?php echo $row['subject_id']?>"> <button class="mr-3 btn btn-primary">ลงทะเบียนเรียน</button></a> <?php } else {?> <a href="enrollpayment.php?page=enroll&subject_id=<?php echo $row['subject_id']?>"> <button class="mr-3 btn btn-warning">จ่ายเงินค่าลงทะเบียน</button></a> <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal" >ยกเลิกลงทะเบียน</button> <!-- Modal --> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">ยืนยันการยกเลิกลงทะเบียน</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> คุณยืนยันการยกเลิกลงทะเบียนหรือไม่ ? <?php echo $row['subject_id']?> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button> <a href="sqlenroll.php?action=delete&delete_id=<?php echo $row['subject_id']?>"><button type="button" class="btn btn-danger">ยืนยัน<?php echo $row['subject_id']?></button></a> </div> </div> </div> </div> <?php } ?> </td> </tr> <?php $i++; } } else { ?> <tr> <td colspan="10">ระบบยังไม่มีวิชาที่เปิดลงทะเบียน</td> </tr> <?php } ?> </tbody> </table> </form> </div> <?php include('footer.php');?> <script> $(document).ready(function(){ $('[data-toggle="popover"]').popover(); }); </script>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal-<?php echo $row['subject_id']?>" >ยกเลิกลงทะเบียน</button> //... <!-- Modal --> <div class="modal fade" id="exampleModal-<?php echo $row['subject_id']?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
data-target="#exampleModal<?php echo $row['subject_id']?>"
<script type='module'>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง