|
|
@ -4,7 +4,7 @@ function show_user(){
|
|
|
|
//if logged in
|
|
|
|
//if logged in
|
|
|
|
if(WebUsers::isLoggedIn()){
|
|
|
|
if(WebUsers::isLoggedIn()){
|
|
|
|
|
|
|
|
|
|
|
|
if(WebUsers::isAdmin()){
|
|
|
|
if( !isset($_GET['id']) || WebUsers::isAdmin() || $_GET['id'] == $_SESSION['id'] ){
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($_GET['id'])){
|
|
|
|
if(isset($_GET['id'])){
|
|
|
|
$result['target_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
|
|
|
|
$result['target_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
|
|
|
@ -19,6 +19,34 @@ function show_user(){
|
|
|
|
$result['country'] = $info['Country'];
|
|
|
|
$result['country'] = $info['Country'];
|
|
|
|
$result['gender'] = $info['Gender'];
|
|
|
|
$result['gender'] = $info['Gender'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $cfg;
|
|
|
|
|
|
|
|
$ticket_user = Ticket_User::constr_ExternId($result['target_id'],$cfg['db']['lib']);
|
|
|
|
|
|
|
|
$ticketlist = Ticket::getTicketsOf($ticket_user->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;
|
|
|
|
return $result;
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|