403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
PHP Version : 8.2.20
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/nhadatkhangdien.net-bk/public_html/admin/sources/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/nhadatkhangdien.net-bk/public_html/admin/sources/logodoitac.php
<?php	if(!defined('_source')) die("Error");

$act = (isset($_REQUEST['act'])) ? addslashes($_REQUEST['act']) : "";

switch($act){
	case "man_photo":
		get_photos();
		$template = "logodoitac/photos";
		break;
	case "add_photo":
		$template = "logodoitac/photo_add";
		break;
	case "edit_photo":
		get_photo();
		$template = "logodoitac/photo_edit";
		break;
	case "save_photo":
		save_photo();
		break;
	case "delete_photo":
		delete_photo();
		break;
		
	default:
		$template = "index";
}

function fns_Rand_digit($min,$max,$num)
	{
		$result='';
		for($i=0;$i<$num;$i++){
			$result.=rand($min,$max);
		}
		return $result;	
	}
function get_photos(){
	global $d, $items, $paging;
	
	$d->setTable('logodoitac');
	$d->setWhere('com', 'quangcao');
	$d->setOrder('stt,id desc');
	$d->select('*');
	$d->query();
	$items = $d->result_array();
	
	$curPage = isset($_GET['curPage']) ? $_GET['curPage'] : 1;
	$url="index.php?com=logodoitac&act=man_photo";
	$maxR=10;
	$maxP=4;
	$paging=paging($items, $url, $curPage, $maxR, $maxP);
	$items=$paging['source'];

}
function get_photo(){
	global $d, $item, $list_cat;
	$id = isset($_GET['id']) ? themdau($_GET['id']) : "";
	if(!$id)
		transfer("Không nhận được dữ liệu", "index.php?com=logodoitac&act=man_photo");
	
	$d->setTable('logodoitac');
	$d->setWhere('com', 'quangcao');
	$d->setWhere('id', $id);
	$d->select();
	if($d->num_rows()==0) transfer("Dữ liệu không có thực", "index.php?com=logodoitac&act=man_photo");
	$item = $d->fetch_array();
	$d->reset();
}
function save_photo(){
	global $d;
	$file_name=fns_Rand_digit(0,9,6);
	if(empty($_POST)) transfer("Không nhận được dữ liệu", "index.php?com=logodoitac&act=edit_photo&id=4");
	
	$id = isset($_POST['id']) ? themdau($_POST['id']) : "";
	if($id){ // cap nhat
		
			if($photo = upload_image("file", 'jpg|png|gif', _upload_hinhanh,$file_name)){
				$data['photo'] = $photo;				
				$d->setTable('logodoitac');
				$d->setWhere('id', $id);
				$d->select();
				if($d->num_rows()>0){
					$row = $d->fetch_array();
					delete_file(_upload_hinhanh.$row['photo']);				
				}
			}
			$data['id'] = $_REQUEST['id'];
			$data['stt'] = $_POST['stt'];
			$data['hienthi'] = isset($_POST['hienthi']) ? 1 : 0;
			$data['com'] = 'quangcao';
			$data['mota'] = $_POST['mota'];
			$data['ten'] = $_POST['ten'];
			$data['vitri'] = $_POST['vitri'];

			$d->reset();
			$d->setTable('logodoitac');
			$d->setWhere('id', $id);
			if($d->update($data)) transfer("Cập nhật dữ liệu thành công", "index.php?com=logodoitac&act=edit_photo&id=4");
			header("Location:index.php?com=logodoitac&act=edit_photo&id=4");
	}{ // them moi
		
			for($i=0; $i<5; $i++){
				if($photo = upload_image("file".$i, 'jpg|png|gif', _upload_hinhanh,$file_name.$i))
					{
						$data['photo'] = $photo;					
							
						
						$data['ten'] = "ten".$i;
						$data['stt'] = $_POST['stt'.$i];
						$data['hienthi'] = isset($_POST['hienthi'.$i]) ? 1 : 0;
						$data['com'] = 'quangcao';
						$data['mota'] = $_POST['mota'.$i];
						$data['vitri'] = $_POST['vitri'.$i];

						$data['id_photo'] = $_REQUEST['idc'];
						
						$d->setTable('logodoitac');
						if(!$d->insert($data)) transfer("Lưu dữ liệu bị lỗi", "index.php?com=logodoitac&act=edit_photo&id=4");
					}
			}
			header("Location:index.php?com=logodoitac&act=edit_photo&id=4");
		
	}
}


function delete_photo(){
	global $d;
	
	if(isset($_GET['id'])){
		$id =  themdau($_GET['id']);
		$d->setTable('logodoitac');
		$d->setWhere('id', $id);
		$d->select();
		if($d->num_rows()==0) transfer("Dữ liệu không có thực", "index.php?com=logodoitac&act=man_photo");
		$row = $d->fetch_array();
		delete_file(_upload_hinhanh.$row['photo']);	
		if($d->delete())
		
			header("Location:index.php?com=logodoitac&act=man_photo");
		else
			transfer("Xóa dữ liệu bị lỗi", "index.php?com=logodoitac&act=man_photo");
	}else transfer("Không nhận được dữ liệu", "index.php?com=logodoitac&act=man_photo");
}

?>

	

Youez - 2016 - github.com/yon3zu
LinuXploit