@extends('themes.default1.agent.layout.agent') @section('Tickets') class="active" @stop @section('ticket-bar') active @stop @section('inbox') class="active" @stop @section('content') role == 'agent') { $dept = App\Model\helpdesk\Agent\Department::where('name','=',Auth::user()->primary_dpt)->first(); $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('dept_id','=',$dept->id)->orderBy('id', 'DESC')->paginate(20); } else { $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->orderBy('id', 'DESC')->paginate(20); } ?>

{!! Lang::get('lang.inbox') !!}

{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}
@if(Session::has('success'))
Success {{Session::get('success')}}
@endif @if(Session::has('fails'))
Fail! {{Session::get('fails')}}
@endif
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}

{!! $tickets->count().'-'.$tickets->total(); !!}

@foreach ($tickets as $ticket) id)->first(); $string = strip_tags($title->title); if($title) if($title == null){ } else { ?> seen_by == null) {?> style="color:green;" > id)->get(); $collab = count($collaborators); // check atatchments $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first(); $attach = count($attachments); if (strlen($string) > 40) { $stringCut = substr($string, 0, 40); $string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...'; } $TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id'); $TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first(); $LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first(); if($LastResponse->role == "user") { $rep = "#F39C12"; $username = $LastResponse->user_name; } else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name; if($LastResponse->first_name==null || $LastResponse->last_name==null) { $username = $LastResponse->user_name; }} $titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get(); $count = count($titles); foreach($titles as $title) { $title = $title; } $assigned_to = App\User::where('id','=',$ticket->assigned_to)->first(); if($assigned_to == null) { $assigned = "Unassigned"; } else { $assigned = $assigned_to->first_name ." ". $assigned_to->last_name; } ?> priority_id)->first();?> user_id)->first(); ?> @if($from->role == "user") @else @endif @endforeach
{!! Lang::get('lang.subject') !!} {!! Lang::get('lang.ticket_id') !!} {!! Lang::get('lang.priority') !!} {!! Lang::get('lang.from') !!} {!! Lang::get('lang.last_replier') !!} {!! Lang::get('lang.assigned_to') !!} {!! Lang::get('lang.last_activity') !!}
{{$string}} ({!! $count!!}) @if($collab > 0) @endif @if($attach > 0) @endif #{!! $ticket->ticket_number !!} {{$priority->priority_desc}} {!! $from->user_name !!}{!! $from->first_name." ".$from->last_name !!}{!! $username !!} {!! $assigned !!} {!! UTC::usertimezone($title->updated_at) !!}
setPath(url('/ticket/inbox'))->render();?> 
{!! Form::close() !!}
@stop