Файл: medals.php
Строк: 21
<?
include_once 'system/sys.php';
if(!$cms->us['id']){ header('location: /'); }
$us = DB::$dbs->queryFetch("SELECT * FROM `us` where `id` = ? limit 1",array(abs(intval($_GET['id']))));
if(empty($us['id'])){header('location:/');}
verh('Награды '.$us['nick']);
include 'system/funcs.php';
echo '<div class="menu">Награды '.$func->uNick($us['id']).'</div>';
switch($_GET['mod']){
default:
if($cms->us['level'] > 1 && $us['id'] != $cms->us['id']) echo '<div class="list1"><a href="/medals.php?id='.$us['id'].'?mod=add">Вручить</a></div>';
$posts = DB::$dbs->querySingle("SELECT count(`id`) from `medals` where (`us` = ?)",array($us['id']));
if($posts > 0){
$medals = DB::$dbs->query("SELECT * FROM `medals` where (`us` = ?) order by `id` desc",array($us['id']));
while($medal = $medals -> fetch()){
switch($medal['type']){
case 1:
$image = 'medal_silver_3';
break;
case 2:
$image = 'medal_silver_2';
break;
case 3:
$image = 'medal_red';
break;
case 4:
$image = 'medal_gold_3';
break;
case 5:
$image = 'medal_gold_1';
break;
case 6:
$image = 'medal_bronze_3';
break;
case 7:
$image = 'medal_bronze_1';
break;
case 8:
$image = 'gold_medal';
break;
case 9:
$image = 'award_star_gold_3';
break;
case 10:
$image = 'award_star_gold_2';
break;
}
echo '<div class="lst"><img src="/images/medals/'.$image.'.png" alt="*"/> Вручил: '.$func->uNick($medal['kem']).' ('.t($medal['time']).')<br><b>За что: <font color="red">'.$medal['why'].'</font></b>';
if($cms->us['level'] > 1) echo ' [<a href="/medals.php?id='.$us['id'].'?mod=del&medal_id='.$medal['id'].'">x</a>]';
echo '</div>';
}
}else{ echo '<div class="list1">'.$func->uNick($us['id']).' не награждался!</div>'; }
break;
}
niz();
?>