/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
up file
home
<?php include('header.php'); include('./config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); ?> <body class="top-navigation"> <div id="wrapper"> <div id="page-wrapper" class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-md-12 col-12 mb-3"> <div class="ibox-content"> <button class="btn btn-sm btn-primary" type="button" onclick="AddMenber();"> เพิ่มสมาชิก </button> <button class="btn btn-sm btn-info" type="button" onclick="ExcelList();"> Excel </button> <!-- <button class="btn btn-sm btn-success" type="button" onclick="ModalAdd();"> button </button> --> </div> </div> </div> <div class="table-responsive"> <div id="Loading"> <div class="spiner-example"> <div class="sk-spinner sk-spinner-wave"> <div class="sk-rect1"></div> <div class="sk-rect2"></div> <div class="sk-rect3"></div> <div class="sk-rect4"></div> <div class="sk-rect5"></div> </div> </div> </div> <div id="showTable"></div> </div> </div> </div> </div> <!--- init layout --> <?php include('footer.php'); ?> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-xl modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div id="showModal"></div> </div> </div> </div> <!-- --> <script> $(document).ready(function() { MemberList(); }); function MemberList() { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const id = urlParams.get('id'); $.ajax({ type: "post", url: "ajax/certification_company/get_table.php", data: { id: id }, dataType: "html", success: function(response) { $("#showTable").html(response); $("#showTable table").dataTable({ ordering: false, pageLength: 50, responsive: true, }); $('#Loading').hide(); } }); } function DeleteData(company_id) { swal({ title: 'กรุณายืนยันเพื่อทำรายการ', type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', cancelButtonText: 'ยกเลิก', confirmButtonText: 'ยืนยัน', closeOnConfirm: false }, function() { $.ajax({ type: "POST", url: "ajax/certification_company/delete_company.php", data: { company_id: company_id }, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: 'ลบข้อมูลเรียบร้อย', type: 'success', showConfirmButton: false, timer: 1500 }, function() { swal.close(); MemberList(); }); } else if (data.result == 0) { swal({ title: 'แจ้งเตือน', text: 'ลบข้อมูลไม่สำเร็จ', type: 'warning', showConfirmButton: false, timer: 1500 }); } else if (data.result == 9) { swal({ title: 'แจ้งเตือน', text: 'ไม่สามารถติดต่อเซิฟเวอร์ได้ กรุณาลองใหม่อีกครั้ง', type: 'warning', showConfirmButton: false, timer: 1500 }); } } }); }) } $.extend({ redirectPost: function(location, args) { var form = ''; $.each(args, function(key, value) { form += '<input type="hidden" name="' + key + '" value="' + value + '">'; }); $('<form action="' + location + '" method="POST">' + form + '</form>').appendTo('body') .submit(); } }); function ExcelList() { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const cer_id = urlParams.get('id'); var redirect = 'ajax/certification_company/export_detail.php'; $.redirectPost(redirect, { cer_id: cer_id }); } function ApproveComp(company_id, status) { swal({ title: 'กรุณายืนยันเพื่อทำรายการ', type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', cancelButtonText: 'ยกเลิก', confirmButtonText: 'ยืนยัน', closeOnConfirm: false }, function() { $.ajax({ type: "POST", url: "ajax/certification_company/approve_company.php", data: { company_id: company_id, status: status, }, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: 'บันทึกข้อมูลสำเร็จ', type: 'success', showConfirmButton: false, timer: 1500 }, function() { swal.close(); MemberList(); }); } else if (data.result == 0) { swal({ title: 'แจ้งเตือน', text: 'เกิดข้อผิดพลาดระหว่างบันทึก กรุณาลองใหม่', type: 'warning', showConfirmButton: false, timer: 1500 }); } else if (data.result == 9) { swal({ title: 'แจ้งเตือน', text: 'ไม่สามารถติดต่อเซิฟเวอร์ได้ กรุณาลองใหม่อีกครั้ง', type: 'warning', showConfirmButton: false, timer: 1500 }); } } }); }) } function ShowStatus(company_id) { $.ajax({ type: "POST", url: "ajax/certification_company/show_web_status.php", data: { company_id: company_id, }, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: 'บันทึกข้อมูลสำเร็จ', type: 'success', showConfirmButton: false, timer: 1500 }, function() { swal.close(); MemberList(); }); } else if (data.result == 0) { swal({ title: 'แจ้งเตือน', text: 'เกิดข้อผิดพลาดระหว่างบันทึก กรุณาลองใหม่', type: 'warning', showConfirmButton: false, timer: 1500 }); } else if (data.result == 9) { swal({ title: 'แจ้งเตือน', text: 'ไม่สามารถติดต่อเซิฟเวอร์ได้ กรุณาลองใหม่อีกครั้ง', type: 'warning', showConfirmButton: false, timer: 1500 }); } } }); } </script> </body> </html>