View file obmen/view.php

File size: 1.22Kb
<?php 
require '../sys/dbconnect.php';
include_once'panel/fc.php';
include_once'../sys/head.php';
echo '<div class="top"><b>Обменник</b></div>';
$id = intval($_REQUEST['id']);
$result_load = mysql_query("SELECT * FROM `obmen` WHERE `id` = '$id'");
if(mysql_num_rows($result_load)){
	$load = mysql_fetch_assoc($result_load);
	echo '<div class="section">';
	if(empty($load['name'])){
		$name = $load['file'];
	}else{
		$name = $load['name'];
	}
	echo '<u>'.$name.'</u><br />';
	$fileformat = substr($load['file'], -3);
	if($fileformat == 'jpg' or $fileformat == 'gif' or $fileformat == 'png'){
		echo '<img src="obmen/'.$load['file'].'" width="80" height="80"><br />';
	}
	if(!empty($load['desc'])){
		echo 'Описание:<br />'.nl2br($load['desc']).'<br />';
	}
	echo 'Добавлено: '.date('d.m.y, H:i', $load['time']).'<br />';
	echo '<img src="/img/load.png"><a href="obmen/'.$load['file'].'">Скачать '.$name.'</a> ('.round(filesize('obmen/'.$load['file'])/1000).' Kb)<br />';
	include_once '../sys/foot.php';
  echo '</div>';
}else{
	error('Выбранный файл не существует!');
}
//nav('index.php?act=cat&amp;id='.$load['id_cat']);

include_once '../sys/foot.php';
?>