Файл: profi_wm/fo/files.php
Строк: 18
<?php
include '../system/core.php';
include '../system/header.php';
$id = abs(intval($_GET['id']));
$praz = mysql_fetch_assoc(mysql_query("SELECT * FROM `fo_pr` WHERE `id` = '$id' LIMIT 1"));
if(empty($praz['id'])){
header('location:/');
exit();
}
$raz = mysql_fetch_assoc(mysql_query("SELECT * FROM `fo_r` WHERE `id` = '$praz[id_r]' LIMIT 1"));
$_title = 'Обменник | '.$raz['name'].' | '.$praz['name'];
$count = mysql_result(mysql_query("SELECT COUNT(id) from `fo` where `id_pr` = '$id'"),0);
if($count==0){
echo 'Файлов пока нет :(';}
$q = mysql_query("select * from `fo` where `id_pr` = '$id' order by `id` DESC");
while($a = mysql_fetch_assoc($q)){
$ext = pathinfo($a['file'], PATHINFO_EXTENSION);
if(!file_exists('ext/'.$ext.'.png')){
$ico = '<img src="ext/stand.png" alt=""/>';
} else {
$ico = '<img src="ext/'.$ext.'.png" alt=""/>';
}
echo '<div class="post2">'.$ico.' <a href="file.php?id='.$a['id'].'">'.$a['name'].'</a> ('.$ext.'|'.size(filesize($a['file'])).')<br/>'.mb_substr($a['value'],0,45).'...</div>';
}
echo '<div class="post1"><a href="up.php?id='.$id.'">Загрузить</a></div>';echo '<div class="post1"><a href="/fo"><img src="ext/dir.gif" alt="*"/> Обменник</a></div>';
echo '<div class="post1"><img src="ext/dir.gif" alt="*"/> <a href="/fo">Обменник</a> / <a href="/fo/pr.php?id='.$raz['id'].'">'.$raz['name'].'</a> / <b>'.$praz['name'].'</b></div>';
include '../system/footer.php';
?>