<div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <h3 class="box-title">Slider List</h3> </div><!-- /.box-header --> <div class="box-body table-responsive no-padding table-responsive"> <table id="datatable" class="table table-bordered dataTable no-footer "> <thead> <tr style="background-color: #79dde66e;"> <th >NO</th> <th class="text-center">title</th> <th class="text-center">img</th> <th class="text-center">description</th> <th class="text-center">lang</th> <th class="text-center">start date</th> <th class="text-center">end date</th> <th class="text-center">Edit</th> <th class="text-center">Delete</th> </tr> </thead> <?php $this->db->order_by('id','desc'); $data = $this->db->get('mcl_sliders')->result_array(); ?> <?php foreach ($data as $key => $data){ ?> <tr> <td style="width: 2%"></td> <td style="width: 10%"><?php echo $data['title']; ?></td> <td style="width: 5%"> <?php if (!empty($data['file_name'])): ?> <img src=" <?php echo ("uploads/".$data['file_name']) ?>" alt="" style="width: 100px; height: 100px;"> <?php else: ?> <img src=" <?php echo ("uploads/access.png") ?>" alt="" style="width: 100px; height: 100px;"> <?php endif ?> </td> <td style="width: 15%"><?php echo $data['description']; ?></td> <?php $langlist = $this->db->get_where('mcl_langs',['code'=>$data['lang']])->result_array(); foreach ($langlist as $key => $langlist) { ?> <td style="width: 5%" class="text-center"><?php echo $langlist['name']; ?></td> <?php } ?> <td style="width: 8%"><?php echo $data['start_date']; ?></td> <td style="width: 8%"><?php echo $data['end_date']; ?></td> <td style="width: 5%" class="text-center"><a href="editslider/?id=<?php echo $data['id'];?>"><button class="btn btn-warning">Edit</button></a></td> <th style="width: 5%" class="text-center"> <form action="#" method="post" onsubmit="return" > <input type="hidden" name="id" value="<?php echo $data['id']; ?>"> <button class="btn btn-danger sweet-3" type="submit" onclick="myFunction()" >Delete</button> </form> </th> </tr> <?php } ?> </table> </div><!-- /.box-body --> <div class="box-footer clearfix"> <?php echo $this->pagination->create_links(); ?> </div> </div><!-- /.box --> </div> </div>
<script> document.querySelector('.sweet-3').onclick = function(){ swal("Good job!", "You clicked the button!", "success"); }; </script>
onclick="myFunction()" // คืออะไรครับ ถ้าไม่ใช้เอาออก
$(document).ready(function () { document.querySelector('.sweet-3').onclick = function(){ swal("Good job!", "You clicked the button!", "success"); }; });
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง