@extends('admin.layouts.app') @section('title', 'Dashboard') @section('content') @if(\Illuminate\Support\Facades\Auth::user()->role == 8)
{{ number_format($collectionParcelsToday) }}
Total Parcel Fee as @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ number_format($cMpesaLipaBookings) }}
Sale's By Lipa #
@elseif(\Illuminate\Support\Facades\Auth::user()->role < 5)
{{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- {{ number_format($collectionParcelsToday) }}
--}} {{--
--}} {{-- Parcel Collection--}} {{--
--}} {{--
--}} {{-- --}} {{-- --}} {{-- Total Parcel Fee as @php--}} {{-- $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam'));--}} {{-- $today = $localTime->format('d-M-Y');--}} {{-- echo $today;--}} {{-- @endphp--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}}
{{ number_format($cBuses) }}
{{$busAvg}}% on road today @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ number_format($cRoutes) }}
{{ $cAgents }}
{{ number_format($cPassengers) }}
{{ number_format($cOnlineBookings) }}
Online Tickets Boarded Today @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ number_format((isset($customercare_tickets_count) ? $customercare_tickets_count : 0)) }}
Sale's By CC #
{{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- {{ $cTripsMoroDar }}--}} {{--
--}} {{--
--}} {{-- MORO-DAR TRIPS--}} {{--
--}} {{--
--}} {{-- @php--}} {{-- $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam'));--}} {{-- $today = $localTime->format('d-M-Y');--}} {{-- echo $today;--}} {{-- @endphp--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- {{ $cTripsDarMoro }}--}} {{--
--}} {{--
--}} {{-- DAR-MORO TRIPS--}} {{--
--}} {{--
--}} {{-- @php--}} {{-- $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam'));--}} {{-- $today = $localTime->format('d-M-Y');--}} {{-- echo $today;--}} {{-- @endphp--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- {{ $upcountryTrips }}
--}} {{--
--}} {{-- UPCOUNTRY TRIPS--}} {{--
--}} {{--
--}} {{-- --}} {{-- --}} {{-- @php--}} {{-- $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam'));--}} {{-- $today = $localTime->format('d-M-Y');--}} {{-- echo $today;--}} {{-- @endphp--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- {{ $cTotalTrips }}--}} {{--
--}} {{--
--}} {{-- TOTAL TRIPS--}} {{-- --}} {{-- --}} {{--
--}} {{--
--}} {{-- @php--}} {{-- $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam'));--}} {{-- $today = $localTime->format('d-M-Y');--}} {{-- echo $today;--}} {{-- @endphp--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- Dashboard contents--}}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp ONLINE TICKET SALES

@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $kifuaDate = $localTime->format('Y-m-d'); $today = $localTime->format('Y-m-d'); $bookings = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) // ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->where('booking_histories.status', '=', 4) ->where('booking_histories.fare', '>', 2000) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->count(); echo $bookings; @endphp Tickets @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $kifuaDate = $localTime->format('Y-m-d'); $today = $localTime->format('Y-m-d'); $Sales = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->where('booking_histories.status', '=', 4) ->where('booking_histories.fare', '>', 2000) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->sum('booking_histories.fare'); echo number_format($Sales); @endphp TZs

@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp CC TICKET SALES

@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $kifuaDate = $localTime->format('Y-m-d'); $today = $localTime->format('Y-m-d'); $bookings = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) // ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->whereIn('booking_histories.agent_id', [419,421]) ->where('booking_histories.fare', '>', 2000) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->count(); echo $bookings; @endphp Tickets @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $kifuaDate = $localTime->format('Y-m-d'); $today = $localTime->format('Y-m-d'); $Sales = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) ->where('booking_histories.booking_date', $today) ->whereIn('booking_histories.agent_id', [419,421]) ->where('booking_histories.fare', '>', 2000) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->sum('booking_histories.fare'); echo number_format($Sales); @endphp TZs

{{-- Accountant Dashbaord--}} @elseif(\Illuminate\Support\Facades\Auth::user()->role == 10)
{{ $cTripsMoroDar }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ $cTripsDarMoro }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ $upcountryTrips }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{-- {{ $cTotalTrips }}--}} @php $total = number_format($upcountryTrips + $cTripsDarMoro + $cTripsMoroDar); echo $total; @endphp
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{-- Management Dashboard--}} @elseif(\Illuminate\Support\Facades\Auth::user()->role == 9)
{{ $cTripsMoroDar }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ $cTripsDarMoro }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ $upcountryTrips }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ $cTotalTrips }}
@php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
@elseif(\Illuminate\Support\Facades\Auth::user()->role == 11)
{{ number_format($cBuses) }}
{{$busAvg}}% on road today @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $today = $localTime->format('d-M-Y'); echo $today; @endphp
{{ number_format($cRoutes) }}
{{ $cAgents }}
{{ number_format($cPassengers) }}
{{-- Dashboard contents--}}
@endif @endsection