/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
up file
home
<?php include('header.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); ?> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/signature_pad/1.5.3/signature-pad.min.css"> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/signature_pad/1.5.3/signature_pad.min.js"></script> <!-- ลายเซ็น ver. เก่า --> <!-- <link href="signature/css/jquery.signaturepad.css" rel="stylesheet"> <script src="signature/js/jquery_1_10_2.min.js"></script> <script src="signature/js/numeric-1.2.6.min.js"></script> <script src="signature/js/bezier.js"></script> <script src="signature/js/jquery.signaturepad.js"></script> <script type='text/javascript' src="signature/js/html2canvas.js"></script> <script src="signature/js/json2.min.js"></script> --> <style type="text/css"> #signArea { width: 500px; margin: 0px auto; } /* .sign-container { width: 60%; margin: auto; } .sign-preview { width: 150px; height: 50px; border: solid 1px #CFCFCF; margin: 10px 5px; } */ A:link { color: #0000cc; text-decoration: none } A:visited { color: #0000cc; text-decoration: none } A:hover { color: red; text-decoration: none } </style> <!-- Input Mask--> <body class="top-navigation"> <div id="wrapper"> <div id="page-wrapper" class="gray-bg px-0"> <div class="wrapper-content animated fadeInRight"> <p style="text-align: center; font-size:40px;font-weight: bold;">ใบสมัคร<span id="level"></span> ประเภท<span id="type"></span><br />สมาคมผู้ประกอบการนำคนต่างด้าวมาทำงานในประเทศ (ประเทศไทย)</p> </div> <div id="show_form_select"></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-lg modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div id="showModal"></div> </div> </div> </div> <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-sm modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div class="modal-header"> <h4 class="modal-title">รูปภาพ</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> </div> <div class="modal-body"> <div class="row"> <div class="col-lg-12 mb-2"> <div class="form-group"> <img id="example_image" src="" style="width:100%;"> </div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i> ปิด</button> </div> </div> </div> </div> <script> function Signature() { $("#signature_box").load("signature.php"); } let member_id = localStorage.getItem("member_id"); $(document).ready(function() { $.ajax({ type: "POST", data: { member_id: member_id, }, dataType: 'json', url: "ajax/join/checkRegister.php", success: function(response) { if (response.status == 500) { location.href = "error" } else if (response.status == 200) { if (response.register_type == 1) { $('#type').html('นายจ้าง'); $('#level').html(response.register_level); } else if (response.register_type == 2) { $('#type').html(' บนจ.'); $('#level').html(response.register_level); } else if (response.register_type == 3) { $('#type').html('Agency'); $('#level').html(response.register_level); } else if (response.register_type == 4) { $('#type').html('แรงงาน'); $('#level').html(response.register_level); } $.ajax({ type: "POST", data: { member_id: member_id, register_type: response.register_type, register_level: response.level }, dataType: 'html', url: "ajax/join/getEditForm" + response.register_type + ".php", success: function(data) { $('#show_form_select').html(data); GetDocList() } }); } } }); }); function change_image(profile_image) { $('#myModal1').modal('show'); } $('.custom-file-input').on('change', function() { let fileName = $(this).val().split('\\').pop(); $(this).next('.custom-file-label').addClass("selected").html(fileName); }); function chkNumber(ele) { var vchar = String.fromCharCode(event.keyCode); if ((vchar < '0' || vchar > '9') && (vchar != '.')) return false; ele.onKeyPress = vchar; let citizen_no = $("#citizen_no").val(); if (citizen_no != '') { if (citizen_no.length < 13) { $('#citizen_no_ch').prop('hidden', false); } else { $('#citizen_no_ch').prop('hidden', true); } } let passport_no = $("#passport_no").val(); if (passport_no != '') { if (passport_no.length < 13) { $('#passport_no_ch').attr('hidden', false); } else { $('#passport_no_ch').attr('hidden', true); } } let company_tax_no = $("#company_tax_no").val(); if (company_tax_no != '') { if (company_tax_no.length < 13) { $('#company_tax_ch').attr('hidden', false); } else { $('#company_tax_ch').attr('hidden', true); } } let invoice_tax = $("#invoice_tax").val(); if (invoice_tax != '') { if (invoice_tax.length < 13) { $('#invoice_tax_ch').attr('hidden', false); } else { $('#invoice_tax_ch').attr('hidden', true); } } } function isValidDate(dateStr) { // กำหนดรูปแบบของวันที่ var datePattern = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/; // แยกวันที่, เดือน, ปี var parts = dateStr.split("/"); var day = parseInt(parts[0], 10); var month = parseInt(parts[1], 10); var year = parseInt(parts[2], 10); // ตรวจสอบความถูกต้องของวันที่และเดือน if (month === 0 || month > 12 || day === 0 || day > 31) { return false; } // ตรวจสอบวันที่ที่มีจริงในเดือน var daysInMonth = new Date(year, month, 0).getDate(); if (day > daysInMonth) { return false; } // ผ่านการตรวจสอบทั้งหมด return true; } function checkDate(name) { var data = document.getElementById(name); var dataValue = data.value; if (!isValidDate(dataValue)) { swal({ title: "เกิดข้อผิดพลาด", text: "กรุณากรอกวันที่ให้ถูกต้อง (รูปแบบ: dd/mm/YYYY)", type: "error", }); $('#' + name).val(""); } } function GetDocList() { let member_id = localStorage.getItem("member_id"); $.ajax({ type: "POST", url: "ajax/join/get_application_doc.php", data: { member_id: member_id }, dataType: "html", success: function(response) { $("#doc_list").html(response); } }); } function AddDocument(member_id, register_type, register_level) { $("#myModal").modal("show"); $("#showModal").load("ajax/join/get_modal_adddocument.php", { member_id: member_id, register_type: register_type, register_level: register_level }, function(response, status, request) { this; // dom element }); } function ImportFile() { let member_id = localStorage.getItem("member_id"); var formData = new FormData($("#import_document")[0]); $.ajax({ type: "POST", url: "ajax/join/update_document.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'); GetDocList(member_id) }); } 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 DeleteApp(document_id) { swal({ title: 'กรุณายืนยันเพื่อทำรายการ', type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', cancelButtonText: 'ยกเลิก', confirmButtonText: 'ยืนยัน', closeOnConfirm: false }, function() { $.ajax({ type: "POST", url: "ajax/join/delete_application.php", data: { document_id: document_id }, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: 'ลบข้อมูลเรียบร้อย', type: 'success', showConfirmButton: false, timer: 1500 }, function() { swal.close(); GetDocList() }); } 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>