This commit is contained in:
sujitprasad
2015-09-30 20:59:51 +05:30
parent 6d6be899ed
commit 54ca06f192
3 changed files with 91 additions and 42 deletions

View File

@@ -55,7 +55,7 @@ class DashboardController extends Controller {
public function ChartData() public function ChartData()
{ {
$ticketlist = DB::table('tickets') $ticketlist = DB::table('tickets')
->select(DB::raw('MONTHNAME(updated_at) as month'), DB::raw("(closed) as monthNum"), ->select(DB::raw('MONTH(updated_at) as month'),
DB::raw('count(*) as tickets')) DB::raw('count(*) as tickets'))
->groupBy('month') ->groupBy('month')
->orderBy('month', 'desc') ->orderBy('month', 'desc')

View File

@@ -14,27 +14,27 @@ class="active"
@section('content') @section('content')
<div class="box box-info"> <div class="box box-info">
<?php <?php
// $tickets = App\Model\Ticket\Tickets::where('created_at','>=',date('Y-m-d'))->get(); // $tickets = App\Model\Ticket\Tickets::where('created_at','>=',date('Y-m-d'))->get();
// echo count($tickets); // echo count($tickets);
?> ?>
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">Line Chart</h3> <h3 class="box-title">Line Chart</h3>
<div class="box-tools pull-right"> <div class="box-tools pull-right">
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button> <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
<button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div> </div>
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="chart" > <div class="chart" >
<div id="legendDiv"></div> <div id="legendDiv"></div>
<canvas class="chart-data" id="tickets-graph" width="1000" height="400"></canvas> <canvas class="chart-data" id="tickets-graph" width="1000" height="400"></canvas>
</div> </div>
</div><!-- /.box-body --> </div><!-- /.box-body -->
</div><!-- /.box --> </div><!-- /.box -->
<hr/> <hr/>
@@ -45,24 +45,32 @@ class="active"
</div> </div>
<div class="box-body"> <div class="box-body">
<table class="table table-hover" style="overflow:hidden;"> <table class="table table-hover" style="overflow:hidden;">
<?php $tickets = App\Model\helpdesk\Ticket\Tickets::all(); ?>
<tr> <tr>
<th>Agent</th> <th>Department</th>
<th>Opened</th> <th>Opened</th>
<th>Resolved</th>
<th>Closed</th> <th>Closed</th>
<th>Assigned</th> <th>Deleted</th>
<th>Reopened</th>
<th>SLA</th>
</tr> </tr>
@foreach($tickets as $ticket)
<?php $departments = App\Model\helpdesk\Agent\Department::all(); ?>
@foreach($departments as $department)
<?php
$open = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',1)->count();
$resolve = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',2)->count();
$close = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',3)->count();
$delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',5)->count();
?>
<tr> <tr>
<td>Sujit Prasad</td> <td>{!! $department->name !!}</td>
<td>1</td> <td>{!! $open !!}</td>
<td>{!! $ticket->closed !!}</td> <td>{!! $resolve !!}</td>
<td>{!! $ticket->source !!}</td> <td>{!! $close !!}</td>
<td>{!! $ticket->reopened !!}</td> <td>{!! $delete !!}</td>
<td>{!! $ticket->sla !!}</td>
</tr> </tr>
@endforeach @endforeach
@@ -70,16 +78,55 @@ class="active"
</div> </div>
</div> </div>
<script src="{{asset("lb-faveo/plugins/chartjs/Chart.min.js")}}" type="text/javascript"></script> <script src="{{asset("lb-faveo/plugins/chartjs/Chart.min.js")}}" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$.getJSON("agen", function (result) { $.getJSON("agen", function (result) {
var labels = [],data=[],data2=[]; var labels = [],data=[],data2=[];
for (var i = 0; i < result.length; i++) { for (var i = 0; i < result.length; i++) {
labels.push(result[i].month);
$var12 = result[i].month;
if($var12 == 1){
$var13 = "January";
}
if($var12 == 2){
$var13 = "Febuary";
}
if($var12 == 3){
$var13 = "March";
}
if($var12 == 4){
$var13 = "April";
}
if($var12 == 5){
$var13 = "May";
}
if($var12 == 6){
$var13 = "June";
}
if($var12 == 7){
$var13 = "July";
}
if($var12 == 8){
$var13 = "August";
}
if($var12 == 9){
$var13 = "September";
}
if($var12 == 10){
$var13 = "October";
}
if($var12 == 11){
$var13 = "November";
}
if($var12 == 12){
$var13 = "December";
}
labels.push($var13);
data.push(result[i].tickets); data.push(result[i].tickets);
data2.push(result[i].monthNum); // data2.push(result[i].monthNum);
} }
var buyerData = { var buyerData = {
@@ -93,17 +140,18 @@ class="active"
pointStrokeColor : "#741F1F", pointStrokeColor : "#741F1F",
data : data data : data
}, }
{ //,
label : "Closed Tickets", // {
fillColor : "rgba(151,187,205,0.2)", // label : "Closed Tickets",
strokeColor : "rgba(151,187,205,1)", // fillColor : "rgba(151,187,205,0.2)",
pointColor : "rgba(151,187,205,1)", // strokeColor : "rgba(151,187,205,1)",
pointStrokeColor : "#fff", // pointColor : "rgba(151,187,205,1)",
pointHighlightFill : "#fff", // pointStrokeColor : "#fff",
pointHighlightStroke : "rgba(151,187,205,1)", // pointHighlightFill : "#fff",
data : data2 // pointHighlightStroke : "rgba(151,187,205,1)",
} // data : data2
// }
] ]
}; };
@@ -120,7 +168,7 @@ class="active"
//Boolean - Whether to show vertical lines (except Y axis) //Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines: true, scaleShowVerticalLines: true,
//Boolean - Whether the line is curved between points //Boolean - Whether the line is curved between points
bezierCurve: true, bezierCurve: false,
//Number - Tension of the bezier curve between points //Number - Tension of the bezier curve between points
bezierCurveTension: 0.3, bezierCurveTension: 0.3,
//Boolean - Whether to show a dot for each point //Boolean - Whether to show a dot for each point
@@ -156,6 +204,7 @@ class="active"
}); });
}); });
</script> </script>
@stop @stop

View File

@@ -17,7 +17,7 @@
<p>{!! Session::get('fails') !!}</p> <p>{!! Session::get('fails') !!}</p>
</div> </div>
@endif @endif
Item is covered by our standard licenses. If your end product including the item is going to be free to the end user then a Regular License is what you need. An Extended License is required if the end user must pay to use the end product.</p> PLEASE READ THIS SOFTWARE LICENSE AGREEMENT CAREFULLY BEFORE DOWNLOADING OR USING THE SOFTWARE. BY CLICKING ON THE "ACCEPT" BUTTON, OPENING THE PACKAGE, OR DOWNLOADING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, STOP THE INSTALLATION PROCESS AND EXIT.</p>
<!-- form-group --> <!-- form-group -->
<div class="form-group"> <div class="form-group">
<label><input type="checkbox" class="flat-red" id="accept" name="accept1"/> I accept the </label><a href="#" style="color:blue;" data-toggle="modal" data-target="#Edit"> Licence Agreement</a> <br> <label><input type="checkbox" class="flat-red" id="accept" name="accept1"/> I accept the </label><a href="#" style="color:blue;" data-toggle="modal" data-target="#Edit"> Licence Agreement</a> <br>