starttime popup

This commit is contained in:
salam committed 2026-02-25 16:27:18 +01:00
1 parent 012747f149
commit 5a44fc18b3
8 files changed
+90 -31

No files matched your search

@@ -143,11 +143,11 @@ class FindFixture
*************************************************/ *************************************************/
if (isset($event['home_id']) && isset($event['away_id']) && isset($event['group_id'])) { if (isset($event['home_id']) && isset($event['away_id']) && isset($event['group_id'])) {
$startime = $event['starttime']; $starttime = $event['starttime'];
$from = Carbon::createFromDate($startime)->subDay(); $from = Carbon::createFromDate($starttime)->subDay();
$to = Carbon::createFromDate($startime)->addDay(); $to = Carbon::createFromDate($starttime)->addDay();
$home_id = FindFixture::$elements[$event['home_id']] ?? 0; $home_id = FindFixture::$elements[$event['home_id']] ?? 0;
+1 -1
View File
@@ -77,7 +77,7 @@ class Logifuture
'event_id' => $event['id'], 'event_id' => $event['id'],
'sport_id' => $sport_id, 'sport_id' => $sport_id,
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]); ], ['in_feed' => 1, 'bmoid' => $event['id'], 'starttime' => $event['starttime']]);
}, 5); }, 5);
switch ($sport_id) { switch ($sport_id) {
@@ -82,7 +82,7 @@ class NotifyAlarms
$tablecontent = [ $tablecontent = [
['key' => 'League', 'value' => $event->competition_group->name], ['key' => 'League', 'value' => $event->competition_group->name],
['key' => 'Event', 'value' => $event->home->name.' vs '.$event->away->name], ['key' => 'Event', 'value' => $event->home->name.' vs '.$event->away->name],
['key' => 'Startime', 'value' => $event->starttime], ['key' => 'Starttime', 'value' => $event->starttime],
['key' => 'Bookmaker', 'value' => $bookmaker->name], ['key' => 'Bookmaker', 'value' => $bookmaker->name],
['key' => 'Bettype', 'value' => $bet['bettype']], ['key' => 'Bettype', 'value' => $bet['bettype']],
['key' => 'Odd Name', 'value' => $bet['name']], ['key' => 'Odd Name', 'value' => $bet['name']],
@@ -128,7 +128,7 @@ class NotifyAlarms
$message = '<a href="/events?search='.$event_id.'"><div class="grid grid-cols-2 gap-1">'; $message = '<a href="/events?search='.$event_id.'"><div class="grid grid-cols-2 gap-1">';
$message .= '<div>League</div><div>'.$event->competition_group->name.'</div>'; $message .= '<div>League</div><div>'.$event->competition_group->name.'</div>';
$message .= '<div>Event</div><div>'.$event->home->name.' vs '.$event->away->name.'</div>'; $message .= '<div>Event</div><div>'.$event->home->name.' vs '.$event->away->name.'</div>';
$message .= '<div>Startime</div><div>'.$event->starttime.'</div>'; $message .= '<div>Starttime</div><div>'.$event->starttime.'</div>';
$message .= '<div>Bookmaker</div><div>'.$bookmaker->name.'</div>'; $message .= '<div>Bookmaker</div><div>'.$bookmaker->name.'</div>';
$message .= '<div>Bettype</div><div>'.$bet['bettype'].'</div>'; $message .= '<div>Bettype</div><div>'.$bet['bettype'].'</div>';
$message .= '<div>Odd Name</div><div>'.$bet['name'].'</div>'; $message .= '<div>Odd Name</div><div>'.$bet['name'].'</div>';
@@ -68,9 +68,9 @@ class EventResource extends Resource
->where('sport_id', auth()->user()->sport_id); ->where('sport_id', auth()->user()->sport_id);
if (config('env.app_env') == 'production') { if (config('env.app_env') == 'production') {
$query->whereDate('starttime', '>=', Carbon::now()->subHour()); $query->where('starttime', '>=', Carbon::now()->subHour());
} else { } else {
$query->whereDate('starttime', '>=', Carbon::now()); $query->where('starttime', '>=', Carbon::now());
} }
if (auth()->user()->all_only_none > 0) { if (auth()->user()->all_only_none > 0) {
@@ -7,6 +7,7 @@ use App\Filament\Resources\Events\Tables\Tools\LoadBettypeSettings;
use App\Filament\Resources\Events\Tables\Tools\LoadCompareDifferences; use App\Filament\Resources\Events\Tables\Tools\LoadCompareDifferences;
use App\Filament\Resources\Events\Tables\Tools\LoadMultiline; use App\Filament\Resources\Events\Tables\Tools\LoadMultiline;
use App\Filament\Tables\Columns\ColumnOdds; use App\Filament\Tables\Columns\ColumnOdds;
use App\Filament\Tables\Columns\ColumnStarttime;
use App\Filament\Tables\Columns\EventColumn; use App\Filament\Tables\Columns\EventColumn;
use App\Filament\Tables\Columns\MatchIds; use App\Filament\Tables\Columns\MatchIds;
use App\Filament\Tables\Columns\TooltipOdds; use App\Filament\Tables\Columns\TooltipOdds;
@@ -29,7 +30,6 @@ use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\FusedGroup; use Filament\Schemas\Components\FusedGroup;
use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Get;
use Filament\Support\Enums\FontWeight;
use Filament\Support\Enums\VerticalAlignment; use Filament\Support\Enums\VerticalAlignment;
use Filament\Support\Enums\Width; use Filament\Support\Enums\Width;
use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\IconColumn;
@@ -76,26 +76,7 @@ class EventsTable
MatchIds::make('ids')->grow(false)->visibleFrom('xl') MatchIds::make('ids')->grow(false)->visibleFrom('xl')
->visible(fn () => auth()->user()->hasRole('super_admin')), ->visible(fn () => auth()->user()->hasRole('super_admin')),
ColumnStarttime::make('start'),
TextColumn::make('event_bookmaker.starttime')
->timezone('CET')
->label('Start')
->alignCenter()
->dateTime('H:i')
->weight(FontWeight::Bold)
->color(function ($record) {
$bkm = $record->event_bookmaker?->starttime ?? null;
if ($bkm) {
return $bkm != $record->starttime ? 'danger' : 'info';
}
return 'gray';
})
->state(function ($record) {
return $record->event_bookmaker->starttime ?? $record->starttime;
})
->description(fn ($record): string => Carbon::createFromDate($record->event_bookmaker->starttime ?? $record->starttime)->format('d. M')),
TextColumn::make('country.name') TextColumn::make('country.name')
->wrap() ->wrap()
->hidden(fn () => auth()->user()->sport_id == 5) ->hidden(fn () => auth()->user()->sport_id == 5)
@@ -0,0 +1,72 @@
<?php
namespace App\Filament\Tables\Columns;
use App\Models\EventBookmaker;
use Filament\Support\Components\Contracts\HasEmbeddedView;
use Filament\Tables\Columns\Column;
use Illuminate\Support\Carbon;
class ColumnStarttime extends Column implements HasEmbeddedView
{
public function toEmbeddedHtml(): string
{
$record = $this->getRecord();
$bookmaker_starttimes = EventBookmaker::with('bookmaker')->where('event_id', $record->id)->select('bookmaker_id', 'starttime')->get();
$pop = '<div class="grid grid-cols-2 gap-1">';
$pop .= '<div>TxOdds</div>';
$pop .= '<div>'.$record->starttime.'</div>';
foreach ($bookmaker_starttimes as $value) {
$pop .= '<div>'.$value->bookmaker->name.'</div>';
$pop .= '<div>'.$value->starttime.'</div>';
}
$pop .= '<div>';
$client_starttime = $record->event_bookmaker->starttime ?? null;
$txodds_starttime = $record->starttime ?? null;
if ($client_starttime) {
if ($client_starttime == $txodds_starttime) {
$color = 'fi-color fi-color-success fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item';
} else {
$color = 'fi-color fi-color-warning fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item';
}
$starttime = Carbon::createFromTimestamp(strtotime($client_starttime))->timezone('CET');
} else {
$color = 'fi-color fi-color-info fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item';
$starttime = Carbon::createFromTimestamp(strtotime($txodds_starttime))->timezone('CET');
}
ob_start(); ?>
<div x-data="{ pop: '<?= e($pop) ?>' }" class="my-auto flex flex-col gap-4 cursor-pointer">
<template x-ref="template">
<p x-html="pop"></p>
</template>
<div class="mx-auto grid grid-cols-1 gap-0 justify-center"
x-tooltip.html="{ content: () =>
$refs.template.innerHTML,
placement: 'auto',
allowHTML: true,
theme: $store.theme,
class: 'tooltip',
appendTo: $root,
strategy: 'fixed',
interactive: false,
zIndex: 99999,
popperOptions: {
strategy: 'fixed',
},
}">
<div class="text-center <?= e($color) ?>">
<?= e($starttime->format('H:i')) ?>
</div>
<div class="text-center fi-color fi-color-gray fi-text-color-500 dark:fi-text-color-400 fi-size-xs fi-ta-text-item">
<?= e($starttime->format('d. M')) ?>
</div>
</div>
</div>
<?php return ob_get_clean();
}
}
@@ -13,7 +13,7 @@
<div> <div>
<div class="grid grid-cols-3 gap-4 text-center mt-4 mb-10"> <div class="grid grid-cols-3 gap-4 text-center mt-4 mb-10">
<div></div> <div></div>
<div>Startime Difference</div> <div>Starttime Difference</div>
<div></div> <div></div>
<div class="bg-gray-100 dark:bg-gray-700 p-1 border dark:border-gray-800 rounded-lg"> <div class="bg-gray-100 dark:bg-gray-700 p-1 border dark:border-gray-800 rounded-lg">
{{ $e->format('d-m-y H:i') }}</div> {{ $e->format('d-m-y H:i') }}</div>
@@ -52,7 +52,8 @@
<div class="row-span-2 text-center py-auto"> <div class="row-span-2 text-center py-auto">
<div x-data="{ elements_swopped: false, toggle() { this.elements_swopped = !this.elements_swopped } }" x-init="elements_swopped = true"> <div x-data="{ elements_swopped: false, toggle() { this.elements_swopped = !this.elements_swopped } }" x-init="elements_swopped = true">
<x-filament::button color="gray" outlined @click="toggle()" wire:click="toggle()" onkeydown="return event.key != 'Enter';"> <x-filament::button color="gray" outlined @click="toggle()" wire:click="toggle()"
onkeydown="return event.key != 'Enter';">
<div x-show="elements_swopped"> <div x-show="elements_swopped">
<x-icon-paralell class="h-14 w-14 mx-auto" /> <x-icon-paralell class="h-14 w-14 mx-auto" />
</div> </div>
+5
View File
@@ -29,3 +29,8 @@ https://txodds.com/feed/starting_times.php?ident=betaid1&passwd=Dy59vpRC&date=to
Tracking OTB (Off-the-board) Offers Tracking OTB (Off-the-board) Offers
https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=1769508445 https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=1769508445
UPDATE TO v5
plugins not supporting v5 yet:
joaopaulolndev/filament-edit-profile