/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
up file
home
<?php include('header.php'); ?> <body class="top-navigation"> <div id="wrapper"> <div id="page-wrapper" class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="ibox"> <div class="ibox-title"> <div class="row"> <div class="col-lg-9 mb-2 ml-4"> ตั้งค่า SEO </div> <div class="ibox-tools"> <button class="btn btn-sm btn-primary" type="button" onclick="GetModal('0','add');"> <i class="fa fa-plus"></i> เพิ่มรายการ SEO </button> </div> </div> </div> <div class="ibox-content"> <!----- ตาราง ----> <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="show_table"></div> <!----- ตาราง ----> </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-md modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div id="showModal"></div> </div> </div> </div> <script> $(document).ready(function() { $('#Loading').show(); getTable(); }); function getTable() { $.ajax({ type: "POST", url: "ajax/setting_seo/get_table.php", dataType: "html", success: function(response) { $("#show_table").html(response); $('.dataTables-example').DataTable({ ordering: false, pageLength: 25, responsive: true, }); $('#Loading').hide(); } }); } function GetModal(id, type) { $("#myModal").modal('show'); if (type == 'add') { $("#showModal").load("ajax/setting_seo/modal_add.php"); } else if (type == 'edit') { $("#showModal").load("ajax/setting_seo/modal_edit.php", { id: id }); } } function AddSEO() { var formData = new FormData($("#form_add")[0]); $.ajax({ type: "post", url: "ajax/setting_seo/seo_add.php", data: formData, processData: false, contentType: false, cache: false, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: "แจ้งเตือน", text: "ดำเนินการสำเร็จ", type: "success", showConfirmButton: false, timer: 1500 }, function() { swal.close() getTable(); $("#myModal").modal('hide'); }) } else { swal({ title: "แจ้งเตือน", text: "ติดต่อเซิฟเวอร์ไม่สำเร็จกรุณาลองอีกครั้ง", type: "error" }) } } }); } function EditSEO() { var formData = new FormData($("#form_edit")[0]); $.ajax({ type: "post", url: "ajax/setting_seo/seo_edit.php", data: formData, processData: false, contentType: false, cache: false, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: "แจ้งเตือน", text: "ดำเนินการสำเร็จ", type: "success", showConfirmButton: false, timer: 1500 }, function() { swal.close() getTable(); $("#myModal").modal('hide'); }) swal } else { swal({ title: "แจ้งเตือน", text: "ติดต่อเซิฟเวอร์ไม่สำเร็จกรุณาลองอีกครั้ง", type: "error" }) } } }); } function ChangeStatus() { } </script> </body> </html>