/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
ajax
/
payment_status
/
up file
home
<?php include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $payment_id = mysqli_real_escape_string($connection, $_POST['payment_id']); if ($connection) { $sql_payment = "SELECT * FROM tbl_member_payment WHERE payment_id = '$payment_id'"; $rs_payment = mysqli_query($connection, $sql_payment) or die($connection->error); $row = mysqli_fetch_assoc($rs_payment); ?> <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> <?php if (empty($row['transfer_date'])) { ?> <div class="modal-body"> <div class="alert alert-warning">รอชำระเงิน</div> </div> <div class="modal-footer"> <button type="button" class="btn btn-white" data-dismiss="modal">ปิด</button> </div> <?php } else { ?> <?php if (empty($row['approve_result'])) { ?> <div class="modal-body"> <form id="edti_slip" method="post"> <input type="hidden" id="payment_id" name="payment_id" value="<?php echo $payment_id; ?>"> <div class="row"> <div class="col-12 mb-3"> <label for="">หลักฐานการชำระเงิน</label> <div style="text-align: center;"> <img id="slip" src="upload/<?php echo $row['slip_image'] ?>" width="300px" /> </div> <div class="custom-file"> <input id="slip_image" name="slip_image" type="file" class="custom-file-input" onchange="validateFileImageType(this)"> <label for="slip_image" class="custom-file-label">Choose file...</label> </div> </div> </div> <div class="row mt-2"> <div class="col-12 mb-3"> <label for="">วันที่โอน</label> <div class="form-group" id="data_1"> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control bg-white date" id="transfer_date" name="transfer_date" value="<?php echo date('d/m/Y', strtotime($row['transfer_date'])) ?>" readonly> </div> </div> </div> <div class="col-12"> <label for="">เวลาที่โอน</label> </div> <div class="col-6"> <select name="transfer_time_h" id="transfer_time_h" class="form-control"> <?php for ($i = 0; $i <= 23; $i++) : ?> <option value="<?php echo str_pad($i, 2, "0", STR_PAD_LEFT); ?>" <?php if (date('H', strtotime($row['transfer_time'])) == $i) : ?> selected <?php endif; ?>> <?php echo str_pad($i, 2, "0", STR_PAD_LEFT); ?> </option> <?php endfor; ?> </select> </div> <div class="col-6"> <select name="transfer_time_m" id="transfer_time_m" class="form-control"> <?php for ($i = 0; $i <= 59; $i++) : ?> <option value="<?php echo str_pad($i, 2, "0", STR_PAD_LEFT); ?>" <?php if (date('i', strtotime($row['transfer_time'])) == $i) : ?> selected <?php endif; ?>> <?php echo str_pad($i, 2, "0", STR_PAD_LEFT); ?> </option> <?php endfor; ?> </select> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" onclick="SubmitEdtiSlip()">บันทึก</button> <button type="button" class="btn btn-white" data-dismiss="modal">ปิด</button> </div> <?php } else { ?> <div class="modal-body"> <div class="row"> <div class="col-lg-12"> <div class="form-group"> <div class="row"> <div class="col-12"> <label class="form-label float-start">สลิป :</label> <div style="text-align: center;"> <img id="slip" src="upload/<?php echo $row['slip_image'] ?>" width="300px" /> </div> </div> </div> <div class="row mt-5"> <div class="col-12"> <label class="form-label float-start">วันที่โอน :</label> <?php echo date('d/m/Y', strtotime($row['transfer_date'])); ?> <?php echo date('H:i', strtotime($row['transfer_time'])); ?> </div> <div class="col-12"> <label class="form-label float-start">วันที่อัพเดทสถานะ :</label> <?php echo date('d/m/Y', strtotime($row['approve_datetime'])); ?> </div> <div class="col-12"> <label class="form-label float-start">สถานะ :</label> <?php if (empty($row['approve_result'])) { ?> <span style="color: orange;">รออนุมัติ</span> <?php } else if ($row['approve_result'] == 1) { ?> <span style="color: green;">อนุมัติ</span> <?php } else if ($row['approve_result'] == 2) { ?> <span style="color: red;">ปฎิเสธ</span> <?php } ?> </div> <div class="col-12"> <label class="form-label float-start">หมายเหตุ :</label> <?php echo $row['approve_remark']; ?> </div> </div> </div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-white" data-dismiss="modal">ปิด</button> </div> <?php } } ?> <?php } else { echo "Err"; } ?> <script> var mem = $("#data_1 .input-group.date").datepicker({ startView: 0, todayBtn: "linked", keyboardNavigation: false, forceParse: false, autoclose: true, format: "dd/mm/yyyy" }) function validateFileImageType(input) { var allowedExtension = ['jpeg', 'jpg', 'png', 'gif']; var fileExtension = input.value.split('.').pop().toLowerCase(); var isValidFile = false; for (var index in allowedExtension) { if (fileExtension === allowedExtension[index]) { isValidFile = true; break; } } if (!isValidFile && input.value != "") { swal({ title: "ไม่สามารถดำเนินการได้", text: "ไฟล์ที่สามารถอัพโหลดได้ jpeg, jpg, png, gif เท่านั้น", type: "error" }) $(input).val(null); } return isValidFile; } </script>