%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : www.kowitt.ac.th / Your IP : 216.73.216.118 Web Server : Microsoft-IIS/7.5 System : Windows NT SERVER02 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.6.31 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/admin/ |
Upload File : |
<?php header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <!DOCTYPE html> <html> <?PHP session_start(); if($_SESSION["UserAccess"]=="") { header('Location: index.php'); exit(); } ?> <?PHP include "conf.php"; $sql = "select * from department where dep_id=".$_GET['DepID']; //echo "Sql : ".$sql; $result = $conn->query($sql) or die("Cant' query"); while($row = $result->fetch_assoc()) { $filePath = "../img_department/".$row['dep_img']; $dep_name = $row['dep_name']; } //echo $filePath; ?> <style> .jumbotron { background: rgb(200, 54, 54); /* This is for ie8 and below */ background: rgba(133, 193, 233, 0.5); } .bg { /* The image used */ background-image: url(<?PHP echo $filePath; ?>); /* Full height */ height: 100%; /* Center and scale the image nicely */ background-position: center; background-repeat: no-repeat; background-size: cover; } </style> <body> <div> <div class="jumbotron text-center"> <h1>นำเข้ารูปภาพหน่วยงาน : <?PHP echo $dep_name; ?></h1> <p>รูปภาพหน่วยงานเป็นรูปภาพผังหน่วยงาน แสดงข้อมูลบุคคลในองค์กร ตำแหน่ง และสายงานบังคับบัญชา เป็นต้น </p> </div> <input type="hidden" id="dep_id" name="dep_id" value="<?PHP echo $_GET['DepID']; ?>"> <div class="container"> <div class="form-group"> <!-- fileToUpload --> <form action="upload_img_dep.php" method="post" enctype="multipart/form-data"> <div class="form-group"> <label for="exampleFormControlSelect1">รูปที่</label> <select class="form-control" id="imgField" name="imgField"> <option value="img_1">1</option> <option value="img_2">2</option> <option value="img_3">3</option> <option value="img_4">4</option> <option value="img_5">5</option> <option value="img_6">6</option> <option value="img_7">7</option> <option value="img_8">8</option> <option value="img_9">9</option> <option value="img_10">10</option> <option value="img_11">11</option> <option value="img_12">12</option> <option value="img_13">13</option> <option value="img_14">14</option> <option value="img_15">15</option> <option value="img_16">16</option> <option value="img_17">17</option> <option value="img_18">18</option> <option value="img_19">19</option> <option value="img_20">20</option> <option value="img_21">21</option> <option value="img_21">22</option> <option value="img_23">23</option> <option value="img_24">24</option> <option value="img_25">25</option> </select> </div> <div class="input-group"> <div class="custom-file"> <input type="hidden" id="dep_id" name="dep_id" value="<?PHP echo $_GET['DepID']; ?>"> <input type="file" class="custom-file-input" name="fileToUpload" id="fileToUpload"> <label class="custom-file-label" for="inputGroupFile04">Choose file</label> </div> <div class="input-group-append"> <input class="btn btn-secondary" type="submit" value="Upload Image" name="submit" onclick="return Check()"> </div> <label class="custom-file-label" id="strFileName"></label> </div> </form> <div class="row"> <?PHP $sql = "select * from department where dep_id=".$_GET['DepID']; //echo $sql; $result = $conn->query($sql) or die("Cant' query"); while($row = $result->fetch_assoc()) { for($i=1;$i<=25;$i++) { $img = $row["img_$i"]; if($img=="") echo "<div class=\"col-md-3 col-12 text-center\"><button type=\"button\" class=\"btn btn-danger btn-sm btn-block\" disabled>Delete</button><br><img src='../img/logo.png' width='50%'>"; else echo "<div class=\"col-md-3 col-12 text-center\"><button type=\"button\" class=\"btn btn-danger btn-sm btn-block\" onclick=\"DeleteImg($i)\">Delete</button><br><img src='../img_department/".$img."' width='80%'>"; echo "<hr></div>"; } } ?> </div> </div> <!-- <form action="upload_img.php" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> /form> --> </div> </div> </div> <div id="show"></div> </body> </html> <script> function Check() { //alert(document.getElementById("fileToUpload").value); if(document.getElementById("fileToUpload").value=="") { swal("Warning job!", "ท่านยังไม่ได้เลือกไฟล์รูปภาพ", "warning"); return false; } return true; } function DeleteImg(str) { //alert("OK"+str+","+document.getElementById("dep_id").value); swal({ title: "Are you sure?", text: "ยืนยันการลบข้อมูลไฟล์รูปภาพที่ท่านเลือก (ลำดับที่ "+str+") ?", icon: "warning", buttons: true, dangerMode: true, }) .then((willDelete) => { if (willDelete) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //document.getElementById("show").innerHTML = this.responseText; window.location.href = "images_dep.php?DepID="+document.getElementById("dep_id").value; } }; xmlhttp.open("GET", "delete_img_dep.php?dep_id=" + document.getElementById("dep_id").value+"&imgField="+str, true); xmlhttp.send(); swal("Poof! Your imaginary file has been deleted!", { icon: "success", }); } }); } </script>