/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
ajax
/
setting_law
/
up file
home
<?php session_start(); include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $law_id = mysqli_real_escape_string($connection, $_POST['law_id']); $sql = "SELECT * FROM tbl_law WHERE law_id = '$law_id'"; $res = mysqli_query($connection, $sql); $row = mysqli_fetch_assoc($res); ?> <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 method="POST" id="form_edit" enctype="multipart/form-data"> <input type="hidden" name="law_id" id="law_id" value="<?php echo $law_id; ?>"> <div class="form-group mb-2"> <label for="law_title" id="">หัวข้อกฎหมาย</label> <input type="text" name="law_title" id="law_title" class="form-control" value="<?php echo $row['law_title']; ?>"> </div> <div class="form-group"> <label for="announce_date">วันที่โพส</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span><input type="text" class="form-control datepicker" id="announce_date" name="announce_date" value="<?php echo date("d/m/Y"); ?>"> </div> </div> <div class="form-group mb-2" id=""> <label for="law_description" id="Password_label">คำอธิบายข้อกฎหมาย</label> <textarea class="form-control" name="law_description" id="law_description" cols="30" rows="10"><?php echo $row['law_description']; ?></textarea> </div> <div class="form-group mb-2"> <label for="law_link" id="">ลิงค์ข้อกฎหมาย</label> <input type="text" name="law_link" id="law_link" class="form-control" value="<?php echo $row['law_link']; ?>"> </div> <div class="form-group mb-2"> <label for="law_link" id="">ไฟล์ข้อกฎหมาย</label> <table class="table"> <?php $sql_doc = "SELECT * FROM tbl_law_document WHERE law_id = '$law_id'"; $res_doc = mysqli_query($connection, $sql_doc) or die($connection->error); $i = 0; while ($row_doc = mysqli_fetch_assoc($res_doc)) { ?> <tr> <td style="width: 20%;"> <a href="../../../files/law_files/<?php echo $row_doc['document_file_name']; ?>" target="_blank">ไฟล์ที่ <?php echo $i += 1; ?></a> </td> <td> <button type="button" class="btn btn-danger btn-xs" onclick="DeleteFile('<?php echo $law_id; ?>','<?php echo $row_doc['document_id']; ?>')">ลบ</button> </td> </tr> <?php } ?> </table> </div> <div class="form-group mb-2"> <label for="law_file" id="">เพิ่มไฟล์ข้อกฎหมาย</label> <input type="file" name="law_file[]" id="law_file" class="form-control" multiple> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" onclick="SubmitEdit()"><i class="fa fa-check"></i> บันทึก</button> <button type="button" class="btn btn-white" data-dismiss="modal">ปิด</button> </div> <script> $(".datepicker").datepicker({ todayBtn: "linked", keyboardNavigation: false, forceParse: false, autoclose: true, format: "dd/mm/yyyy" }); </script>