$sql = "
SELECT
t.ticketid,
t.subject,
t.description,
t.creator,
t.created,
t.updated,
t.status,
t.priority,
t.server,
(SELECT username FROM ".$this->prefix('users')." WHERE id=t.creator) AS owner
FROM ".$this->prefix('tickets')." AS t
".(!$this->isAllowed(ADMIN) ? ', '.$this->prefix('users').' AS u WHERE u.parent='.$_SESSION['user_id'].' AND t.creator = u.id ' : ' ')."
ORDER BY ticketid DESC
";
Am introdus asta si a functionat dar vreau sa se afiseze si ticketele facute de $_SESSION['user_id'];
$sql = "
SELECT
t.ticketid,
t.subject,
t.description,
t.creator,
t.created,
t.updated,
t.status,
t.priority,
t.server,
(SELECT username FROM ".$this->prefix('users')." WHERE id=t.creator) AS owner
FROM ".$this->prefix('tickets')." AS t
".(!$this->isAllowed(ADMIN) ? ', '.$this->prefix('users').' AS u WHERE t.creator='.$_SESSION['user_id'].' OR u.parent='.$_SESSION['user_id'].' AND t.creator = u.id ' : ' ')."
ORDER BY ticketid DESC
";
Am incercat asta dar ticketele facute de $_SESSION['user_id']; sunt afisate de 4 ori