/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
up file
home
<?php include('header.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $datenow = date('Y-m-d'); $sql_type = "SELECT * FROM tbl_employee_type where type_name != '' ORDER BY type_name ASC"; $rs_type = mysqli_query($connection, $sql_type); $list_type = array(); while ($row_type = mysqli_fetch_array($rs_type)) { $temp_array_type = array( "employee_type_id" => $row_type['employee_type_id'], "type_name" => $row_type['type_name'], ); array_push($list_type, $temp_array_type); } error_reporting(E_ALL & ~E_NOTICE); ?> <body class="top-navigation"> <div id="wrapper" class=""> <div id="page-wrapper" class="gray-bg shadow-sm rounded"> <div class="wrapper wrapper-content animated fadeInRight"> <div id="member_count"></div> <div class="ibox"> <div class="ibox-title"> <div class="row"> <div class="col-lg-9 mb-2 ml-4"> ผู้ประกอบการ </div> <div class="ibox-tools"> <button class="btn btn-success btn-sm text-white" onclick="GetModalAdd()"><span style="color: white;"><i class="fa fa-plus"></i> เพิ่มสมาชิก</span></button> <!-- <button class="btn btn-sm btn-primary" onclick="ExportMember()"><i class="fa fa-file-excel-o"></i> Excel</button> --> </div> </div> </div> <div class="ibox-title"> <div class="row px-3"> <div class="col-md-4 col-12"> <div class="form-group"> <label class="font-">ประเภทธุรกิจ</label> <div class="input-group"> <select class="form-select" name="employee_type_id" id="employee_type_id"> <option value="x">ทั้งหมด</option> <?php foreach ($list_type as $row_type) { ?> <option value="<?php echo $row_type['employee_type_id']; ?>" <?php echo ($_SESSION['indexEmployee']['employee_type_id'] == $row_type['employee_type_id'] ? "selected" : ""); ?>> <?php echo $row_type['type_name']; ?></option> <?php } ?> </select> </div> </div> </div> <div class="col-md-4 col-12"> <div class="form-group"> <div class="input-group mt-4"> <button type="button" class="btn btn-primary mt-1" onclick="GetTable()"><i class="fa fa-search"></i> ค้นหา</button> </div> </div> </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" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-lg modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div id="showModal"></div> </div> </div> </div> </body> ่<script> $(document).ready(function() { GetTable() }); $(".form-select").select2({ width: '100%' }); function GetTable() { const employee_type_id = $("#employee_type_id").val(); $.ajax({ type: "POST", url: "ajax/setting_company/get_table.php", data: { employee_type_id: employee_type_id }, dataType: "html", success: function(response) { $("#show_table").html(response); $('.dataTables-example').DataTable({ ordering: false, pageLength: 50, responsive: true, }); $('#Loading').hide(); } }); } function GetModalAdd() { $("#myModal").modal("show"); $("#showModal").load("ajax/setting_company/modal_form_add.php", "data", function(response, status, request) { this; // dom element }); } function SetPro(value) { let province_id = value.value; $.ajax({ type: 'POST', url: 'ajax/setting_company/Amphoe.php', data: { province_id: province_id }, dataType: 'html', success: function(data) { $('#amphoe_id').html(data); $('#district_id').html("<option value=''>กรุณาเลือกแขวง/ตำบล</option>"); $("#zipcode").val(""); $("select.form-control").select2(); } }); } function SetAm(value) { let amphoe_id = value.value; $.ajax({ type: 'POST', url: 'ajax/setting_company/District.php', data: { amphoe_id: amphoe_id }, dataType: 'html', success: function(data) { $('#district_id').html(data); $("#zipcode").val(""); $("select.form-control").select2(); } }); } function SetZip(value) { let zip = $(value).find(":selected").data("zip"); $("#zipcode").val(zip); } </script> </html>