popup fixed al ok

This commit is contained in:
salam committed 2026-01-23 13:51:36 +01:00
1 parent b0482cacf6
commit 82e6a60253
45 files changed
+8043 -1277

No files matched your search

@@ -19,7 +19,7 @@ use App\Filament\Tables\Columns\ColumnTotalQ1;
use App\Filament\Tables\Columns\ColumnTq;
use App\Filament\Tables\Columns\EventColumn;
use App\Filament\Tables\Columns\MatchIds;
use App\Filament\Tables\Columns\PopupOdds;
use App\Filament\Tables\Columns\TooltipOdds;
use App\Models\CompetitionGroup;
use App\Models\Country;
use App\Models\Event;
@@ -93,97 +93,95 @@ class EventsTable
EventColumn::make('event'),
TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn () => in_array('odds_2ways', self::$bettype_settings)),
ColumnMl::make('odds_2ways')->bookmakers(self::$multiline_bookmaker['odds_2ways'] ?? [])
->visible(fn () => in_array('odds_2ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->width(225)
->alignCenter()
->label('ML'),
PopupOdds::make('1x2')->label(''),
Column3way::make('odds_3ways')->bookmakers(self::$multiline_bookmaker['odds_3ways'] ?? [])
->visible(fn () => in_array('odds_3ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->width(225)
->alignCenter()
->label('1X2'),
ColumnTotal::make('odds_totals')->bookmakers(self::$multiline_bookmaker['odds_totals'] ?? [])
->visible(fn () => in_array('odds_totals', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Totals'),
Column3wayHt::make('odds_3ways_ht')->bookmakers(self::$multiline_bookmaker['odds_3ways_ht'] ?? [])
->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('1X2 HT'),
ColumnTotalHt::make('odds_totals_ht')->bookmakers(self::$multiline_bookmaker['odds_totals_ht'] ?? [])
->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Totals HT'),
ColumnGgng::make('odds_ggng')->bookmakers(self::$multiline_bookmaker['odds_ggng'] ?? [])
->visible(fn () => \in_array('odds_ggng', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(190)
->label('Goal No Goal'),
ColumnPoint::make('odds_points')->bookmakers(self::$multiline_bookmaker['odds_points'] ?? [])
->visible(fn () => in_array('odds_points', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Points'),
ColumnTotalQ1::make('odds_totals_q1')->bookmakers(self::$multiline_bookmaker['odds_totals_q1'] ?? [])
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Totals Q1'),
ColumnPointQ1::make('odds_points_q1')->bookmakers(self::$multiline_bookmaker['odds_points_q1'] ?? [])
->visible(fn () => in_array('odds_points_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Points Q1'),
TooltipOdds::make('mls1')->bettype('odds_2ways_s1')->label('')->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings)),
ColumnMlS1::make('odds_2ways_s1')->bookmakers(self::$multiline_bookmaker['odds_2ways'] ?? [])
->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('ML S1'),
TooltipOdds::make('1x2')->bettype('odds_3ways')->label('')->visible(fn () => in_array('odds_3ways', self::$bettype_settings)),
Column3way::make('odds_3ways')->bookmakers(self::$multiline_bookmaker['odds_3ways'] ?? [])
->visible(fn () => in_array('odds_3ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('1X2'),
TooltipOdds::make('total')->bettype('odds_totals')->label('')->visible(fn () => in_array('odds_totals', self::$bettype_settings)),
ColumnTotal::make('odds_totals')->bookmakers(self::$multiline_bookmaker['odds_totals'] ?? [])
->visible(fn () => in_array('odds_totals', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('Totals'),
TooltipOdds::make('1x2ht')->bettype('odds_3ways_ht')->label('')->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings)),
Column3wayHt::make('odds_3ways_ht')->bookmakers(self::$multiline_bookmaker['odds_3ways_ht'] ?? [])
->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('1X2 HT'),
TooltipOdds::make('total_ht')->bettype('odds_totals_ht')->label('')->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings)),
ColumnTotalHt::make('odds_totals_ht')->bookmakers(self::$multiline_bookmaker['odds_totals_ht'] ?? [])
->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('Totals HT'),
TooltipOdds::make('ggng')->bettype('odds_ggng')->label('')->visible(fn () => in_array('odds_ggng', self::$bettype_settings)),
ColumnGgng::make('odds_ggng')->bookmakers(self::$multiline_bookmaker['odds_ggng'] ?? [])
->visible(fn () => \in_array('odds_ggng', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('Goal No Goal'),
TooltipOdds::make('points')->bettype('odds_points')->label('')->visible(fn () => in_array('odds_points', self::$bettype_settings)),
ColumnPoint::make('odds_points')->bookmakers(self::$multiline_bookmaker['odds_points'] ?? [])
->visible(fn () => in_array('odds_points', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('Points'),
TooltipOdds::make('total_q1')->bettype('odds_totals_q1')->label('')->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings)),
ColumnTotalQ1::make('odds_totals_q1')->bookmakers(self::$multiline_bookmaker['odds_totals_q1'] ?? [])
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('Totals Q1'),
TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)),
ColumnPointQ1::make('odds_points_q1')->bookmakers(self::$multiline_bookmaker['odds_points_q1'] ?? [])
->visible(fn () => in_array('odds_points_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->label('Points Q1'),
TooltipOdds::make('dc')->bettype('odds_dc')->label('')->visible(fn () => in_array('odds_dc', self::$bettype_settings)),
ColumnDc::make('odds_dc')->bookmakers(self::$multiline_bookmaker['odds_dc'] ?? [])
->visible(fn () => \in_array('odds_dc', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Double Chance'),
TooltipOdds::make('tq')->bettype('odds_tq')->label('')->visible(fn () => in_array('odds_tq', self::$bettype_settings)),
ColumnTq::make('odds_tq')->bookmakers(self::$multiline_bookmaker['odds_tq'] ?? [])
->visible(fn () => \in_array('odds_tq', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(190)
->label('To Qualify'),
TooltipOdds::make('dnb')->bettype('odds_dnb')->label('')->visible(fn () => in_array('odds_dnb', self::$bettype_settings)),
ColumnDnb::make('odds_dnb')->bookmakers(self::$multiline_bookmaker['odds_dnb'] ?? [])
->visible(fn () => \in_array('odds_dnb', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(190)
->label('Draw No Bet'),
])->searchable(['id', 'home.name', 'away.name', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'magnig_id', 'magken_id', 'lognig_id', 'logcol_id'])
@@ -194,16 +192,11 @@ class EventsTable
->columns(5)->columnSpan(5)
->schema([
Select::make(name: 'sport_id')
->options(fn () => Sport::getSportForClient())
->default(self::$user->sport_id)
->prefixIcon(self::$user->sport->icon)
->selectablePlaceholder(false)
->hiddenLabel()
->preload()
->options(function () {
return Sport::getSportForClient();
})
->live()
->reactive()
->afterStateUpdated(function (callable $set, $state, $livewire) {
User::where('id', self::$user->id)->update(['sport_id' => (int) $state]);
@@ -223,8 +216,8 @@ class EventsTable
->multiple()
->searchable()
->preload()
->options(function () {
$res = Event::where('sport_id', self::$user->sport_id)->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
->options(function (Get $get) {
$res = Event::where('sport_id', $get('sport_id'))->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
return Country::query()->whereIn('id', $res)->pluck('name', 'id');
})
@@ -242,9 +235,9 @@ class EventsTable
->searchable()
->options(function (Get $get) {
if ($get('country_id')) {
$res = Event::where('sport_id', self::$user->sport_id)->with('country')->with('competition_group')->where('country_id', $get('country_id'))->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
$res = Event::where('sport_id', $get('sport_id'))->with('country')->with('competition_group')->where('country_id', $get('country_id'))->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
} else {
$res = Event::where('sport_id', self::$user->sport_id)->with('country')->with('competition_group')->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
$res = Event::where('sport_id', $get('sport_id'))->with('country')->with('competition_group')->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
}
$arr = [];
foreach ($res as $val) {
@@ -264,9 +257,9 @@ class EventsTable
->searchable()
->options(function (Get $get) {
if ($get('country_id')) {
$res = Event::with('country')->where('sport_id', self::$user->sport_id)->with('group')->where('country_id', $get('country_id'))->where('starttime', '>', Carbon::now())->groupBy('group_id')->get();
$res = Event::with('country')->where('sport_id', $get('sport_id'))->with('group')->where('country_id', $get('country_id'))->where('starttime', '>', Carbon::now())->groupBy('group_id')->get();
} else {
$res = Event::with('country')->where('sport_id', self::$user->sport_id)->with('group')->where('starttime', '>', Carbon::now())->groupBy('group_id')->get();
$res = Event::with('country')->where('sport_id', $get('sport_id'))->with('group')->where('starttime', '>', Carbon::now())->groupBy('group_id')->get();
}
$arr = [];
foreach ($res as $val) {
@@ -287,6 +280,9 @@ class EventsTable
])
->query(function (Builder $query, array $data): Builder {
return $query->when(
$data['sport_id'],
fn (Builder $query, $sport_id) => $query->where('sport_id', $sport_id)
)->when(
$data['country_id'],
fn (Builder $query, $country_id) => $query->where('country_id', $country_id)
)->when(
@@ -320,7 +316,6 @@ class EventsTable
);
})->indicateUsing(function (array $data): array {
$indicators = [];
if ($data['country_id'] ?? null) {
$countries = Country::whereIn('id', $data['country_id'])->pluck('name')->toArray();
if (count($countries) > 1) {