getTUserId(),$cfg['db']['lib']); $i = 0; $result['ticketlist'] = Array(); foreach($ticketlist as $ticket){ $result['ticketlist'][$i]['tId'] = $ticket->getTId(); $result['ticketlist'][$i]['timestamp'] = $ticket->getTimestamp(); $result['ticketlist'][$i]['title'] = $ticket->getTitle(); //get the status $statusId = $ticket->getStatus(); if ($statusId == 0){ $status = "Waiting on support.."; }else if($statusId == 1){ $status = "Being handled.."; }else if($statusId == 2){ $status = "Closed"; } $result['ticketlist'][$i]['statusText'] = $status; $result['ticketlist'][$i]['status'] = $statusId; //get the category $category = Ticket_Category::constr_TCategoryId($ticket->getTicket_Category(), $cfg['db']['lib']); $result['ticketlist'][$i]['category'] = $category->getName(); $i++; } return $result; }else{ //ERROR: No access! $_SESSION['error_code'] = "403"; header("Location: index.php?page=error"); exit; } }else{ //ERROR: not logged in! header("Location: index.php"); exit; } }