@section('Tickets') class="active" @stop @section('ticket-bar') active @stop @section('overdue') class="active" @stop @section('content') <?php if (Auth::user()->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); } ?> <!-- Main content --> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title">Overdue </h3> <small>{!! $tickets->total() !!} tickets</small> </div><!-- /.box-header --> @if(Session::has('success')) <div class="alert alert-success alert-dismissable"> <i class="fa fa-check-circle"> </i> <b> Success </b> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
@section('Tickets') class="active" @stop @section('ticket-bar') active @stop @section('inbox') class="active" @stop @section('content') <?php $dept = App\Model\helpdesk\Agent\Department::where('name', '=', $id)->first(); if (Auth::user()->role == 'agent') { $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', '2')->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20); } else { $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', '2')->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20); } ?> <!-- Main content --> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title">Inbox </h3> <small>{!! $tickets->total() !!} tickets</small> </div><!-- /.box-header --> @if(Session::has('success')) <div class="alert alert-success alert-dismissable"> <i class="fa fa-check-circle"> </i> <b> Success </b> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<td> @if($topic->type=='1') <span style="color:green">Public</span> @else <span style="color:red">Private</span> @endif </td> <!-- Priority --> <?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $topic->priority)->first(); ?> <td>{!! $priority->priority_desc !!}</td> <!-- Department --> <?php $dept = App\Model\helpdesk\Agent\Department::where('id', '=', $topic->department)->first(); ?> <td>{!! $dept->name !!}</td> <!-- Last Updated --> <td> {!! UTC::usertimezone($topic->updated_at) !!} </td> <!-- Deleting Fields --> <td> {!! Form::open(['route'=>['helptopic.destroy', $topic->id],'method'=>'DELETE']) !!} <a href="{{route('helptopic.edit',$topic->id)}}" class="btn btn-info btn-xs btn-flat"><i class="fa fa-trash" style="color:black;"> </i> Edit</a> <!-- To pop up a confirm Message --> {!! Form::button('<i class="fa fa-trash" style="color:black;"> </i> Delete', ['type' => 'submit', 'class'=> 'btn btn-warning btn-xs btn-flat', 'onclick'=>'return confirm("Are you sure?")']) !!}
<?php $date = Date('d-m-Y'); $format = 'Y-m-d'; $day1 = Date($format, strtotime('-1 day' . $date)); $user = App\User::where('id', '=', $user_id)->first(); $dept = App\Model\helpdesk\Agent\Department::where('id', '=', $user->primary_dpt)->first(); $created = DB::table('tickets')->select('created_at')->where('dept_id', '=', $dept->id)->where('created_at', 'LIKE', '%' . $day1 . '%')->count(); $closed = DB::table('tickets')->where('dept_id', '=', $dept->id)->where('closed_at', 'LIKE', '%' . $day1 . '%')->count(); $inprogress = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $dept->id)->where('status', '=', 1)->count(); $overdues = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $dept->id)->where('status', '=', 1)->get(); $i = 0; foreach ($overdues as $overdue) { $sla_plan = App\Model\helpdesk\Manage\Sla_plan::where('id', '=', $overdue->sla)->first(); $ovdate = $overdue->created_at; $new_date = date_add($ovdate, date_interval_create_from_date_string($sla_plan->grace_period)) . '<br/><br/>'; if (date('Y-m-d H:i:s') > $new_date) { $i++; } } // echo "created=".$created."<br/>"; // echo "closed=".$closed."<br/>"; // echo "inprogress=".$inprogress."<br/>"; // echo "overdue=".$i."<br/>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SmoothDeal</title>
<th width="100px">{{Lang::get('lang.priority')}}</th> <th width="100px">{{Lang::get('lang.department')}}</th> <th width="100px">{{Lang::get('lang.created')}}</th> <th width="100px">{{Lang::get('lang.last_updated')}}</th> <th width="100px">{{Lang::get('lang.action')}}</th> </tr> @foreach($emails as $email) <tr> <td><a href="{{route('emails.edit', $email->id)}}"> {{$email -> email_address }}</a></td> <?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $email->priority)->first(); ?> <td>{{ ucfirst($priority->priority_desc) }}</td> @if($email->department !== null) <?php $department = App\Model\helpdesk\Agent\Department::where('id', '=', $email->department)->first(); $dept = $department->name; ?> @elseif($email->department == null) <?php $dept = ""; ?> @endif <td>{{ $dept }}</td> <td>{{ UTC::usertimezone($email->created_at) }}</td> <td>{{ UTC::usertimezone($email->updated_at) }}</td> <td> {!! Form::open(['route'=>['emails.destroy', $email->id],'method'=>'DELETE']) !!} <a href="{{route('emails.edit', $email->id)}}" class="btn btn-info btn-xs btn-flat"><i class="fa fa-edit" style="color:black;"> </i> Edit</a> <!-- To pop up a confirm Message -->