<?
include_once H.'/sys/inc/start.php';
include_once H.'/sys/inc/compress.php';
include_once H.'/sys/inc/sess.php';
include_once H.'/sys/inc/home.php';
include_once H.'/sys/inc/settings.php';
include_once H.'/sys/inc/db_connect.php';
include_once H.'/sys/inc/ipua.php';
include_once H.'/sys/inc/fnc.php';
include_once H.'/sys/inc/user.php';

include_once H.'/sys/inc/thead.php';



$set['title']='Завершенные Фотоконкурсы';
title();
aut();




echo '<div class="main">Завершенные фотоконкурсы:</div>';

?>

<style>
.vpravo{float:right;}
.end{display:inline-block;color:#000;overflow:hidden}
.phcmp_i{margin-right:.3em;padding:.2em .3em;text-align:center;color:#fff;background-color:#61bf01;font-size:small}
.phcmp_i{display:inline-block;padding-right:1.5em;position:relative;overflow:hidden;margin-right:0}.n 
.phcmp_i:after{content:'';display:block;height:100%;width:1.5em;position:absolute;top:0;right:-.8em;background:#fff;
-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.
</style>

<?
$k_post = mysql_result(mysql_query("SELECT COUNT(active) FROM `fk` WHERE `active` = '0' "), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

if ($k_post==0)
{
echo '<div class="err">Нет завершенных фотоконкурсов!</div>';
}

$q=mysql_query("SELECT id,name,images,active,end_time FROM `fk` WHERE `active` = '0' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($res = mysql_fetch_assoc($q)) {

if($res['images'] == null) { $images = '<img src="img/not.png"  alt="*" class="image" align="left" height="50" width="50" style="margin: -4px 8px 1px 0px;"/>'; }
else { $images = '<img src="images/'.$res['images'].'"  alt="*" class="image" align="left" height="50" width="50" style="margin: -4px 8px 1px 0px;"/>'; }

if($res['active'] == 0) { $end = '<span class="end">завершен</span>'; }
else { $end = ''; }

echo'<div class="mess"><span class="vpravo"><small>'.vremja($res['end_time']).'</small></span><a href="konkurs.php?id='.$res['id'].'">
'.$images.'
<body class="noscroll n fixe"> <span class="phcmp_i">Конкурс</span>'.$end.'
<br/>'.$res['name'].'<br/></a></div>';




}

if ($k_page>1)str("?",$k_page,$page); // Вывод страниц


echo '<div class="foot"><img src="img/fk.png"> <a href="index.php">Фотоконкурсы</a></div>';


err();
include_once H.'/sys/inc/tfoot.php';
?>