/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
ajax
/
setting_blog
/
up file
home
<?php include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $blog_id = mysqli_real_escape_string($connection, $_POST['blog_id']); $sql = "SELECT * FROM tbl_setting_blog WHERE blog_id = '$blog_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="form_blog" method="post"> <input type="hidden" name="blog_id" id="blog_id" value="<?php echo $blog_id; ?>"> <div class="row"> <div class="col-lg-12 mb-2" style="text-align:center;"> <div class="form-group"> <div class="BroweForFile"> <label for="blog_image"><strong>ไฟล์ (ขนาดแนะนำ 1900 X 462)</strong></label> <div id="blog_image"><label for="upload_file"> <a><img id="blah" src="img/AddFile.png" width="250px" height="250px" /></a></label> </div><br /> <input type="file" id="upload_file" name="blog_image" onchange="readURL(this);" style="display: none;"> </div> </div> </div> <div class="col-lg-12 mb-2"> <div class="form-group"> <label>หัวข้อบทความ</label> <input type="text" name="blog_header" class="form-control" id="blog_header" value="<?php echo $row['blog_header']; ?>"> </div> </div> <div class="col-lg-12 mb-2"> <div class="form-group"> <label>บทความ</label> <textarea name="blog_text" class="form-control" id="blog_text" cols="30" rows="5"><?php echo $row['blog_message']; ?></textarea> </div> </div> <div class="col-lg-12"> <div class="form-group"> <div> <label>สิทธิ์การมองเห็น ตามระดับสมาชิก</label> </div> <input type="checkbox" value="1" name="visitors" <?php echo ($row['visitors_access'] == '1' ? 'checked':'')?>> ผู้เยี่ยมชม <input type="checkbox" value="1" name="general" <?php echo ($row['general_access'] == '1' ? 'checked':'')?>> สมาชิกทั่วไป <input type="checkbox" value="1" name="extraordinary" <?php echo ($row['extraordinary_access'] == '1' ? 'checked':'')?>> สมาชิกวิสามัญ <input type="checkbox" value="1" name="ordinary" <?php echo ($row['ordinary_access'] == '1' ? 'checked':'')?>> สมาชิกสามัญ </div> </div> <div class="col-lg-12"> <div class="form-group"> <div> <label>สิทธิ์การมองเห็น ตามประเภทสมาชิก</label> </div> <input type="checkbox" value="1" name="employer" <?php echo ($row['employer_access'] == '1' ? 'checked':'')?>> นายจ้าง <input type="checkbox" value="1" name="company" <?php echo ($row['company_access'] == '1' ? 'checked':'')?>> บนจ. <input type="checkbox" value="1" name="agency" <?php echo ($row['agency_access'] == '1' ? 'checked':'')?>> Agency <input type="checkbox" value="1" name="worker" <?php echo ($row['worker_access'] == '1' ? 'checked':'')?>> แรงงาน </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" onclick="update_blog();"><i class="fa fa-check"></i> บันทึก</button> <button type="button" class="btn btn-white" data-dismiss="modal">ปิด</button> </div> </form> <script> function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { if (input.files[0]['type'] == "application/pdf") { $('#blah').attr('src', 'images/file_svg/pdf.svg'); } else { $('#blah').attr('src', e.target.result); } // $('#blah_name').text(input.files[0]['name']); } reader.readAsDataURL(input.files[0]); } } </script>