<?php
require'fun.php';
$titlu='Șterge chestionar';
$back[1]='<a href="/chestionare">'.img('vot.gif',2).'Chestionare</a>';
require'f_sus.php';
require'f_mut.php';
$pinfo=$conn->query('SELECT`de`,`intrebare`,`varianta1`,`varianta2`,`varianta3`,`varianta4`,`varianta5`FROM`chestionar_intrebari`WHERE`id`="'.$pid.'"')->fetch_row();
if($perm>0||$de==$pinfo[0])
{
require'f_sterg.php';
if(sterge_chestionar($pid))
{
$conn->query('INSERT INTO`jurnal_admini`SET`nume`="Administrare",`de`="'.$de.'",`text`="a șters chestionarul cu intrebarea:[br/]'.$pinfo[1].'[br/]Si raspunsurile:'.($pinfo[2]!=''?'[br/]1: '.$pinfo[2]:'').($pinfo[3]!=''?'[br/]2: '.$pinfo[3]:'').($pinfo[4]!=''?'[br/]3: '.$pinfo[4]:'').($pinfo[5]!=''?'[br/]4: '.$pinfo[5]:'').($pinfo[6]!=''?'[br/]5: '.$pinfo[6]:'').'[br/]Chestionar adăugat de",`la`="'.$pinfo[0].'",`data`="'.$_SERVER['REQUEST_TIME'].'"');
if($de!=$pinfo[0])
{
require'f_notificare.php';
notificare('am șters chestionarul tau cu intrebarea:[br/]'.$pinfo[1].'[br/]Si raspunsurile:'.($pinfo[2]!=''?'[br/]1: '.$pinfo[2]:'').($pinfo[3]!=''?'[br/]2: '.$pinfo[3]:'').($pinfo[4]!=''?'[br/]3: '.$pinfo[4]:'').($pinfo[5]!=''?'[br/]4: '.$pinfo[5]:'').($pinfo[6]!=''?'[br/]5: '.$pinfo[6]:''),$pinfo[0],$de);
}
echo$div[4].'<img src="'.$domenii_statice[1].'actiune_check.png" alt="" width="16" height="16" />Succes!'.$div[5].$div[6].'Chestionar șters!';
}
else
echo$div[4].'<img src="'.$domenii_statice[2].'actiune_delete.png" alt="" width="16" height="16" />Eroare!'.$div[5].$div[7];
}
else
echo$div[4].'<img src="'.$domenii_statice[2].'actiune_delete.png" alt="" width="16" height="16" />Eroare!'.$div[5].$div[7].'Acest chestionar nu este al tau, sau nu ai permisiunile necesare pentru a-l șterge!';
echo$div[0];
require'f_jos.php';