Viewing file: dashboard.blade.php (22 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.admin')
@section('page-title') {{__('Driver Dashboard')}} @endsection
@section('action-button')
<div class="bg-neutral rounded-pill d-inline-block"> <div class="input-group input-group-sm input-group-merge input-group-flush"> <div class="input-group-prepend"> <span class="input-group-text bg-transparent"><i class="ti ti-search"></i></span> </div> <input type="text" id="keyword" class="form-control form-control-flush" placeholder="{{__('Search by Name or skill')}}"> </div> </div>
@endsection
@push('theme-script') @if(Auth::user()->type != 'admin') <script src="{{ asset('assets/libs/dragula/dist/dragula.min.js') }}"></script> <script src="{{ asset('assets/libs/apexcharts/dist/apexcharts.min.js') }}"></script> @endif @endpush
@section('content') @if(Auth::user()->type == 'admin') <div class="row" id="dashboard_view"></div> @else <div class="row"> <div class="col-xl-6 col-md-6"> <div class="card card-stats"> <div class="card-body"> <div class="row"> <div class="col"> @php $auth = Auth::user(); @endphp <h6 class="text-muted mb-1">Hello <span class="text-primary">{{isset($auth->name)?$auth->name:''}}</span></h6> <br> <h4 class="text-muted mb-1">{{__('Welcome To Your Dashboard')}}</h4> <span class="h6 font-weight-bold mb-0 ">Date : {{now()->format('Y-m-d')}}</span> <br> </div> </div> </div> </div> </div> <div class="col-xl-6 col-md-6"> <div class="card card-stats"> <div class="card-body"> <div class="row"> <div class="col"> <h6 class="text-muted mb-1">{{__('Total Completed Order')}}</h6> <span class="h3 font-weight-bold mb-0 ">{{isset($total_completed_orders)?$total_completed_orders:'0'}}</span> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-xl-12 col-md-12"> <div class="card card-fluid"> <div class="card-header"> <h6 class="mb-0">{{__('Latest Pending Orders')}}</h6> </div> <div class="card-body table-border-style"> <div class="table-responsive"> <table class="table datatable"> <thead> <tr> <th>{{__('Customer Profile')}}</th> <th>{{__('Destination')}}</th> <th>{{__('Total Km')}}</th> <th>{{__('Kilometer Price')}}</th> <th>{{__('Total Cost')}}</th> <th>{{__('Status')}}</th> </tr> </thead> <tbody> @if ($texiorders->isNotEmpty()) @foreach ($texiorders as $taxiOrder) <tr class="font-style"> <td> <div class="customer-profile-sec"> <div class="customer-name-sec"> <strong>{{__('Customer Name')}} :</strong> {{isset($taxiOrder->order_request->name)?$taxiOrder->order_request->name:''}} </div> <div class="customer-phone-sec"> <strong>{{__('Customer Phone')}} :</strong> {{isset($taxiOrder->order_request->phone_number)?$taxiOrder->order_request->phone_number:''}} </div> <div class="customer-email-sec"> <strong>{{__('Customer Email')}} :</strong> {{isset($taxiOrder->order_request->email)?$taxiOrder->order_request->email:''}} </div> </div> </td> <td> <div class="destination-sec"> <div class="pick-up-address"> <strong>{{__('From')}} :</strong> {{isset($taxiOrder->order_request->pickup_address)?$taxiOrder->order_request->pickup_address:''}} </div> <div class="destination-address"> <strong>{{__('To')}} :</strong> {{isset($taxiOrder->order_request->destination_address)?$taxiOrder->order_request->destination_address:''}} </div> </div> </td> <td>{{isset($taxiOrder->order_request->total_km)?$taxiOrder->order_request->total_km:''}}</td> <td>{{isset($taxiOrder->order_request->kilometer_price)?$taxiOrder->order_request->kilometer_price:''}}</td> <td>{{isset($taxiOrder->order_request->total_cost)?$taxiOrder->order_request->total_cost:''}}</td> <td> <div class="driver-status-section"> @if (isset($taxiOrder->status) && $taxiOrder->status) @if($taxiOrder->status=='accepted') <span class="badge badge-success">{{ucfirst($taxiOrder->status)}}</span> @else <span class="badge badge-danger">{{ucfirst($taxiOrder->status)}}</span> @endif @endif </div> </td> </tr> @endforeach @endif </tbody> </table> </div> </div> </div> </div> </div> <div class="row d-none"> <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4"> <div class="card card-fluid"> <div class="card-header"> <h6 class="mb-0">{{__('Project Status')}}</h6> </div> {{-- <div class="card-body"> @foreach($home_data['project_status'] as $status => $val) <div class="row align-items-center mb-4"> <div class="col-auto"> <div class="progress-circle progress-sm" data-progress="{{$val['percentage']}}" data-color="{{ \App\Models\Project::$status_color[$status] }}"></div> </div> <div class="col"> <span class="d-block h6 mb-0">{{__(\App\Models\Project::$project_status[$status])}}</span> </div> </div> @endforeach <div class="d-flex my-1 text-center"> @foreach($home_data['project_status'] as $status => $val) <div class="col"> <span class="badge badge-dot badge-lg h6"> <i class="bg-{{ \App\Models\Project::$status_color[$status] }}"></i>{{ $val['total'] }} </span> </div> @endforeach </div> </div> --}} </div> </div> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-8"> <div class="card"> <div class="card-header"> <div class="d-flex justify-content-between align-items-center"> <div> <h6 class="mb-0">{{__('Top Due Projects')}}</h6> </div> </div> </div> <div class="scrollbar-inner"> <div class="min-h-430 mh-430"> {{-- <div class="list-group list-group-flush"> @if($home_data['due_project']->count() > 0) @foreach($home_data['due_project'] as $due_project) <a href="{{ route('projects.show',$due_project) }}" class="list-group-item list-group-item-action"> <div class="d-flex align-items-center justify-content-between"> <div> <img {{ $due_project->img_image }} class="avatar rounded-circle"/> </div> <div class="flex-fill pl-3 text-limit"> <div class="row"> <div class="col-9"> <h6 class="progress-text mb-1 text-sm d-block text-limit">{{ $due_project->name }}</h6> </div> <div class="col-3 text-end"> <span class="badge badge-xs badge-{{ (\Auth::user()->checkProject($due_project->id) == 'Owner') ? 'success' : 'warning' }}">{{ \Auth::user()->checkProject($due_project->id) }}</span> </div> </div> <div class="progress progress-xs mb-0"> <div class="progress-bar bg-{{ $due_project->project_progress()['color'] }}" role="progressbar" style="width: {{ $due_project->project_progress()['percentage'] }};" aria-valuenow="{{ $due_project->project_progress()['percentage'] }}" aria-valuemin="0" aria-valuemax="100"></div> </div> <div class="d-flex justify-content-between text-xs text-muted text-end mt-1"> <div> <span class="font-weight-bold text-{{ \App\Models\Project::$status_color[$due_project->status] }}">{{ \App\Models\Project::$project_status[$due_project->status] }}</span> </div> <div> {{ $due_project->countTask(Auth::user()->id) }} </div> </div> </div> </div> </a> @endforeach @else <div class="py-5"> <h6 class="text-center mb-0">{{__('No Due Projects Found.')}}</h6> </div> @endif </div> --}} </div> </div> </div> </div> </div> @endif @endsection
@push('script') @if(Auth::user()->type == 'admin') <script> $(document).ready(function () { ajaxFilterUserView(); // when searching by user name $(document).on('keyup', '#keyword', function () { ajaxFilterUserView($(this).val()); }); })
// For Filter function ajaxFilterUserView(keyword = '') { var mainEle = $('#dashboard_view'); $.ajax({ url: '{{ route('dashboard.view') }}', data: { keyword: keyword, }, success: function (data) { mainEle.html(data.html); } }); } </script> @else {{-- <script> /*To-Do Module*/ $(document).on('click', '#todo_submit', function () { var title = $("#form-todo input[name=title]").val(); if (title != '') { $.ajax({ url: $("#form-todo").data('action'), data: {title: title}, type: 'POST', success: function (data) { data = JSON.parse(data); show_toastr('{{__('Success')}}', '{{ __("Todo Added Successfully!")}}', 'success'); var html = '<div class="card border shadow-none todo-member mb-2">' + ' <div class="px-3 py-2 row align-items-center">' + ' <div class="col-10">' + ' <div class="custom-control custom-checkbox">' + ' <input type="checkbox" class="custom-control-input" id="check-item-' + data.id + '" data-url="' + data.updateUrl + '">' + ' <label class="custom-control-label h6 text-sm" for="check-item-' + data.id + '">' + data.title + '</label>' + ' </div>' + ' </div>' + ' <div class="col-auto card-meta d-inline-flex align-items-center ml-sm-auto">' + ' <a class="action-item d-todo" role="button" data-url="' + data.deleteUrl + '">' + ' <i class="ti ti-trash-alt text-danger"></i>' + ' </a>' + ' </div>' + ' </div>' + ' </div>';
$("#todolist").append(html); $("#form-todo input[name=name]").val(''); $("#form-todo").collapse('toggle'); }, error: function (data) { data = data.responseJSON; show_toastr('{{__('Error')}}', data.message, 'error'); } }); } else { show_toastr('{{__('Error')}}', '{{ __("Please write todo title!")}}', 'error'); } }); $(document).on("change", "#todolist input[type=checkbox]", function () { $.ajax({ url: $(this).attr('data-url'), type: 'POST', dataType: 'JSON', success: function (data) { show_toastr('{{__('Success')}}', '{{ __("Todo Updated Successfully!")}}', 'success'); }, error: function (data) { data = data.responseJSON; if (data.message) { show_toastr('{{__('Error')}}', data.message, 'error'); } else { show_toastr('{{__('Error')}}', '{{ __("Some Thing Is Wrong!")}}', 'error'); } } }); }); $(document).on('click', '.d-todo', function () { var btn = $(this); $.ajax({ url: $(this).attr('data-url'), type: 'DELETE', dataType: 'JSON', success: function (data) { show_toastr('{{__('Success')}}', '{{ __("Todo Deleted Successfully!")}}', 'success'); btn.closest('.todo-member').remove(); }, error: function (data) { data = data.responseJSON; if (data.message) { show_toastr('{{__('Error')}}', data.message, 'error'); } else { show_toastr('{{__('Error')}}', '{{ __("Some Thing Is Wrong!")}}', 'error'); } } }); });
/*Chart*/ var e = $("#task_overview"); var t = { chart: {width: "100%", zoom: {enabled: !1}, toolbar: {show: !1}, shadow: {enabled: !1}}, stroke: {width: 7, curve: "smooth"}, series: [{name: "Tasks ", data: {!! json_encode(array_values($home_data['task_overview'])) !!}}], xaxis: {labels: {style: {colors: SiteStyle.colors.gray[600], fontSize: "14px", fontFamily: SiteStyle.fonts.base, cssClass: "apexcharts-xaxis-label"}}, axisBorder: {show: !1}, axisTicks: {show: !0, borderType: "solid", color: SiteStyle.colors.gray[300], height: 6, offsetX: 0, offsetY: 0}, type: "category", categories: {!! json_encode(array_keys($home_data['task_overview'])) !!}}, yaxis: {labels: {style: {color: SiteStyle.colors.gray[600], fontSize: "12px", fontFamily: SiteStyle.fonts.base}}, axisBorder: {show: !1}, axisTicks: {show: !0, borderType: "solid", color: SiteStyle.colors.gray[300], height: 6, offsetX: 0, offsetY: 0}}, fill: {type: "solid"}, markers: {size: 4, opacity: .7, strokeColor: "#fff", strokeWidth: 3, hover: {size: 7}}, grid: {borderColor: SiteStyle.colors.gray[300], strokeDashArray: 5}, dataLabels: {enabled: !1} }, a = (e.data().dataset, e.data().labels, e.data().color), n = e.data().height, o = e.data().type; t.colors = [SiteStyle.colors.theme[a]], t.markers.colors = [SiteStyle.colors.theme[a]], t.chart.height = n || 350, t.chart.type = o || "line"; var i = new ApexCharts(e[0], t);
var e1 = $("#timesheet_logged"); var t1 = { chart: {width: "100%", type: "bar", zoom: {enabled: !1}, toolbar: {show: !1}, shadow: {enabled: !1}}, plotOptions: {bar: {horizontal: !1, columnWidth: "30%", endingShape: "rounded"}}, stroke: {show: !0, width: 2, colors: ["transparent"]}, series: [{name: "Timesheet hours ", data: {!! json_encode(array_values($home_data['timesheet_logged'])) !!}}], xaxis: {labels: {style: {colors: SiteStyle.colors.gray[600], fontSize: "14px", fontFamily: SiteStyle.fonts.base, cssClass: "apexcharts-xaxis-label"}}, axisBorder: {show: !1}, axisTicks: {show: !0, borderType: "solid", color: SiteStyle.colors.gray[300], height: 6, offsetX: 0, offsetY: 0}, type: "category", categories: {!! json_encode(array_keys($home_data['timesheet_logged'])) !!}}, yaxis: {labels: {style: {color: SiteStyle.colors.gray[600], fontSize: "12px", fontFamily: SiteStyle.fonts.base}}, axisBorder: {show: !1}, axisTicks: {show: !0, borderType: "solid", color: SiteStyle.colors.gray[300], height: 6, offsetX: 0, offsetY: 0}}, fill: {type: "solid"}, markers: {size: 4, opacity: .7, strokeColor: "#fff", strokeWidth: 3, hover: {size: 7}}, grid: {borderColor: SiteStyle.colors.gray[300], strokeDashArray: 5}, dataLabels: {enabled: !1} }, a1 = (e1.data().dataset, e1.data().labels, e1.data().color), n1 = e1.data().height; e1.data().type, t1.colors = [SiteStyle.colors.theme[a1]], t1.markers.colors = [SiteStyle.colors.theme[a1]], t1.chart.height = n1 || 350; var o1 = new ApexCharts(e1[0], t1);
setTimeout(function () { i.render() o1.render() }, 300); </script> --}} @endif @endpush
|