-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/inc/file/
File Upload :
Current File : /var/www/html/inc/file/remove.php

<?php

	include $_SERVER['DOCUMENT_ROOT'] . '/inc/config.php' ;

	$num = ( empty($_POST['num']))?$_GET['num']:$_POST['num'] ;
	$code = ( empty($_POST['code']))?$_GET['code']:$_POST['code'] ;

	$no______impossible = "<script> alert('»èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù.'); self.close(); </script>" ;

	if ( empty($code) || empty($num)) {
		echo $no______impossible ;
		exit ;
	}
	else
	{
		$total['table'] = $config[$code][1] ;

		$f_rs = $exe->qry_fetch( " from tbl_{$info_file[table]} where keycode='{$code}' and fileno='{$num}' " , " fileno , parent_numid , orig_file_name , real_file_name, file_size , up_type " ) ;

		if ( !empty($f_rs['fileno']))
			$exe->qry_delete( "tbl_{$info_file[table]}" , " fileno='{$num}' " ) ;
		if ( !empty($f_rs['real_file_name']))
			file_delete( 'files/' . $total['table'] . '/' . $f_rs['real_file_name'] ) ;
		if ( $config[$code][4]['preview'] == 1 || $config[$code][4]['preview'] == 'on' )
			file_delete( 'files/' . $total['table'] . $info_thumb['directory'] . '/' . $info_thumb['head'] . $f_rs['real_file_name']);

		if ( $code == 'SHP' )
			$exe->qry_update( ' attachfile = attachfile - 1 ' , ' tbl_' . $total['table'] . '_item' , ' keycode=\'' . $code . '\' and numid=\'' . $f_rs['parent_numid'] . '\' ' ) ;
		else
			$exe->qry_update( ' attachfile_count = attachfile_count - 1 ' , ' tbl_' . $total['table'] , ' keycode=\'' . $code . '\' and numid=\'' . $f_rs['parent_numid'] . '\' ' ) ;
	
		$f_rs['file_size'] = empty($f_rs['file_size']) ? 0 : intval($f_rs['file_size']) ; 
		echo "
			<html>
			<head>
			<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\">
			<link href=\"/css/css.css\" rel=\"stylesheet\" type=\"text/css\">
			<script language='javascript'>
				var tg = opener.document.getElementsByName('nowsize')[0] ;
		" ;
		if ( $f_rs['up_type'] == 'IMAGE' && !empty($_GET['tn'])) {
			/*
			echo "
					theif = opener.document.frames['{$_GET[tn]}'].document ;
					if ( theif == null ) {
					} else {
						t_content = theif ;
						t_image = t_content.getElementsByTagName('IMG') ;
						len = t_image.length  ;
						for ( var i = 0 ; i < len ; i++ ) {
							file_num = t_image[i].src.substring(t_image[i].src.lastIndexOf('?')+1) ;
							if ( file_num == 'num={$num}' ) {
								 t_image[i].removeNode(true) ;
								 break ;
							}
						}
					}
			" ;
			*/
		}
		echo "
				tg.value = ( parseInt(tg.value , 10) - {$f_rs[file_size]} ) ;
				if ( tg.value < 0 ) tg.value = 0 ;
				opener.delselectoption('{$f_rs[orig_file_name]}' , '{$num}' ) ;
				self.close() ;
			</script>
			</head>
			</html>
		" ;

	}

?>


Copyright © 2017 || Recoded By Mr.Bumblebee