/
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-title"> <div class="row"> <div class="col-lg-9 mb-2 ml-4"> ข้อมูลบริษัท </div> <div class="ibox-tools"> <a href="company_info_add" class="btn btn-sm btn-primary" target="_blank"><i class="fa fa-plus"></i> เพิ่มข้อมูล</a> </div> </div> </div> <div class="ibox-title"> <div class="row"> <div class="col-5"> <div class="form-group"> <label for="company_status">สถานะ</label> <select class="select2" name="company_status" id="company_status"> <option value="x" selected>ทั้งหมด</option> <option value="1">ดำเนินการอยู่</option> <option value="0">ยกเลิก</option> </select> </div> </div> <div class="col-5"> <div class="form-group"> <label for="search">ค้นหา</label> <input type="text" class="form-control" name="search" id="search" aria-describedby="helpId" placeholder=""> </div> </div> <div class="col-2"> <label for="search"> </label> <div class="input-group-append"> <button class="btn btn-primary w-100" type="button" id="button-addon2" onclick="GetCompanyInfo()">ค้นหา</button> </div> </div> </div> </div> <div class="ibox-content"> <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> </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() { const inputField = document.getElementById("search"); inputField.addEventListener("keydown", function(event) { if (event.key === "Enter") { GetCompanyInfo() } }); GetCompanyInfo(); }); function GetCompanyInfo() { const search = $("#search").val(); const company_status = $("#company_status").val(); $.ajax({ type: "POST", url: "ajax/company_info/get_table.php", data: { search: search, company_status: company_status, }, dataType: "html", success: function(response) { $("#Loading").hide(); $("#showTable").html(response); $('table').DataTable({ pageLength: 25, responsive: true, ordering: false, "searching": false, }); $(".select2").select2({ width: "100%" }); } }); } function ChangStatus(company_id) { $.ajax({ type: "POST", url: "ajax/company_info/change_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(); GetCompanyInfo(); }); } 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 DownloadAll(company_id) { $("#DownloadAll").attr("disabled", true); $.ajax({ type: "POST", url: "ajax/company_info/dowload_image.php", data: { company_id: company_id }, dataType: "json", success: function(response) { console.log(response); if (response.rs == 1) { window.open('ajax/company_info/' + response.file, '_blank'); } $("#DownloadAll").attr("disabled", false); } }); } </script> </body> </html>