Файл: modules/portfolio/view_work.php
Строк: 38
<?php
$title = 'Портфолио | Просмотр работы';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
if($db->query("SELECT `id` FROM `portfolio_works` WHERE `id`='".$_GET['id']."'")->num_rows==0){
error('Работы не существует.');
}
$work = $db->query("SELECT * FROM `portfolio_works` WHERE `id`='".$_GET['id']."'")->fetch_assoc();
$folder = $db->query("SELECT * FROM `portfolio_folders` WHERE `id`='".$work['id_folder']."'")->fetch_assoc();
switch ($work['t']) {
case 'min':
$t = 'мин.';
break;
case 'hour':
$t = 'ч.';
break;
case 'day':
$t = 'д.';
break;
case 'month':
$t = 'мес.';
break;
case 'year':
$t = 'л.';
break;
}
?>
<div class="title">
<a href="/portfolio">Портфолио</a>
|
<a href="/portfolio/folder/<?=$folder['id']?>"><?=htmlspecialchars($folder['name'])?></a>
|
<?=htmlspecialchars($work['name'])?>
</div>
<?if($user['level']>=1 or $user['id']==$work['id_us']){?>
<div class="section">
<a href="/portfolio/work/<?=$_GET['id']?>/edit">Редактировать</a>
|
<a href="/portfolio/work/<?=$_GET['id']?>/del">Удалить</a>
|
<a href="/portfolio/edit_screen/<?=$_GET['id']?>">Скриншоты</a>
</div>
<?}?>
<div class="text">
<b>Название:</b> <?=output($work['name'])?><br>
<b>Описание:</b><br>
<?=output($work['description'])?><br>
<?
$query = $db->query("SELECT * FROM `portfolio_screen` WHERE `id_work`='".$_GET['id']."'");
while ($s = $query->fetch_assoc()) {
?>
<a href="/files/portfolio/screen/<?=htmlspecialchars($s['file'])?>"><img src="/files/portfolio/screen/<?=htmlspecialchars($s['file'])?>" style="width: 50px; height: 50px;"></a>
<?
}
if($query->num_rows!=0){
?>
<br/>
<?
}
?>
<b>Стоимость:</b> <?=$work['summ']?><br>
<b>Потрачено времени:</b> <?=$work['times']?> <?=$t?><br>
<b>Автор:</b> <?=nick($work['id_us'])?><br>
<b>Время добавления:</b> <?=times($work['time'])?><br>
<b>Рейтинг:</b> [<font color="green"><?=$db->query("SELECT `id` FROM `portfolio_rating` WHERE `id_work`='".$_GET['id']."' AND `type`='1'")->num_rows?></font>/<font color="red"><?=$db->query("SELECT `id` FROM `portfolio_rating` WHERE `id_work`='".$_GET['id']."' AND `type`='2'")->num_rows?></font>]
<?if($user['id']!=$work['id_us'] AND $db->query("SELECT `id` FROM `portfolio_rating` WHERE `id_us`='".$user['id']."' AND `id_work`='".$_GET['id']."'")->num_rows==0){?>
<b><font color="green"><a href="/portfolio/work/<?=$_GET['id']?>/plus">+</a></font></b> | <b><font color="red"><a href="/portfolio/work/<?=$_GET['id']?>/minus">-</a></font></b>
<?}?>
<br><a href="/portfolio/comm/<?=$_GET['id']?>">Комментарии</a> [<?=$db->query("SELECT `id` FROM `portfolio_comm` WHERE `id_work`='".$_GET['id']."'")->num_rows?>]
</div>
<?
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>