<?php
define('ROOT','../');
define('GCMS',true);
define('SYS', '../files');
require_once (ROOT.'system/power.php');
$diz -> head('Чтение архива');
$diz -> title('<b>Чтение архива</b>');
$row = $db -> query("SELECT TRIM(`infolder`) FROM `obmen_files` WHERE `id`='".$id."'")->fetch_row();

if (file_exists($row[0])) {

		 $db -> query("UPDATE `obmen_files` SET `load`=`load`+'1' WHERE `id`='".$id."'");
	if (!file_exists($tmp)) {
		require_once('./power/pclzip.lib.php');
		
		$zip = new PclZip($tmp);
		
		function str ($event, &$header) {
			$header['stored_filename'] = basename($header['filename']);
			return 1;
		}
		
		$zip->create($row[0], PCLZIP_CB_PRE_ADD, 'str');
		
	}
	
	header('Location: '.$tmp, true, 301);
	
} else {
	$msg.='Архив не найден!';
}
?>