/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
up file
home
<?php include('header.php'); $datenow = date('d/m/Y'); $date_1month = date('d/m/Y', strtotime($now . "-1 months")); ?> <style> .select2-dropdown { z-index: 9999; } </style> <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 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-primary btn-sm" onclick="ModalPrint('<?php echo $_GET['re']; ?>')">พิมพ์</button> <!-- <a href="https://efa-member.com/backoffice/print/receipt_new?id=<?php echo $_GET['re']; ?>" target="_blank" class="btn btn-primary btn-sm">พิมพ์</a> --> </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_data"></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> <div class="modal fade" id="myModal2" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-md modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div id="showModal2"></div> </div> </div> </div> <div class="modal fade" id="myModalPrint" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-md modal-dialog-centered"> <div class="modal-content animated fadeIn"> <div id="showModalPrint"></div> </div> </div> </div> <script> $(document).ready(function() { GetData(); $(".form-select").select2(); }); function GetData() { $('#show_data').hide(); $('#Loading').show(); const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const id = urlParams.get('re'); $.ajax({ type: 'POST', url: 'ajax/account_receipt_view/get_receipt.php', data: { id: id }, dataType: 'html', success: function(response) { $('#show_data').html(response); $('#show_data').show(); $('#Loading').hide(); } }); } function GetModalAddDetail(receipt_id) { $("#myModal").modal("show"); $("#showModal").load("ajax/account_receipt_view/modal_add_detail.php", { receipt_id: receipt_id }); } function InsertReceiptDetail() { let admin_id = localStorage.getItem('admin_id'); let formData = new FormData($("#form_add_detail")[0]); formData.append('create_user_id', admin_id); $.ajax({ type: "POST", url: "ajax/account_receipt_view/add_receipt_detail.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(); GetData(); $("#myModal").modal('hide'); }); } 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 }); } }, 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 }); } }); } function DeleteDetail(receipt_detail_id) { swal({ title: 'กรุณายืนยันเพื่อทำรายการ', type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', cancelButtonText: 'ยกเลิก', confirmButtonText: 'ยืนยัน', closeOnConfirm: false }, function() { $.ajax({ type: "POST", url: "ajax/account_receipt_view/delete_detail.php", data: { receipt_detail_id: receipt_detail_id }, dataType: "json", success: function(data) { if (data.result == 1) { swal({ title: 'ลบข้อมูลสำเร็จ', type: 'success', showConfirmButton: false, timer: 1500 }, function() { swal.close(); GetData(); $("#myModal").modal('hide'); }); } 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 EditDetail(receipt_detail_id) { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const receipt_id = urlParams.get('re'); $("#myModal").modal("show"); $("#showModal").load("ajax/account_receipt_view/modal_edit_detail.php", { receipt_detail_id: receipt_detail_id, receipt_id: receipt_id }); } function EditReceiptDetail() { let admin_id = localStorage.getItem('admin_id'); let formData = new FormData($("#form_edit_detail")[0]); formData.append('create_user_id', admin_id); $.ajax({ type: "POST", url: "ajax/account_receipt_view/edit_receipt_detail.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(); GetData(); $("#myModal").modal('hide'); }); } 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 }); } }, 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 }); } }); } function ModalPrint(receipt_id) { $("#myModalPrint").modal("show"); $("#showModalPrint").load("ajax/account_receipt_view/modal_print.php", { receipt_id: receipt_id }); } function RecriptPrint(receipt_id) { let manuscript = 0; if ($('#manuscript').is(":checked")) { manuscript = $("#manuscript").val(); } let copy = 0; if ($('#copy').is(":checked")) { copy = $("#copy").val(); } if (manuscript == 0 && copy == 0) { $("#manuscript_label").attr("style", "color:red;"); $("#copy_label").attr("style", "color:red;"); $("#warning_print").attr('hidden', false); return false; } window.open('https://efa-member.com/backoffice/print/receipt_new?id=' + receipt_id + '&ma=' + manuscript + '&cp=' + copy, '_blank'); } </script> </body> </html>