<?
$sql = $pdo->Query("SELECT * FROM `php_tovar` WHERE `moder` = '1' ORDER BY `buy` DESC LIMIT 5");
while($top = $sql->Fetch()) {
$id = intval($top['id']);
$config_tov = $pdo->Query("SELECT * from php_img WHERE tovar = '" . $id . "'")->fetch(PDO::FETCH_BOTH);
?>
<style>
.wrap_klink {
    display: block;
    text-decoration: none;
    text-align: left;
    font-size: 12px;
    padding: 3px;
    margin: 0 0px;
    border-bottom: 1px solid #DDDDDD;
    padding-top: 5px;
    padding-bottom: 5px;
    background: #fff;
    border-left: 1px solid #DDDDDD;
    border-right: 1px solid #DDDDDD;
}

.wrap_klink:hover {
    background: #ffffff;
    border-top: 1px solid #e3e6e9;
    border-bottom: 1px solid #e3e6e9;
}
.wrap_klink_info {
    position: relative;
    margin-top: 5px;
    height: 20px;
    line-height: 20px;
    padding-left: 5px;
}
.title_klink {
    color: #000;
    font-size: 12px;
    font-style: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    white-space: nowrap;
    width: 150px;
}
.des_klink {
    color: #444444;
    font-style: normal;
    word-wrap: break-word;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inside .info {
    display: table;
    top: 0px !important;
    margin: 0px !important;
    padding-left: 10px;
}

.inside .left {
    float: left;
    background: #fff;
    padding: 3px;
    border: 1px solid #DDD;
    border-radius: 2px;
	}


</style>
 
 <div class="inside">

 <a href="<?=ROOT?>/post<?=$id?>" target="_blank" class="wrap_klink">
			
	<div class="left">
<img src="http://akclub.ru/thumb.php?id=<?=$id?>&s=300&f=<?=$config_tov['dir']?>" class='img' width="50" height="50" alt="Купить онлайн <?=$title?>">
</div>
	<div class="info">
			<div class="title_klink"><?=wraptitle( $top['title'], 30 )?></div>
            <div class="des_klink"><?=wraptitle( $top['cratkaya'], 30 )?></div>
	</div>
 </a>
</div>
<?
}
?>