/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
up file
home
<?php include('header.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); ?> <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; } .btn-sky { color: #fff; background-color: #3ed3b6; border-color: #3ed3b6; } 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:30px;font-weight: bold;">เพิ่มข้อมูลแรงงาน<br />สมาคมผู้ประกอบการนำคนต่างด้าวมาทำงานในประเทศ (ประเทศไทย)</p> </div> <!-- <div class="container px-0"> <div class="row mb-3"> <div class="col-lg-3 col-12 mb-2"> <button id="type1" class="btn btn-block btn-sky btn-lg" onclick="GetForm(1);">ทั่วไป</button> </div> <div class="col-lg-3 col-12 mb-2"> <button id="type3" class="btn btn-block btn-sky btn-lg" onclick="GetForm(3);">สามัญ</button> </div> </div> </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-body"> <div class="modal-content animated fadeIn"> <div id="showModal"></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 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> $(document).ready(function() { GetForm(); }); function GetForm() { let member_id = localStorage.getItem('member_id'); let admin_id = localStorage.getItem('admin_id'); let ref_member_id = ""; if (member_id == null) { ref_member_id = admin_id; } else { ref_member_id = member_id } $.ajax({ type: "POST", url: "ajax/worker/form_add.php", data: { id: 4, // type 4 = แรงงาน register_id: 1, // level ref_member_id: ref_member_id }, dataType: "html", success: function(response) { $("#show_form_select").html(response); } }); } // function Signature() { // $("#signature_box").load("signature.php"); // } function change_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; let date = new Date().toLocaleDateString(); /// get year var parts = dataValue.split("/"); var year = parseInt(parts[2], 10); // current year var partsn = date.split("/"); var current_year = parseInt(partsn[2], 10); if (name == 'birth_date') { if (year > current_year + 543) { swal({ title: "เกิดข้อผิดพลาด", text: "ปีเกิดมากกว่าปีปัจจุบัน", type: "error", }); $('#' + name).val(""); } } // เช็ค คศ. หรือ พศ. ถ้า input แล้ว if (year + 500 > current_year + 543) { // input เป็น พศ. console.log(year); } else { // input เป็น คศ. console.log(year + 543); } if (!isValidDate(dataValue)) { swal({ title: "เกิดข้อผิดพลาด", text: "กรุณากรอกวันที่ให้ถูกต้อง (รูปแบบ: dd/mm/YYYY)", type: "error", }); $('#' + name).val(""); } } </script> </body> </html>