%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
if($_GET["type"]=="1")
$txtNews = "ผู้ปกครอง";
else if($_GET["type"]=="2")
$txtNews = "ระดับชั้นอนุบาล";
else if($_GET["type"]=="3")
$txtNews = "ระดับชั้นประถมศึกษา";
else if($_GET["type"]=="4")
$txtNews = "ระดับชั้นมัธยมศึกษา";
?>
<?PHP
session_start();
if($_SESSION["UserAccess"]=="")
{
header('Location: index.php');
exit();
}
?>
<meta charset="utf-8">
<?php
include "conf.php";
?>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/gijgo@1.9.6/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/npm/gijgo@1.9.6/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css" />
<link rel="stylesheet" href="grid-gallery.css">
<meta charset="utf-8">
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.js"></script>
<script>
function Edit(type,IDRun) {
//alert(type+"-"+IDRun);
window.location.href = "news_add.php?type="+type+"&IDRun="+IDRun;
}
function Delete(type,IDRun) {
var r = confirm("ยืนยันการลบข้อมูลข่าวสาร รหัส : "+IDRun);
if (r == true) {
window.location.href = "save_news.php?type="+type+"&IDRun="+IDRun+"&Action=Delete";
}
}
function Clear(type) {
window.location.href = "news_add.php?type="+type;
}
</script>
<body>
<div class="jumbotron text-center">
<h1>บันทึกข้อมูลข่าวสาร</h1>
<p>บันทึกข้อมูลข่าวสารสำหรับ <?PHP echo $txtNews; ?></p>
</div>
<?php
if($_GET['IDRun']!="") {
$sql = "select * from news where NewsType='".$_GET['type']."' and IDRun=".$_GET['IDRun'];
//echo "Sql : ".$sql;
$result = $conn->query($sql) or die("Cant' query");
$str_Title="";
$str_Detail="";
$str_IDRun = "-1";
while($row = $result->fetch_assoc()) {
$str_Title = $row['Title'];
$str_Detail=$row['Detail'];
$str_IDRun = $row['IDRun'];
}
} else {
$str_IDRun = "-1";
}
?>
<div class="container">
<div class="row">
<div class="col-12">
<form action="save_news.php" method="post" id="activity">
<div class="form-group">
<label for="exampleFormControlFile1">หัวข้อข่าวสาร</label>
<input type="text" class="form-control" aria-label="Default" aria-describedby="inputGroup-sizing-defaul" name="title" id="title" value="<?PHP echo $str_Title; ?>">
</div> </div>
<div class="col-12">
</div>
<div class="col-12">
<div class="form-group">
<label for="exampleFormControlFile1">รายละเอียด</label>
<textarea id="detail" name="detail"><?PHP echo $str_Detail; ?></textarea>
</div>
<div class="row">
<div class="col-6">
<input class="form-control btn btn-primary" type="submit" value="บันทึกข้อมูล">
</div>
<div class="col-6">
<button type="button" class="form-control btn btn-secondary" onclick="Clear(<?PHP echo $_GET['type']; ?>)">Clear</button>
</div>
</div>
</div>
</div>
<P></P>
<input type="hidden" id="IDRun" name="IDRun" value="<?PHP echo $str_IDRun; ?>">
<input type="hidden" id="type" name="type" value="<?PHP echo $_GET['type']; ?>">
</form>
</div>
<script>
$('#detail').summernote({
height: 300
});
</script>
<div class="container">
<?php
$sql = "select * from news where NewsType='".$_GET['type']."' order by IDRun DESC";
//echo "Sql : ".$sql;
$result = $conn->query($sql) or die("Cant' query");
?>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col" width="120">#</th>
<th scope="col">รหัส : หัวข้อ</th>
<th scope="col" width="90">แก้ไข</th>
<th scope="col" width="90">ลบข้อมูล</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while($row = $result->fetch_assoc()) {
?>
<tr>
<th scope="row"><?PHP echo $i; ?></th>
<td><?PHP echo $row['IDRun']." : ".iconv("tis-620","utf-8",$row['Title']); ?></td>
<td><button type="button" class="btn btn-Secondary" onclick="Edit(<?PHP echo $_GET['type']; ?>,<?PHP echo $row['IDRun']; ?>)">Edit</button></td>
<td><button type="button" class="btn btn-danger" onclick="Delete(<?PHP echo $_GET['type']; ?>,<?PHP echo $row['IDRun']; ?>);">Delete</button></td>
</tr>
<?PHP $i++; } ?>
</tbody>
</table>
</div>
</body>
</html>