View file inc/shop_udobr_index.php

File size: 1.26Kb
<?php
$k=mysql_result(mysql_query("SELECT COUNT(*) FROM `fermer_udobr_name`"),0);
$k_page = ceil($k / $SET['p_str']);
$page = page();
$start=$SET['p_str']*$page-$SET['p_str'];
$res = mysql_query("select * from `fermer_udobr_name` LIMIT $start, $SET[p_str];"); 
echo'<div class="ferma_menu"><img src="/img/shop.gif"/></div>';
while ($post = mysql_fetch_array($res)){
$timediff=$post['time'];
$oneMinute=60; 
$oneHour=60*60; 
$oneDay=60*60*24; 
$dayfield=floor($timediff/$oneDay); 
$hourfield=floor(($timediff-$dayfield*$oneDay)/$oneHour); 
$minutefield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour)/$oneMinute); 
$secondfield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour-$minutefield*$oneMinute)); 
if($dayfield>0)$day=$dayfield.'д. ';
if($minutefield>0)$minutefield=$minutefield."м.";else$minutefield='';
$time_1=$day.$hourfield."ч. ".$minutefield;
echo '
<div class="ferma_menu">
<img src="img/udobr/ud'.$post['id'].'.png" alt="*" class="portrait" />
<a href="?id='.$post['id'].'">'.htmlspecialchars($post['name']).'</a><br/>
Цена: <img src="/img/icon/money.png" alt="*" /> <big>'.$post['cena'].'</big><br/>
Ускоряет рост на <b>'.$time_1.'</b><br/>
</div>
';
}
if ($k_page>1)str('shop_udobr.php?',$k_page,$page); // Вывод страниц
?>