<?php
require'fun.php';
require'f_conectare.php';
conectare('notificari','notificari');
$titlu='Notificări';
require'f_tabelare.php';
require'f_sus.php';
if($go=='sterge'&&$de>0)
{
if(!isset($_GET['xxx'])&&!isset($_POST['xxx']))
echo$div[4].'<img src="'.$domenii_statice[2].'actiune_delete.png" alt="" width="16" height="16" />Eroare!'.$div[5].$div[7].'Nu ai ales nici o notificare!';
else
{
$xxx=(isset($_GET['xxx'])?$_GET['xxx']:$_POST['xxx']);
$notificari_sterse=0;
foreach($xxx AS$chey=>$desters)
{
$conn->query('DELETE FROM`notificari`WHERE`id`="'.$desters.'"&&`la`="'.$de.'"');
$notificari_sterse++;
}
if($notificari_sterse>0)
echo$div[4].'<img src="'.$domenii_statice[1].'actiune_check.png" alt="" width="16" height="16" />Succes!'.$div[5].$div[6].$notificari_sterse.' notificar'.($notificari_sterse==1?'e ștearsă':'i șterse').' cu succes!';
else
echo$div[4].'<img src="'.$domenii_statice[2].'actiune_delete.png" alt="" width="16" height="16" />Eroare!'.$div[5].$div[7].'Nu poți șterge notificari trimise!';
}
echo$div[0];
}
echo$div[4].img('notificari.gif',1).'Notificări'.$div[5];
if($conn->query('SELECT COUNT(*)FROM`membrii_pedepsiti`WHERE`de`="'.$de.'"&&`penalty`="0"')->fetch_row()[0]>0)
{
$sex_de=($conn->query('SELECT`sex`FROM`membrii`WHERE`id`="'.$de.'"')->fetch_row()[0]=='F'?'ă':'');
echo$div[7].'Esti pus'.$sex_de.' pe mut!'.$div[0];
$banto=$conn->query('SELECT`data`,`pnreas`,`exid`FROM`membrii_pedepsiti`WHERE`de`="'.$de.'"&&`penalty`="0"ORDER BY`data`ASC LIMIT 1')->fetch_row();
require'f_ramas.php';
echo$div[1].'Timp ramas pana la debanare: <strong>'.ramas($banto[0]- $_SERVER['REQUEST_TIME']).'</strong><br />Ai fost pus'.$sex_de.' pe mut de: <strong>'.nume($banto[2]).'</strong><br />Motiv pedeapsa: <strong>'.htmlspecialchars($banto[1]).'</strong>'.$div[0];
}
if($go=='trimise')
{
$x3='`de`';
$x4='`la`';
}
else
{
$x2='';
$x3='`la`';
$x4='`de`';
}
$elemente=$conn->query('SELECT COUNT(*)FROM`notificari`WHERE'.$x3.'="'.$de.'"')->fetch_row()[0];
if($elemente>0)
{
require'f_simbol.php';
require'f_filtru_bb.php';
require'f_paginare1.php';
$form[0]='/notificari/tip/sterge" method="post';
$form[1]=1;
$form[2]='<table'.$clasa_tabel.'>';
$items=$conn->query('SELECT`id`,`citit`,'.$x4.',`text`FROM`notificari`WHERE'.$x3.'="'.$de.'"ORDER BY`data`DESC LIMIT '.$limit_start.','.$pe_pagina);
while($item=$items->fetch_row())
{
$form[2].='<tr><td'.$clasa_kk.'>'.$clasa_n.($item[1]==0?'<img src="'.$domenii_statice[1].'npm.gif" alt="" />':'<img src="'.$domenii_statice[1].'opm.gif" alt="" />').'<input type="checkbox" name="xxx[]" value="'.$item[0].'" />'.$div[0].'<a href="/notificare/id/'.$item[0].'">'.avatar($item[2]).'</a></td><td'.$clasa_k.'>'.$clasa_n.'<a href="/notificare/id/'.$item[0].'">'.simbol($item[2]).nume($item[2]).'</a>'.$div[0];
if($item[1]>0)
$form[2].=$clasa_normal.htmlspecialchars(mb_substr(filtru_bb($item[3]),0,33)).'...'.$div[0];
$form[2].='</td></tr>';
}
$form[2].='</table><br />';
$form[3]='xxx';
$form[4]='Șterge';
$form[5]=1;
require'f_form.php';
require'f_paginare2.php';
}
else
echo$div[7].'Nu ai notificari primite!'.$div[0];
echo$div[1].'<a href="/sterge-notificari"><img src="'.$domenii_statice[2].'sterge.png" alt="" width="16" height="16" />Șterge notificari</a>'.$div[0].$div[1].'<a href="/notificari/tip/trimise">'.img('notificari.gif',1).'Notificări trimise</a>'.$div[0];
require'f_jos.php';