Example #1
0
<?php

$date = Date('d-m-Y');
$format = 'Y-m-d';
$day1 = Date($format, strtotime('-1 day' . $date));
$depts = App\Model\helpdesk\Agent\Department::all();
foreach ($depts as $dept) {
    // echo $dept->name;
    $created = DB::table('tickets')->select('created_at')->where('dept_id', '=', $dept->id)->where('team_id', '=', $team_id)->where('created_at', 'LIKE', '%' . $day1 . '%')->count();
    $closed = DB::table('tickets')->where('dept_id', '=', $dept->id)->where('team_id', '=', $team_id)->where('closed_at', 'LIKE', '%' . $day1 . '%')->count();
    $inprogress = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $dept->id)->where('team_id', '=', $team_id)->where('status', '=', 1)->count();
    $overdues = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $dept->id)->where('team_id', '=', $team_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 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Example #2
0
@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">&times;</button>
if ($use->role == 'admin') {
    echo '<td><button class="btn btn-success btn-xs">Admin</button></td>';
} elseif ($use->role == 'agent') {
    echo '<td><button class="btn btn-primary btn-xs">Agent</button></td>';
}
?>
							<td>
								@if($use->active=='1')
								<span style="color:green">{{'Active'}}</span>
								@else
								<span style="color:red">{{'Inactive'}}</span>
								@endif

								<?php 
$group = App\Model\helpdesk\Agent\Groups::whereId($use->assign_group)->first();
$department = App\Model\helpdesk\Agent\Department::whereId($use->primary_dpt)->first();
?>

							<td>{{ $group->name }}</td>
							<td>{{ $department->name }}</td>
							<td>{{ UTC::usertimezone($use->created_at) }}</td>
							{{-- <td>{{$use->Lastlogin_at}}</td> --}}
							<td>
							{!! Form::open(['route'=>['agents.destroy', $use->id],'method'=>'DELETE']) !!}
							<a href="{{route('agents.edit', $use->id)}}" class="btn btn-info btn-xs btn-flat"><i class="fa fa-edit" style="color:black;"> </i> {!! Lang::get('lang.edit') !!} </a>
								<!-- To pop up a confirm Message -->
									{{-- {!! Form::button(' <i class="fa fa-trash" style="color:black;"> </i> '  . Lang::get('lang.delete') ,['type' => 'submit', 'class'=> 'btn btn-warning btn-xs btn-flat','onclick'=>'return confirm("Are you sure?")']) !!} --}}
							{!! Form::close() !!}
							</td>
						</tr>
						@endif
@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">&times;</button>
<?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>
Example #6
0
		<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?")'])
				!!}
							<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 -->