<?php
require'fun.php';
require'f_conectare.php';
conectare('zambareti','zambareti');
if($pid=='')
$pid=0;
if($pid==1&&$perm<1)
$pid=0;
$cod=$_POST['cod']??$_GET['cod']??'';
if($pid==0&&$go==''||$cod!='')
{
$head[1]='lista emoticoane, lista emotii, lista zambareti';
$back[1]='<a href="/statistici">'.img('statistici.gif',1).'Statistici</a>';
$back[2]='<a href="/setari">'.img('setari.png',2).'Setări</a>';
}
else
{
$back[1]='<a href="/zambareti">Zambareti</a>';
}
$titlu='Zambareti';
require'f_sus.php';
echo$div[4].'Zambareti'.$div[5];
if($go=='')
{
$form[0]='/zambareti" method="post';
$form[1]=1;
$form[2]=$div[1].'Caută în zambareti:<br /><input name="cod" />'.$div[0];
$form[3]='cod';
$form[4]='Cauta';
require'f_form.php';
}
$x3='';
if(isset($_POST['cod']))
{
$x2='?cod='.rawurlencode($cod);
$x3='&&`scode`LIKE"%'.$cod.'%"';
}
elseif(isset($_GET['cod']))
{
$x2='?cod='.$cod;
$x3='&&`scode`LIKE"%'.rawurldecode($cod).'%"';
}
$elemente=$conn->query('SELECT COUNT(*)FROM`imagini_zambareti`WHERE`vizibil`="'.$pid.'"'.$x3)->fetch_row()[0];
if($elemente>0)
{
require'f_paginare1.php';
$items=$conn->query('SELECT`id`,`scode`,`imgsrc`FROM`imagini_zambareti`WHERE`vizibil`="'.$pid.'"'.$x3.'ORDER BY`id`LIMIT '.$limit_start.','.$pe_pagina);
while($item=$items->fetch_row())
{
echo$div[1].'<strong>'.$item[1].'</strong> rezultă: <img src="/'.$item[2].'" alt="'.$item[1].'" /><br />';
if($go=='alerta'||$go=='mesaj')
echo'<a href="/trimite-'.$go.'/la/'.$la.'-'.seo(nume($la,1)).'/id/'.$item[0].'"><img src="'.$domenii_statice[1].'adauga.gif" alt="" />scrie-l</a>';
elseif($go=='scrie-mesaj-chat')
echo'<a href="/'.$go.'/camera/'.$cid.'/v/'.$fid.'/p/'.$tid.'/id/'.$item[0].'"><img src="'.$domenii_statice[1].'adauga.gif" alt="" />scrie-l</a>';
elseif($go=='scrie-mesaj-privat-chat')
echo'<a href="/'.$go.'/camera/'.$cid.'/v/'.$fid.'/p/'.$tid.'/la/'.$la.'-'.seo(nume($la,1)).'/id/'.$item[0].'"><img src="'.$domenii_statice[1].'adauga.gif" alt="" />scrie-l</a>';
elseif($de>0)
echo($conn->query('SELECT COUNT(*)FROM`imagini_zambareti_favoriti`WHERE`de`="'.$de.'"&&`pid`="'.$item[0].'"')->fetch_row()[0]==0?'<a href="/seteaza-zambaret-favorit/id/'.$item[0].'">seteaza ca favorit</a>':'<a href="/sterge-zambaret-favorit/id/'.$item[0].'"><img src="'.$domenii_statice[2].'sterge.png" alt="" width="16" height="16" />șterge favorit</a>');
if($perm>0)
echo'<strong> - </strong><a href="/admin-sterge-zambaret/id/'.$item[0].'"><img src="'.$domenii_statice[2].'sterge.png" alt="" width="16" height="16" /></a>';
echo$div[0];
}
require'f_paginare2.php';
}
else
echo$div[7].'Nu sunt zâmbareți adăugați!'.$div[0];
require'f_jos.php';