/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
jobs
/
up file
home
<?php require('header.php') ?> <div class="main-body animated fadeInRight"> <div class="ibox"> <div class="ibox-title"> <div class="row"> <div class="col-lg-3 mb-2"> <h3>ประกาศงาน</h3> </div> </div> <div class="ibox-tools"> <button class="btn btn-sm btn-primary" onclick="form_add()"><i class="fa fa-plus"></i> เพิ่มประกาศ</button> </div> </div> <div class="ibox-content"> <!----- ตาราง ----> <div id="Loading"> <div class="spiner-example"> <div class="sk-spinner sk-spinner-cube-grid"> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> <div class="sk-cube"></div> </div> </div> </div> <div id="show_table"></div> <!----- ตาราง ----> </div> </div> </div> <div class="modal fade" id="myModal" 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> <?php require('footer.php') ?> <script> $(document).ready(function() { GetFrom() var today = new Date(); var date = today.toISOString().split('T')[0]; $('#date').val(date); }); function GetFrom() { let member_id = localStorage.getItem('member_id'); $.ajax({ type: "POST", url: "ajax/job/get_form.php", data: { member_id: member_id }, dataType: "html", success: function(data) { $("#show_table").html(data); $('.dataTables-example').DataTable({ pageLength: 25, responsive: true, ordering: false, }); $("#Loading").hide(); } }); } function SubmitJob() { let formData = new FormData($("#frm_job")[0]); $.ajax({ type: "POST", url: "ajax/job/add_post.php", data: formData, cache: false, contentType: false, processData: false, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: 'บันทึกข้อมูลสำเร็จ', type: 'success', showConfirmButton: false, timer: 1500 }, function() { swal.close(); $("#myModal").modal('hide'); window.location = 'job_post'; }); } else if (data.result == 0) { swal({ title: 'แจ้งเตือน', text: data.message, type: 'warning', showConfirmButton: false, timer: 1500 }); } else if (data.result == 9) { swal({ title: 'แจ้งเตือน', text: data.message, type: 'warning', showConfirmButton: false, timer: 1500 }); } }, error: function(jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect. Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error. ' + jqXHR.responseText; } swal({ title: "แจ้งเตือน", text: "พบปัญหาการบันทึก กรุณาติดต่อผู้ดูแลระบบ" + msg, type: "error", showConfirmButton: true }); } }); } </script>