Server IP : 103.233.192.212 / Your IP : 3.137.208.89 Web Server : Apache/2 System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : sumpatuan ( 1058) PHP Version : 5.5.38 Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/sumpatuan/domains/sumpatuan.go.th/public_html/admin/top/ |
Upload File : |
<?php require_once('session_backend_administrator.php'); header('Content-Type: text/html; charset=UTF-8'); if($STT_login=="admin_login_true"){ date_default_timezone_set("Asia/Bangkok"); $datetime = date('d/m/Y H.i'); $nowyear = date('Y')+543; $check_type = $con_db_administrator->real_escape_string($_GET['type']); $check_link = $con_db_administrator->real_escape_string($_GET['link']); if( $check_type=="" or !isset($check_type) or $check_link=="" or !isset($check_link) ){ echo "<SCRIPT type='text/javascript'> alert('ไม่พบหัวข้อ ที่ต้องการเพิ่มข้อมูลใหม่'); window.location.replace(document.referrer); </SCRIPT>"; exit; } }else{ echo "<SCRIPT type='text/javascript'> alert('กรุณาเข้าสู่ระบบ'); window.location.replace('../index'); </SCRIPT>"; exit; } ?> <!doctype html> <html lang="en"> <head> <?php include_once ("head.html"); ?> </head> <body class="" > <?php include_once ("menu.php"); ?> <div class="container pt-3 pb-4 " > <div class="row "> <div class="col text-secondary" > <div class="p-1 ps-2 box-link " ><a href="../backend-administrator" class="link-info">หน้าหลัก</a> / <a href="<?php echo $check_link;?>" class="link-info"><?php echo $check_type;?></a> / เพิ่มข้อมูล <?php echo $check_type;?></div> </div> <div class="w-100 pb-4"></div> <div class="col m-auto" > <div class="bg-line-1 hideTab"></div> </div> <div class="col-auto text-center"> <span class="lh-sm h1 fw-700">เพิ่มข้อมูล <?php echo $check_type;?> </span> </div> <div class="col m-auto" > <div class="bg-line-1 hideTab"></div> </div> </div> <div class="row mt-4 mb-5 p-2"> <div class="col mx-auto box-data p-4" style="max-width:800px"> <form action="action/save-NewsbookMain-adddata" name='form_NewsbookMain_adddata' id='form_NewsbookMain_adddata' method="post" enctype="multipart/form-data"> <div class="row mb-4"> <label class="col-md-2 col-form-label fw-700 txtbox-align">เลขที่หนังสือ</label> <div class="col-md-10"> <input type="text" class="form-control" name="txt_number" style="max-width:250px" required> </div> </div> <div class="row mb-4"> <label class="col-md-2 col-form-label fw-700 txtbox-align">เรื่อง</label> <div class="col-md-10"> <input type="text" class="form-control " name="txt_name" required> </div> </div> <div class="row mb-4"> <label class="col-md-2 col-form-label fw-700 txtbox-align">วันที่ลง</label> <div class="col-md-10"> <input type="date" class="form-control" name="txt_date" data-date-format="DD MMMM YYYY" style="max-width:250px" required> </div> </div> <div class="row mb-4"> <label class="col-md-2 col-form-label fw-700 txtbox-align">วันที่หมดอายุ</label> <div class="col-md-10"> <input type="date" class="form-control" name="txt_exp" data-date-format="DD MMMM YYYY" style="max-width:250px" required> </div> </div> <div class="row mb-4"> <div class="col-md-2 fw-700 txtbox-align">หน่วยงาน</div> <div class="col-md-10"> <?php $sql_nbmb = "SELECT `name_newsbookmb` FROM `data_newsbookmb` ORDER BY `id_newsbookmb` ASC "; $qr_nbmb = mysqli_query($con_db_administrator,$sql_nbmb) or die( mysqli_error($con_db_administrator)); $c_row = 0; while($rs_nbmb = mysqli_fetch_array($qr_nbmb )){ $c_row++; echo '<div class="form-check"> <input class="form-check-input" type="checkbox" value="'.$rs_nbmb['name_newsbookmb'].'" name="txt_namemb[]"> <label class="form-check-label"> '.$rs_nbmb['name_newsbookmb'].' </label> </div>'; } if($c_row<=0){echo '<span class="text-danger fw-400 fs-14">* ไม่พบข้อมูลหน่วยงาน</span>';} ?> </div> </div> <div class="row mb-3"> <label class="col-md-2 col-form-label fw-700 txtbox-align lh-sm">อัพโหลดไฟล์</label> <div class="col-md-10 "> <input class="form-control" type="file" id="uploadFile" name="uploadFile[]" accept="image/png, image/gif, image/jpeg, application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" multiple required> <div class="mt-1 lh-sm"> <small class="fs-12 text-secondary">- เปลี่ยนชื่อไฟล์ให้เกี่ยวข้องกับหัวข้อ ก่อนทำการเลือกไฟล์อัพโหลด</small> <br><small class="fs-12 text-secondary">- อัพโหลดได้เฉพาะไฟล์รูปภาพ , .pdf , .doc/.docx , .xls/.xlsx</small> <br><small class="fs-12 text-secondary">- สามารถอัพโหลดไฟล์เพิ่มในภายหลังได้</small> <br><small class="fs-12 text-secondary">- เมื่อถึงวันที่หมดอายุ ไฟล์จะถูกลบทันที</small> </div> </div> </div> <hr class="mb-3"> <div class="row mb-4"> <label class="col-2 col-form-label fw-700 txtbox-align">สถานะ</label> <div class="col-10"> <select class="form-select" name="statusshow" style="max-width:250px"> <option value="0">แสดง</option> <option value="1">ไม่แสดง</option> </select> </div> </div> <div class="text-center"> <button type="submit" class="btn btn-success" id="btnSubmit"><i class="fas fa-save me-2" ></i> บันทึกข้อมูล</button> <button type="button" class="btn btn-danger ms-2" onclick="location.href='<?php echo $check_link;?>'">ย้อนกลับ</button> </div> </form> </div> </div> <?php include_once ("../footer.php"); ?> <script> $(document).ready(function () { $('#btnSubmit').click(function() { checked = $("input[type=checkbox]:checked").length; if(!checked) { alert('กรุณาเลือกหน่วยงาน'); return false; } }); }); $('#uploadFile').change(function(){ if(this.files.length>10){ alert('อัพโหลดได้สูงสุดทีละ 10 ไฟล์ สามารถอัพโหลดเพิ่มภายหลังได้'); $("#uploadFile").val(null); return false; } }); $('body').on('dragstart drop', function(e){ e.preventDefault(); return false; }); </script> </div> </body> </html>