%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 : |
<html> <head> <meta charset="UTF-8"> </head> <body> <?PHP session_start(); if($_SESSION["UserAccess"]=="") { header('Location: index.php'); exit(); } ?> <?php include "conf.php"; //echo "Type : ".$_GET["Type"]."-".$_GET['DepName']."<BR>"; if($_GET["Type"]=="INSERT" && $_GET['DepName']!="") { //echo "Insert"; $sql="insert into department (dep_name) values ('".$_GET['DepName']."')"; //echo "SQL : ".$sql."<BR>"; if ($conn->query($sql) != TRUE) { echo "Error: " . $sql . "<br>" . $conn->error; exit(); } } else if($_GET["Type"]=="UPDATE" && $_GET['DepName']!="") { //echo "update"; $sql="update department set dep_name='".$_GET['DepName']."' where dep_id=".$_GET["dep_id"]; //echo "SQL : ".$sql."<BR>"; if ($conn->query($sql) != TRUE) { echo "Error: " . $sql . "<br>" . $conn->error; exit(); } } else if($_GET["Type"]=="DELETE") { //echo "Delete"; $sql="delete from department where dep_id=".$_GET["dep_id"]; //echo "SQL : ".$sql."<BR>"; if ($conn->query($sql) != TRUE) { echo "Error: " . $sql . "<br>" . $conn->error; exit(); } } $sql = "select * from department order by dep_name"; //echo "Sql : ".$sql; $result = $conn->query($sql) or die("Cant' query"); ?> <table class="table table-hover" > <thead> <tr> <th scope="col">ลำดับ</th> <th scope="col">ชื่อหน่วยงาน</th> <th scope="col"></th> <th scope="col">นำเข้าแผนผังหน่วยงาน</th> <th scope="col">แก้ไขข้อมูล</th> <th scope="col">ลบข้อมูล</th> </tr> </thead> <tbody> <?php $i=1; while($row = $result->fetch_assoc()) { ?> <tr> <td scope="row"><?php echo $i; ?></td> <th scope="col"> <img src="../img_department/<?PHP echo $row["img_1"]; ?>" width=100px height=60px> </th> <td><?php echo $row["dep_name"]; ?></td> <td><button type="button" class="btn btn-success" onclick="OpenUpload(<?PHP echo $row["dep_id"]; ?>)">นำเข้าแผนผังหน่วยงาน</button></td> <td><button type="button" class="btn btn-warning" onclick="EditDep('<?PHP echo $row["dep_name"]; ?>',<?PHP echo $row["dep_id"]; ?>)">แก้ไขข้อมูล</button></td> <td><button type="button" class="btn btn-danger" onclick="DeleteDep(<?PHP echo $row["dep_id"]; ?>)">ลบข้อมูล</button></td> </tr> <?PHP $i++; } ?> </tbody> </table> </body> </html>