<?
require_once('config.php');
if($dynpokaz1=='1'){$adsvip = mysql_query("SELECT * FROM tb_ads1 where tipo='ads' and vip='1' and members < plan and play = '0' ORDER BY fechainicia DESC");$wel++;}
if($dynpokaz1=='3'){$adsvip = mysql_query("SELECT * FROM tb_ads1 where tipo='ads' and vip='3' and members < plan and play = '0' ORDER BY fechainicia DESC");$wel++;}
while ($adsv = mysql_fetch_assoc($adsvip))
 {$idh=$adsv['id'];
  $description=$adsv['description'];
  $highlight=$adsv['highlight'];
  $plan=$adsv['plan'];
  $members=$adsv['members'];
  $outside=$adsv['outside'];
  $total=$members+$outside;
  $timer=$adsv['timer'];
  $urldyn=$adsv['url'];
  $all_zh=$adsv['all_zh'];

  if($dynpokaz1=='3'){$highlight="#C1CDCD";}else{if($highlight==1){$highlight="#C80000";}else{$highlight="";}}
   if ($total<=5) { $new='<font color="red">(new)</font>'; } else { $new='&nbsp;';}
   $crok1 = date(time());
    $crok2 = date($iden1[$idh] + (24 * 60 * 60));
 	?>
<?if($crok1 >= $crok2){?>
<?
include('moneymini.php');
  if($timer == 5) $elprecio=$payfor5;
  if($timer == 10) $elprecio=$payfor10;
  if($timer == 15) $elprecio=$payfor15;
?>
<div style="border-bottom: 1px dashed #9d9d9d;padding:2px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<table style="width:100%;">
<tbody>
<?
if($idh==$lastid) { ?><tr style="display:none;"><? }else{ ?><tr><? } ?>
<td colspan="4" style="vertical-align:top">
<a onclick="javascript: this.style.textDecoration='line-through';" href="views.php?ad=<?=$idh?>" target="_blank" style="color:<?=$highlight?>;"><span class='desctext12'><?=$description?></span></a>&nbsp;<?=$new?>
</td>
<?
if($id==$lastid) { ?><tr><? }else{ ?><tr><? } ?>
<? $domen=$adsv["url"];
    $domen = str_replace("//","/",$domen);
    $domen = str_replace("www.","",$domen);
    $domen = explode("/", $domen);
    $domen=$domen[1];
    if (strlen($domen) > 20) { $domen=substr($domen,0,20)."..."; } ?>
<td style="vertical-align:top">
<font size='1' color="#9d9d9d"><?=$domen?> | План: <?=$plan?> показов | Просмотры: <?=$members?> | Таймер: <?=$timer?> сек.</font>
<?
if(isset($_SESSION["username"]) && isset($_SESSION["password"]))
{
?><font size='1' color='7A797F'> | Оплата: <font color='red'><?=$elprecio?></font> руб</font>
<?
}
?>
</td>
</tr></tbody></table></td>
<td class="ad-varius" valign="middle"><a href="zhaloba_view.php?id=<?=$idh ?>" target="_blank" class="drweb" title="Пожаловаться"></a></td>
<td class="ad-varius" valign="middle">
<? if($adsv['act']==1) { ?>
<img src="images/a.png" width="16px" height="16px"  style="opacity: 0.5;">
<? }else{ ?>
<img src="images/cur.png" width="16px" height="16px" style="opacity: 0.5;">
<? } ?>
</td>
</table></div>
<? }?>
<? } ?>