/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
ajax
/
account_receipt
/
up file
home
<?php @session_start(); include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); if ($connection) { $receipt_id = mysqli_real_escape_string($connection, $_POST['receipt_id']); $sql = "SELECT * FROM tbl_receipt_head WHERE receipt_id= '$receipt_id'"; $res = mysqli_query($connection, $sql); $row = mysqli_fetch_assoc($res); } ?> <style> .select2-close-mask { z-index: 2099; } .select2-dropdown { z-index: 3051; } </style> <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"> <form id="frm_editReceipt" method="POST" enctype="multipart/form-data"> <input type="hidden" id="member_id" name="member_id" value="<?php echo $row['member_id']; ?>"> <input type="hidden" id="receipt_id" name="receipt_id" value="<?php echo $receipt_id; ?>"> <div class="row"> <div class="form-group col-6"> <div class="form-group" id="data_1"> <label class="font-normal">วันที่ออกใบเสร็จ</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="input" class="form-control date" value="<?php echo date("d/m/Y", strtotime($row['receipt_date'])); ?>" name="receipt_date" id="receipt_date" autocomplete="off"> </div> </div> </div> <div class="form-group col-12"> <label class="font-normal">ชื่องาน</label> <input type="text" class="form-control" id="job_name" name="job_name" value="<?php echo $row['job_name']; ?>"> </div> <div class="form-group col-6"> <label class="font-normal">ลูกค้า</label> <div class="input-group mb-3"> <input type="text" class="form-control" id="member_name" name="member_name" value="<?php echo $row['customer_name']; ?>" placeholder="ชื่อลูกค้า" aria-describedby="button-addon2"> <button type="button" class="btn btn-primary" id="button-addon2" onclick="GetModalMenber()"><i class="fa fa-search"></i></button> </div> </div> <div class="form-group col-6"> <label class="font-normal">เลขที่อ้างอิง</label> <input type="text" class="form-control" id="ref_number" name="ref_number" value="<?php echo $row['ref_invoice_id']; ?>" placeholder="เลขที่ใบแจ้งหนี้ , ชื่อลูกค้า , เบอร์โทรติดต่อ"> </div> <div class="form-group col-6"> <label class="font-normal">เลขประจำตัวผู้เสียภาษี</label> <input type="text" class="form-control" id="customer_tax_no" name="customer_tax_no" value="<?php echo $row['customer_tax_no']; ?>"> </div> <div class="form-group col-6"> <label class="font-normal">เบอร์โทรติดต่อ</label> <input type="text" class="form-control" id="customer_phone" name="customer_phone" value="<?php echo $row['customer_phone']; ?>"> </div> <div class="form-group col-6"> <label class="font-normal">อีเมล</label> <input type="text" class="form-control" id="customer_email" name="customer_email" value="<?php echo $row['customer_email']; ?>"> </div> <div class="form-group col-12"> <label class="font-normal">ที่อยู่</label> <input type="text" class="form-control" id="customer_address" name="customer_address" value="<?php echo $row['customer_address']; ?>"> </div> <div class="form-group col-12"> <label class="font-normal">หมายเหตุ</label> <textarea name="recipt_remark" id="recipt_remark" cols="30" rows="5" class="form-control"><?php echo $row['remark']; ?></textarea> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" onclick="SubmitEditReceipt()"><i class="fa fa-check"></i> บันทึก</button> <button type="button" class="btn btn-white" data-dismiss="modal">ปิด</button> </div> <script> $("#data_1 .input-group.date").datepicker({ startView: 0, todayBtn: "linked", keyboardNavigation: false, forceParse: false, autoclose: true, format: "dd/mm/yyyy" }) $(".select2").select2({ width: "100%" }); function GetMemberData(member_id) { $.ajax({ type: "POST", url: "ajax/account_receipt/get_member_datail.php", data: { member_id: member_id }, dataType: "json", success: function(response) { var len = response.length; for (var i = 0; i < len; i++) { var member_name = response[i].member_name; var phone = response[i].phone; var card_address = response[i].card_address; var email = response[i].email; var invoice_number = response[i].invoice_number; $("#ref_number").val(invoice_number); $("#member_name").val(member_name); $("#customer_phone").val(phone); $("#customer_address").val(card_address); $("#customer_email").val(email); } $("#member_id").val(member_id); $("#myModal2").modal("hide"); } }); } </script>