%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 122.154.253.140 / Your IP : 216.73.216.138 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
session_start();
if($_SESSION["UserAccess"]=="")
{
header('Location: index.php');
exit();
}
?>
<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://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<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>
<style>
.bg {
/* The image used */
background-image: url("../img/img_main.jpg");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
<head>
<meta charset="UTF-8">
</head>
<body onload="SaveDep(1)">
<div class="jumbotron text-center">
<h1>กำหนดชื่อหน่วยงาน</h1>
<p>เป็นการกำหนดหน่วยงานของโรงเรียนเพื่อกำนหดรูปภาพผังองค์กร</p>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<label for="exampleFormControlSelect2">ชื่อหน่วยงาน</label>
<input class="form-control" type="text" placeholder="ระบุชื่อหน่วยงาน" id="DepName"><br>
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="SaveDep(0)">บันทึกชื่อหน่วยงาน</button>
</div>
</div>
<div class="col-12">
<div id="showDep" algin="center"></div>
</div>
</div>
<input type="hidden" id="hiddenType" name="hiddenType" value="INSERT">
<input type="hidden" id="hiddenDepID" name="hiddenDepID" value="0">
</body>
</html>
<script>
function SaveDep(load) {
if(document.getElementById("DepName").value=="" && load==0) {
swal("Warning job!", "กรุณาระบุชื่อหน่วยงานด้วย", "warning");
return;
}
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("showDep").innerHTML = this.responseText;
document.getElementById("DepName").value = "";
document.getElementById("hiddenType").value = "INSERT";
document.getElementById("hiddenDepID").value = "0";
}
};
xmlhttp.open("GET", "save_dep.php?Type="+document.getElementById("hiddenType").value+"&DepName=" + document.getElementById("DepName").value+"&dep_id="+document.getElementById("hiddenDepID").value, true);
xmlhttp.send();
}
function EditDep(data,dep_id) {
//alert(dep_id);
document.getElementById("DepName").value = data;
document.getElementById("hiddenType").value = "UPDATE";
document.getElementById("hiddenDepID").value = dep_id;
}
function DeleteDep(dep_id) {
//alert("OK");
swal({
title: "Are you sure?",
text: "ยืนยันการลบข้อมูลที่ท่านเลือก",
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("showDep").innerHTML = this.responseText;
swal("การลบข้อมูลดังกล่าวเสร็จสมบูรณ์...", {
icon: "success",
});
}
};
//alert(dep_id);
xmlhttp.open("GET", "save_dep.php?dep_id=" + dep_id+"&Type=DELETE", true);
xmlhttp.send();
}
});
}
function OpenUpload(DepID) {
window.location.assign("images_dep.php?DepID="+DepID)
}
</script>