<?php
session_start();
$currentBaseDir = dirname($_SERVER['PHP_SELF']);
include($_SESSION['basedir']."core.php");
$res = $dba->getSCCTicketDetails(-1, $_SESSION['ownerId'],$_SESSION['right'], -1, NULL, NULL);


$svaTool = new svaTool();

$data = "";

 $cmpt = 1;
					 $total = count($res) ;
					 for ($i = 0; $i < $total; $i++) {
						$data = $data.
						        '{
									"Item": "'.$res[$i]['item_id_n'].'",
									"Date": "'.$res[$i]['event_datetime_d'].'",
									"Caller": "'.$res[$i]['mobile1_phone_v'].'",
									"Agent": "'.$res[$i]['user_name_v'].'",
									"CustomerName": "'.$res[$i]['first_name_v']." ".$res[$i]['last_name_v'].'",
									"TicketNumber": "'.$res[$i]['ticket_number_v'].'",
                                    "Callreason": "'.$res[$i]['motif_name_v'].'",
									"Status": "'.$res[$i]['status_n'].'"
								 }
					         	';
						 
						 if($i+1 <  $total ) $data = $data.",";
						 
					 }
					 
			echo "[$data]";





?>