@extends('layouts.main') @section('title') {{ pageTitle(['Live Score']) }} @endsection @section('content')
@php $recents = recentMatches(); $upcoming_count = 0; $recent_count = 0; @endphp @foreach($recents as $recent) @if($recent->type == "recent" && $recent_count <= 3) @php $allmatchs = json_decode($recent->data);++$recent_count; @endphp @if($allmatchs->matchInfo->matchFormat == 'T20') @php $overs = 20; @endphp @elseif($allmatchs->matchInfo->matchFormat == 'ODI') @php $overs = 50; @endphp @else @php $overs = 10; @endphp @endif @php $date1 = \Carbon\Carbon::parse(date("Y-m-d H:i", $allmatchs->matchInfo->startDate/1000)); $date2 = \Carbon\Carbon::now()->format('Y-m-d H:i'); $date2 = \Carbon\Carbon::parse($date2); $result = $date2->gt($date1); @endphp

{{ date("d/m/y", $allmatchs->matchInfo->startDate/1000) }} {{ date("h:i A", $allmatchs->matchInfo->startDate/1000) }}

{{ $allmatchs->matchInfo->matchFormat ? $allmatchs->matchInfo->matchFormat : '' }} - {{ $allmatchs->matchInfo->matchDesc ? $allmatchs->matchInfo->matchDesc : '' }}, {{ $allmatchs->matchInfo->venueInfo->city ? $allmatchs->matchInfo->venueInfo->city : '' }}

{{ $recent->type == "recent" ? "Result" : "UPCOMING" }}

{{ $allmatchs->matchInfo->team1->teamSName }}

@if($recent->type == "recent") {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team1Score->inngs1->runs) ? $allmatchs->matchScore->team1Score->inngs1->runs : 0 }}/{{ $recent->type == "recent" && !empty($allmatchs->matchScore->team1Score->inngs1->wickets) ? $allmatchs->matchScore->team1Score->inngs1->wickets : 0 }} @endif

@if($recent->type == "recent") ( {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team1Score->inngs1->overs) ? $allmatchs->matchScore->team1Score->inngs1->overs : 0 }} / {{ $overs }} Over) @endif

{{ $allmatchs->matchInfo->team2->teamSName }}

@if($recent->type == "recent") {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team2Score->inngs1->runs) ? $allmatchs->matchScore->team2Score->inngs1->runs : 0 }}/{{ $recent->type == "recent" && !empty($allmatchs->matchScore->team2Score->inngs1->wickets) ? $allmatchs->matchScore->team2Score->inngs1->wickets : 0 }}

@endif

@if($recent->type == "recent") ( {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team2Score->inngs1->overs) ? $allmatchs->matchScore->team2Score->inngs1->overs : 0 }} / {{ $overs }} Over)

@endif
@if($recent->type == "recent")

{{ $allmatchs->matchInfo->status ? $allmatchs->matchInfo->status : '' }}

@else

{{ date_format(date_create(date("Y-m-d", $allmatchs->matchInfo->startDate/1000)),"l, F d") }}, {{ date("h:i A", $allmatchs->matchInfo->startDate/1000) }}

@endif
@endif @if($recent->type == "upcoming" && $upcoming_count <= 5) @php $allmatchs = json_decode($recent->data);++$upcoming_count; @endphp @if($allmatchs->matchInfo->matchFormat == 'T20') @php $overs = 20; @endphp @elseif($allmatchs->matchInfo->matchFormat == 'ODI') @php $overs = 50; @endphp @else @php $overs = 10; @endphp @endif @php $date1 = \Carbon\Carbon::parse(date("Y-m-d H:i", $allmatchs->matchInfo->startDate/1000)); $date2 = \Carbon\Carbon::now()->format('Y-m-d H:i'); $date2 = \Carbon\Carbon::parse($date2); $result = $date2->gt($date1); @endphp

{{ date("d/m/y") == date("d/m/y", $allmatchs->matchInfo->startDate/1000) ? 'Today' : '' }} {{ date("h:i A", $allmatchs->matchInfo->startDate/1000) }}

{{ $allmatchs->matchInfo->matchFormat ? $allmatchs->matchInfo->matchFormat : '' }} - {{ $allmatchs->matchInfo->matchDesc ? $allmatchs->matchInfo->matchDesc : '' }}, {{ $allmatchs->matchInfo->venueInfo->city ? $allmatchs->matchInfo->venueInfo->city : '' }}

{{ $recent->type == "recent" ? "Result" : "UPCOMING" }}

{{ $allmatchs->matchInfo->team1->teamSName }}

@if($recent->type == "recent") {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team1Score->inngs1->runs) ? $allmatchs->matchScore->team1Score->inngs1->runs : 0 }}/{{ $recent->type == "recent" && !empty($allmatchs->matchScore->team1Score->inngs1->wickets) ? $allmatchs->matchScore->team1Score->inngs1->wickets : 0 }} @endif

@if($recent->type == "recent") ( {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team1Score->inngs1->overs) ? $allmatchs->matchScore->team1Score->inngs1->overs : 0 }} / {{ $overs }} Over) @endif

{{ $allmatchs->matchInfo->team2->teamSName }}

@if($recent->type == "recent") {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team2Score->inngs1->runs) ? $allmatchs->matchScore->team2Score->inngs1->runs : 0 }}/{{ $recent->type == "recent" && !empty($allmatchs->matchScore->team2Score->inngs1->wickets) ? $allmatchs->matchScore->team2Score->inngs1->wickets : 0 }}

@endif

@if($recent->type == "recent") ( {{ $recent->type == "recent" && !empty($allmatchs->matchScore->team2Score->inngs1->overs) ? $allmatchs->matchScore->team2Score->inngs1->overs : 0 }} / {{ $overs }} Over)

@endif
@if($recent->type == "recent")

{{ $allmatchs->matchInfo->status ? $allmatchs->matchInfo->status : '' }}

@else

{{ date_format(date_create(date("Y-m-d", $allmatchs->matchInfo->startDate/1000)),"l, F d") }}, {{ date("h:i A", $allmatchs->matchInfo->startDate/1000) }}

@endif
@endif @endforeach
@endsection @section('page-specific-scripts') @endsection