/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
up file
home
<?php include('header.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $join_level = mysqli_real_escape_string($connection, $_GET['id']); if (!in_array($join_level, array("1", "2", "3"))) { ?> <script> location.href = "error" </script> <?php } switch ($join_level) { case 1: $level = "สมาชิกทั่วไป"; break; case 2: $level = "สมาชิกวิสามัญ"; break; case 3: $level = "สมาชิกสามัญ"; break; } ?> <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;">ใบสมัคร<?php echo $level; ?> <br />สมาคมผู้ประกอบการนำคนต่างด้าวมาทำงานในประเทศ (ประเทศไทย)</p> </div> <div class="container px-0"> <?php $type1 = "hidden"; $type2 = "hidden"; $type3 = "hidden"; $type4 = "hidden"; if ($join_level == 1) { // ทั่วไป $type1 = ""; $type2 = ""; $type3 = ""; $type4 = ""; } else if ($join_level == 2) { // สามัญ $type1 = ""; $type2 = ""; } else if ($join_level == 3) { // วิสามัญ $type1 = ""; $type2 = ""; $type3 = ""; } ?> <div class="row mb-3"> <div class="col-lg-3 col-12 mb-2" <?php echo $type1; ?>> <button id="type1" class="btn btn-block btn-sky btn-lg" onclick="selectType(1);">นายจ้าง</button> </div> <div class="col-lg-3 col-12 mb-2" <?php echo $type2; ?>> <button id="type2" class="btn btn-block btn-sky btn-lg" onclick="selectType(2);">บนจ.</button> </div> <div class="col-lg-3 col-12 mb-2" <?php echo $type3; ?>> <button id="type3" class="btn btn-block btn-sky btn-lg" onclick="selectType(3);">AGENCY</button> </div> <div class="col-lg-3 col-12 mb-2" <?php echo $type4; ?>> <button id="type4" class="btn btn-block btn-sky btn-lg" onclick="selectType(4);">แรงงาน</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() { $("#menu-membershipApplication").hide(); }); 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(""); } } function selectType(id) { document.getElementById('type1').classList.add('btn-sky'); document.getElementById('type2').classList.add('btn-sky'); document.getElementById('type3').classList.add('btn-sky'); document.getElementById('type4').classList.add('btn-sky'); document.getElementById('type1').classList.remove('btn-warning'); document.getElementById('type2').classList.remove('btn-warning'); document.getElementById('type3').classList.remove('btn-warning'); document.getElementById('type4').classList.remove('btn-warning'); document.getElementById('type' + id).classList.add('btn-warning'); document.getElementById('type' + id).classList.remove('btn-sky'); if (id != null) { let member_id = localStorage.getItem('member_id'); $.ajax({ type: "POST", data: { // id = ประเภทที่สมัคร -> นายจ้าง บนจ. agency แรงงาน // register_id = ระดับที่สมัคร -> ทั่วไป วิสามัญ สามัญ id: id, register_id: '<?php echo $_GET['id'] ?> ', member_id: member_id }, dataType: 'html', //url: "ajax/join/form_register.php", url: "ajax/join/form_wiz.php", //url: "ajax/join/form0" + id + ".php", success: function(response) { $('#show_form_select').html(response); } }) } } </script> </body> </html>