<?php

	if(in_array($_SESSION['my_id'], $admins))
	{
	    $id = fnAdjustID();
	    if($id > 0)
	    {
            $query = "SELECT ID, file FROM mobile_pozadia WHERE ID=$id limit 0, 1";
            $result = $dba->GetResult($query);
            $row = mysql_fetch_array($result);
            $path = ($row["ID"]>4922) ? 'pozadia2/' : 'pozadia/';
            unlink($path.$row['file']);
            $query = "DELETE FROM mobile_pozadia WHERE ID='$id' limit 1";
            $dba->ExecuteQuery($query);
	    }
	}
	header('location: '.$HTTP_REFERER);