wip filter

This commit is contained in:
salam committed 2026-01-10 13:17:09 +01:00
1 parent c4d7f2e6ee
commit d2caac4bcc
20 files changed
+567 -119

No files matched your search

@@ -17,7 +17,7 @@ class ClientResource extends Resource
protected static ?int $navigationSort = 32;
protected static string|\BackedEnum|null $navigationIcon = 'lucide-square-user';
protected static string|\BackedEnum|null $navigationIcon = 'phosphor-baseball-helmet';
protected static ?string $cluster = AdministratorCluster::class;
@@ -3,6 +3,7 @@
namespace App\Filament\Resources\Events\Tables;
use App\Filament\Tables\Columns\Column3way;
use App\Filament\Tables\Columns\Column3wayHt;
use App\Filament\Tables\Columns\ColumnDc;
use App\Filament\Tables\Columns\ColumnDnb;
use App\Filament\Tables\Columns\ColumnGgng;
@@ -11,6 +12,7 @@ use App\Filament\Tables\Columns\ColumnMlS1;
use App\Filament\Tables\Columns\ColumnPoint;
use App\Filament\Tables\Columns\ColumnPointQ1;
use App\Filament\Tables\Columns\ColumnTotal;
use App\Filament\Tables\Columns\ColumnTotalHt;
use App\Filament\Tables\Columns\ColumnTotalQ1;
use App\Filament\Tables\Columns\ColumnTq;
use App\Filament\Tables\Columns\MatchIds;
@@ -47,7 +49,12 @@ class EventsTable
public static function load_multiline_bookmaker()
{
$res = MultilineClient::with('multiline_setting')->where('client_id', auth()->user()->client_id)->where('sport_id', auth()->user()->sport_id)->select('bookmaker_id', 'multiline_setting_id')->orderBy('multiline_setting_id')->orderBy('sort')->get();
$res = MultilineClient::with('multiline_setting')
->where('client_id', auth()->user()->client_id)
->where('sport_id', auth()->user()->sport_id)
->select('bookmaker_id', 'multiline_setting_id')
->orderBy('sort')
->get();
foreach ($res as $value) {
self::$multiline_gettype[$value->multiline_setting->table][] = $value->bookmaker_id;
@@ -56,7 +63,10 @@ class EventsTable
public static function load_bettype_settings()
{
$res = BettypeUser::with('multiline_setting')->where('is_active', 1)->get();
$res = BettypeUser::with('multiline_setting')
->orderBy('multiline_setting_id')
->where('is_active', 1)
->get();
foreach ($res as $value) {
self::$bettype_settings[] = $value->multiline_setting->table;
@@ -107,6 +117,7 @@ class EventsTable
TextColumn::make('away.name')
->wrap()
->searchable(),
ColumnMl::make('odds_2ways')->bookmakers(self::$multiline_gettype['odds_2ways'] ?? [])
->visible(fn () => in_array('odds_2ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
@@ -125,8 +136,16 @@ class EventsTable
->visible(fn () => in_array('odds_3ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->width(225)
->alignCenter()
->label('1X2'),
Column3wayHt::make('odds_3ways_ht')->bookmakers(self::$multiline_gettype['odds_3ways_ht'] ?? [])
->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('1X2 HT'),
ColumnTotal::make('odds_totals')->bookmakers(self::$multiline_gettype['odds_totals'] ?? [])
->visible(fn () => in_array('odds_totals', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
@@ -134,6 +153,13 @@ class EventsTable
->width(225)
->label('Totals'),
ColumnTotalHt::make('odds_totals_ht')->bookmakers(self::$multiline_gettype['odds_totals_ht'] ?? [])
->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
->alignCenter()
->width(225)
->label('Totals HT'),
ColumnTotalQ1::make('odds_totals_q1')->bookmakers(self::$multiline_gettype['odds_totals_q1'] ?? [])
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start)
@@ -191,7 +217,7 @@ class EventsTable
->schema([
Select::make(name: 'country_id')
->placeholder('Country')
->columnSpan(2)
->columnSpan(4)
->hiddenLabel()
->label('')
->searchable()
@@ -211,7 +237,7 @@ class EventsTable
->hiddenLabel()
->label('')
->multiple()
->columnSpan(3)
->columnSpan(6)
->searchable()
->options(function (Get $get) {
if ($get('country_id')) {
@@ -229,7 +255,7 @@ class EventsTable
})
->live(),
DateRangePicker::make('starttime_period')
->columnSpan(4)
->columnSpan(8)
->startPrefix('From')
->displayFormat('d M Y')
->minDate(now())
@@ -279,7 +305,7 @@ class EventsTable
}
);
})
->columns(12)->columnSpan(12),
->columns(19)->columnSpan(19),
], layout: FiltersLayout::AboveContent)
->filtersFormColumns(6)
->deferFilters(false)
@@ -0,0 +1,73 @@
<?php
namespace App\Filament\Tables\Columns;
use Filament\Tables\Columns\Column;
class Column3wayHt extends Column
{
protected string $view = 'filament.tables.columns.column_3way_ht';
protected ?array $bookmakers;
protected $max;
protected $min;
protected $act;
protected ?bool $has_data;
public function bookmakers(?array $bookmakers): static
{
array_unshift($bookmakers, auth()->user()->bookmaker_id);
$this->bookmakers = $bookmakers;
return $this;
}
public function getBookmaker(): ?array
{
return $this->bookmakers;
}
public function loadData($record)
{
$this->has_data = count($record->odds_3ways_ht) ? true : false;
$this->act = $record->odds_3ways_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
$this->max['h3w'] = $record->odds_3ways_ht->max('h3w');
$this->max['d3w'] = $record->odds_3ways_ht->max('d3w');
$this->max['a3w'] = $record->odds_3ways_ht->max('a3w');
$this->min['h3w'] = $record->odds_3ways_ht->min('h3w');
$this->min['d3w'] = $record->odds_3ways_ht->min('d3w');
$this->min['a3w'] = $record->odds_3ways_ht->min('a3w');
}
public function getAct()
{
return $this->act;
}
public function getMax()
{
return $this->max;
}
public function getMin()
{
return $this->min;
}
public function hasData()
{
return $this->has_data;
}
}
@@ -0,0 +1,70 @@
<?php
namespace App\Filament\Tables\Columns;
use Filament\Tables\Columns\Column;
class ColumnTotalHt extends Column
{
protected string $view = 'filament.tables.columns.column-total-ht';
protected ?array $bookmakers;
protected $max;
protected $min;
protected $act;
protected ?bool $has_data;
public function bookmakers(?array $bookmakers): static
{
array_unshift($bookmakers, auth()->user()->bookmaker_id);
$this->bookmakers = $bookmakers;
return $this;
}
public function getBookmaker(): ?array
{
return $this->bookmakers;
}
public function loadData($record)
{
$this->has_data = count($record->odds_totals_ht) ? true : false;
$this->act = $record->odds_totals_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
$this->max['over'] = $record->odds_totals_ht->max('over');
$this->max['under'] = $record->odds_totals_ht->max('under');
$this->min['over'] = $record->odds_totals_ht->min('over');
$this->min['under'] = $record->odds_totals_ht->min('under');
}
public function getAct()
{
return $this->act;
}
public function getMax()
{
return $this->max;
}
public function getMin()
{
return $this->min;
}
public function hasData()
{
return $this->has_data;
}
}
+7 -4
View File
@@ -8,7 +8,7 @@ use Livewire\Component;
class BettypeToggle extends Component
{
public $multilines = [];
public $bettype_toggles = [];
protected $listeners = [
'refreshBettypeMenu' => '$refresh',
@@ -16,15 +16,18 @@ class BettypeToggle extends Component
public function boot()
{
$this->multilines = [];
$this->bettype_toggles = [];
$res = BettypeUser::with('multiline_setting')->get();
$res = BettypeUser::with('multiline_setting')
->orderBy('multiline_setting_id')
->get();
foreach ($res as $set) {
$this->multilines[] = [
$this->bettype_toggles[] = [
'id' => $set->multiline_setting_id,
'name' => $set->multiline_setting->name,
'short' => $set->multiline_setting->short,
'matchpart' => $set->multiline_setting->matchpart,
'is_active' => $set->is_active,
];
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Livewire;
use App\Models\Client;
use App\Models\User;
use Livewire\Component;
class KontoSwitcher extends Component
{
public $clients = [];
public function mount()
{
$this->clients = Client::where('id', '!=', auth()->user()->client_id)->pluck('name', 'id')->all();
}
public function swopClient($client_id)
{
$providers = Client::where('id', $client_id)->pluck('provider')->first();
$provider_id = array_shift($providers);
$bookmakers = Client::where('id', $client_id)->pluck('bookmaker')->first();
$bookmaker_id = array_shift($bookmakers);
User::where('id', auth()->user()->id)->update(['sport_id' => 1, 'provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]);
$this->js('window.location.reload()');
}
public function render()
{
return view('livewire.konto-switcher');
}
}
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace App\Livewire;
use App\Models\Client;
use App\Models\Sport;
use App\Models\User;
use Livewire\Component;
class SportSwitcher extends Component
{
public $sports = [];
public $sport_id = 0;
public $sporticon = '';
public $iconcolor = '';
public function mount()
{
$cps = Client::where('id', auth()->user()->client_id)->pluck('sport')->first();
$this->sports = Sport::whereIn('id', $cps)->pluck('name', 'id');
$this->sporticon = Sport::where('id', auth()->user()->sport_id)->pluck('icon')->first();
$this->iconcolor = Sport::where('id', auth()->user()->sport_id)->pluck('color')->first();
$this->sport_id = auth()->user()->sport_id;
}
public function swopSport()
{
User::where('id', auth()->user()->id)->update(['sport_id' => $this->sport_id]);
$this->dispatch('clear_filters');
$this->js('window.location.reload()');
}
public function render()
{
return view('livewire.sport-switcher');
}
}
-50
View File
@@ -2,26 +2,12 @@
namespace App\Livewire;
use App\Models\Client;
use App\Models\Sport;
use App\Models\User;
use Illuminate\Support\Facades\Route;
use Livewire\Component;
class TopMenuItems extends Component
{
public $clients = [];
public ?string $client = '';
public $sports = [];
public $sport_id = 0;
public $sporticon = '';
public $iconcolor = '';
public $current = '';
protected $listeners = [
@@ -31,20 +17,6 @@ class TopMenuItems extends Component
public function mount()
{
$cps = Client::where('id', auth()->user()->client_id)->pluck('sport')->first();
$this->sports = Sport::whereIn('id', $cps)->pluck('name', 'id');
$this->sporticon = Sport::where('id', auth()->user()->sport_id)->pluck('icon')->first();
$this->iconcolor = Sport::where('id', auth()->user()->sport_id)->pluck('color')->first();
$this->sport_id = auth()->user()->sport_id;
$this->clients = Client::pluck('name', 'id')->all();
$this->client = Client::where('id', auth()->user()->client_id)->pluck('name')->first();
$this->current = Route::currentRouteName();
}
@@ -53,21 +25,6 @@ class TopMenuItems extends Component
return view('livewire.top-menu-items');
}
public function swop($client_id)
{
$providers = Client::where('id', $client_id)->pluck('provider')->first();
$provider_id = array_shift($providers);
$bookmakers = Client::where('id', $client_id)->pluck('bookmaker')->first();
$bookmaker_id = array_shift($bookmakers);
User::where('id', auth()->user()->id)->update(['sport_id' => 1, 'provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]);
$this->js('window.location.reload()');
}
public function swopBookmaker($bookmaker_id)
{
User::where('id', auth()->user()->id)->update(['bookmaker_id' => $bookmaker_id]);
@@ -81,11 +38,4 @@ class TopMenuItems extends Component
$this->dispatch('reload_data_right');
}
public function swopSport()
{
User::where('id', auth()->user()->id)->update(['sport_id' => $this->sport_id]);
$this->js('window.location.reload()');
}
}
+12 -2
View File
@@ -28,6 +28,17 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
FilamentView::registerRenderHook(
PanelsRenderHook::USER_MENU_PROFILE_AFTER,
fn (): string => Blade::render('@livewire(\'konto-switcher\')'),
);
FilamentView::registerRenderHook(
TablesRenderHook::TOOLBAR_SEARCH_BEFORE,
fn (): string => Blade::render('@livewire(\'sport-switcher\')'),
scopes: [
ListEvents::class,
]
);
FilamentView::registerRenderHook(
TablesRenderHook::TOOLBAR_SEARCH_AFTER,
fn (): string => Blade::render('@livewire(\'bettype-toggle\')'),
@@ -35,9 +46,8 @@ class AppServiceProvider extends ServiceProvider
ListEvents::class,
]
);
// GLOBAL_SEARCH_BEFORE
FilamentView::registerRenderHook(
PanelsRenderHook::TOPBAR_LOGO_AFTER,
PanelsRenderHook::GLOBAL_SEARCH_BEFORE,
fn (): string => Blade::render('@livewire(\'top-menu-items\')')
// fn (): string => auth()->user()->hasRole('konto_switch') ? Blade::render('@livewire(\'konto-switch\')') : false
);
@@ -3,9 +3,9 @@
namespace App\Providers\Filament;
use Agencetwogether\HooksHelper\HooksHelperPlugin;
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
use Awcodes\LightSwitch\Enums\Alignment;
use Awcodes\LightSwitch\LightSwitchPlugin;
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
use Filament\Actions\Action;
use Filament\Auth\MultiFactor\App\AppAuthentication;
use Filament\Auth\MultiFactor\Email\EmailAuthentication;
@@ -17,6 +17,7 @@ return new class extends Migration
$table->string('name');
$table->string('short');
$table->string('table');
$table->string('matchpart');
$table->integer('rows')->default(4);
$table->integer('has_3_columns')->default(0);
$table->timestamps();
+26 -17
View File
@@ -12,24 +12,33 @@ class MatchpartSeeder extends Seeder
/**
* Clients
*/
$sql = "INSERT INTO `matchparts` (`id`, `short`, `name`, `color`, `is_active`, `soccer`, `icehockey`, `basketball`, `tennis`, `handball`, `rugby`, `created_at`, `updated_at`)
$sql = "INSERT INTO `multiline_settings` (`id`, `sport_id`, `name`, `short`, `table`, `matchpart`, `rows`, `has_3_columns`, `created_at`, `updated_at`)
VALUES
('1', 'FT', 'Fulltime', 'primary', '1', '1', '1', '1', '1', '1', '0', NULL, NULL),
('2', 'HT', 'Halftime', 'success', '1', '1', '0', '1', '0', '1', '0', NULL, NULL),
('3', 'H2', 'Second Half', 'warning', '1', '1', '0', '1', '0', '1', '0', NULL, NULL),
('4', 'CO', 'Combo', 'info', '1', '1', '1', '1', '0', '0', '0', NULL, NULL),
('5', 'Q1', 'Quarter 1', 'quarter', '1', '0', '0', '1', '0', '0', '0', NULL, NULL),
('6', 'Q2', 'Quarter 2', 'quarter', '0', '0', '0', '1', '0', '0', '0', NULL, NULL),
('7', 'Q3', 'Quarter 3', 'quarter', '0', '0', '0', '1', '0', '0', '0', NULL, NULL),
('8', 'Q4', 'Quarter 4', 'quarter', '0', '0', '0', '1', '0', '0', '0', NULL, NULL),
('9', 'P1', 'Period 1', 'period', '1', '0', '1', '0', '0', '0', '0', NULL, NULL),
('10', 'P2', 'Period 2', 'period', '0', '0', '1', '0', '0', '0', '0', NULL, NULL),
('11', 'P3', 'Period 3', 'period', '0', '0', '1', '0', '0', '0', '0', NULL, NULL),
('12', 'S1', 'Set 1', 'set', '1', '0', '0', '0', '1', '0', '0', NULL, NULL),
('13', 'S2', 'Set 2', 'set', '0', '0', '0', '0', '1', '0', '0', NULL, NULL),
('14', 'S3', 'Set 3', 'set', '0', '0', '0', '0', '1', '0', '0', NULL, NULL),
('15', 'S4', 'Set 4', 'set', '0', '0', '0', '0', '1', '0', '0', NULL, NULL),
('16', 'S5', 'Set 5', 'set', '0', '0', '0', '0', '1', '0', '0', NULL, NULL);
(1, 1, '1X2', '1X2', 'odds_3ways', 'Fulltime', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
(2, 1, 'TOTALS', 'OU', 'odds_totals', 'Fulltime', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
(3, 1, '1X2 HALF TIME', '1X2 HT', 'odds_3ways_ht', 'Halftime', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
(4, 1, 'TOTALS HALF TIME', 'OU HT', 'odds_totals_ht', 'Halftime', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
(5, 1, 'GOAL NO GOAL', 'GGNG', 'odds_ggng', 'Fulltime', 4, 0, '2025-12-14 09:31:56', '2025-12-14 09:31:56'),
(6, 1, 'DOUBLE CHANCE', 'DC', 'odds_dc', 'Fulltime', 4, 1, '2025-12-14 09:31:22', '2025-12-14 09:32:55'),
(7, 1, 'TO QUALIFY', 'TQ', 'odds_tq', 'Fulltime', 4, 0, '2025-12-14 09:32:19', '2025-12-14 09:32:19'),
(8, 1, 'DRAW NO BET', 'DNB', 'odds_dnb', 'Fulltime', 4, 0, '2025-12-14 09:31:42', '2025-12-14 09:31:42'),
(9, 2, '1X2', '1X2', 'odds_3ways', 'Fulltime', 4, 1, '2025-12-14 09:41:34', '2025-12-14 09:41:34'),
(10, 2, 'MONEY LINE', 'ML', 'odds_2ways', 'Fulltime', 4, 0, '2025-12-14 09:41:21', '2025-12-14 09:41:21'),
(11, 2, 'POINTS', 'HC', 'odds_points', 'Fulltime', 4, 1, '2025-12-14 09:41:56', '2025-12-14 09:41:56'),
(12, 2, 'TOTALS', 'OU', 'odds_totals', 'Fulltime', 4, 1, '2025-12-14 09:42:13', '2025-12-14 09:42:13'),
(13, 2, 'POINTS FIRST QUARTER', 'HC Q1', 'odds_points_q1', 'First Quarter', 4, 1, '2025-12-14 09:41:56', '2025-12-14 09:41:56'),
(14, 2, 'TOTALS FIRST QUARTER', 'OU Q1', 'odds_totals_q1', 'First Quarter', 4, 1, '2025-12-14 09:42:13', '2025-12-14 09:42:13'),
(15, 3, 'MONEY LINE', 'ML', 'odds_2ways', 'Fulltime', 4, 0, '2025-12-14 09:37:32', '2025-12-14 09:37:32'),
(16, 3, 'POINTS', 'HC', 'odds_points', 'Fulltime', 4, 1, '2025-12-14 09:38:05', '2025-12-14 09:38:05'),
(17, 3, 'TOTALS', 'OU', 'odds_totals', 'Fulltime', 4, 1, '2025-12-14 09:38:44', '2025-12-14 09:38:44'),
(18, 3, 'POINTS FIRST QUARTER', 'HC Q1', 'odds_points_q1', 'First Quarter', 4, 1, '2025-12-14 09:38:26', '2025-12-14 09:39:54'),
(19, 3, 'TOTALS FIRST QUARTER', 'OU Q1', 'odds_totals_q1', 'First Quarter', 4, 1, '2025-12-14 09:39:12', '2025-12-14 09:39:59'),
(20, 3, 'POINTS HALF TIME', 'HC HT', 'odds_points_ht', 'Halftime', 4, 1, '2025-12-14 09:38:26', '2025-12-14 09:39:54'),
(21, 3, 'TOTALS HALF TIME', 'OU HT', 'odds_totals_ht', 'Halftime', 4, 1, '2025-12-14 09:39:12', '2025-12-14 09:39:59'),
(22, 5, 'MONEY LINE', 'ML', 'odds_2ways', 'Fulltime', 4, 0, '2025-12-14 09:43:52', '2025-12-14 09:43:52'),
(23, 5, 'MONEY LINE SET 1', 'ML S1', 'odds_2ways_s1', 'Set 1', 4, 0, '2025-12-14 09:44:13', '2025-12-14 09:44:13'),
(24, 5, 'TOTALS', 'OU', 'odds_totals', 'Fulltime', 4, 1, '2025-12-14 09:44:26', '2025-12-14 09:44:26'),
(25, 5, 'POINTS', 'HC', 'odds_points', 'Fulltime', 4, 1, '2025-12-14 09:44:26', '2025-12-14 09:44:26');
";
DB::unprepared($sql);
@@ -0,0 +1,50 @@
@php
$loadData($record);
@endphp
@if ($hasData())
@include('filament.tables.columns.fumetto.fumetto_total_ht')
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-5" style="width: 225px;">
@include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']])
@foreach ($getBookmaker() as $bookmaker_id)
@foreach ($record->odds_totals_ht as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->over,
'dec' => 2,
'hig' => isset($act['over']) && $item->over >= $act['over'] ? 1 : 0,
'has' => isset($act['over']) && $item->bookmaker_id != auth()->user()->bookmaker_id,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->under,
'dec' => 2,
'hig' => isset($act['under']) && $item->under >= $act['under'] ? 1 : 0,
'has' => isset($act['under']) && $item->bookmaker_id != auth()->user()->bookmaker_id,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->total,
'dec' => 1,
'has' => false,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'dec' => 1,
'has' => false,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -0,0 +1,55 @@
@php
$loadData($record);
@endphp
@if ($hasData())
@include('filament.tables.columns.fumetto.fumetto_1x2_ht')
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-5" style="width: 225px;">
@include('filament.tables.columns.multiline.label', ['labels' => ['1', 'X', '2']])
@php
$act = $getAct();
@endphp
@foreach ($getBookmaker() as $bookmaker_id)
@foreach ($record->odds_3ways_ht as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->h3w,
'dec' => 2,
'hig' => isset($act['h3w']) && $item->h3w >= $act['h3w'] ? 1 : 0,
'has' => isset($act['h3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->d3w,
'dec' => 2,
'hig' => isset($act['d3w']) && $item->d3w >= $act['d3w'] ? 1 : 0,
'has' => isset($act['d3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->a3w,
'dec' => 2,
'hig' => isset($act['a3w']) && $item->a3w >= $act['a3w'] ? 1 : 0,
'has' => isset($act['a3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'dec' => 1,
'has' => false,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -0,0 +1,59 @@
@if ($hasData())
<div class="mx-3 my-auto">
<template x-ref="template_1x2_ht_{{ $record->id }}">
<div class="grid grid-cols-5 grid-rows-5 gap-1 m-5 z-10">
@include('filament.tables.columns.multiline.label', ['labels' => ['1', 'X', '2']])
@php
$max = $getMax();
$min = $getMin();
@endphp
@foreach ($record->odds_3ways_ht as $item)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->h3w,
'dec' => 2,
'max' => $item->h3w >= $max['h3w'] ? 1 : 0,
'min' => $item->h3w <= $min['h3w'] ? 1 : 0,
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->d3w,
'dec' => 2,
'max' => $item->d3w >= $max['d3w'] ? 1 : 0,
'min' => $item->d3w <= $min['d3w'] ? 1 : 0,
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->a3w,
'dec' => 2,
'max' => $item->a3w >= $max['a3w'] ? 1 : 0,
'min' => $item->a3w <= $min['a3w'] ? 1 : 0,
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->margin,
'dec' => 1,
'max' => false,
'min' => false,
])
@endforeach
</div>
</template>
<x-filament::icon-button icon="heroicon-o-chat-bubble-left-ellipsis" color="gray"
x-tooltip.html="{
content: () => $refs.template_1x2_ht_{{ $record->id }}.innerHTML,
allowHTML: true,
theme: $store.theme,
appendTo: $root,
interactive: true
}" />
</div>
@endif
@@ -0,0 +1,58 @@
@if ($hasData())
<div class="mx-3 my-auto">
<template x-ref="template_total_ht_{{ $record->id }}">
<div class="grid grid-cols-5 grid-rows-5 gap-1 m-5 z-10">
@include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']])
@php
$max = $getMax();
$min = $getMin();
@endphp
@foreach ($record->odds_totals_ht as $item)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->over,
'dec' => 2,
'max' => $item->over == $max['over'] ? 1 : 0,
'min' => $item->over == $min['over'] ? 1 : 0,
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->under,
'dec' => 2,
'max' => $item->under == $max['under'] ? 1 : 0,
'min' => $item->under == $min['under'] ? 1 : 0,
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->total,
'dec' => 1,
'max' => false,
'min' => false,
])
@include('filament.tables.columns.multiline.fums', [
'odd' => $item->margin,
'dec' => 1,
'max' => false,
'min' => false,
])
@endforeach
</div>
</template>
<x-filament::icon-button icon="heroicon-o-chat-bubble-left-ellipsis" color="gray"
x-tooltip.html="{
content: () => $refs.template_total_ht_{{ $record->id }}.innerHTML,
allowHTML: true,
theme: $store.theme,
appendTo: $root
}" />
</div>
@endif
@@ -1,7 +1,9 @@
<div class="flex flex-row gap-3">
@foreach ($multilines as $multiline)
<x-filament::button size="xs" class="mx-1" tooltip="{{ $multiline['name'] }}"
wire:click="toggleBettype({{ $multiline['id'] }})" wire:dispatch="refreshTable" :color="!$multiline['is_active'] ? 'gray' : 'primary'">
{{ $multiline['short'] }} </x-filament::button>
@foreach ($bettype_toggles as $toggle)
<x-filament::button class="flex flex-col justify-center gap-0" tooltip="{{ $toggle['name'] }}"
wire:click="toggleBettype({{ $toggle['id'] }})" wire:dispatch="refreshTable" :color="!$toggle['is_active'] ? 'gray' : 'primary'">
<div class="m-0 p-0">{{ $toggle['short'] }}</div>
{{-- <div class="m-0 px-1 border rounded" style="font-size:9px">{{ $toggle['matchpart'] }}</div> --}}
</x-filament::button>
@endforeach
</div>
@@ -0,0 +1,20 @@
<div>
@if (auth()->user()->hasRole('konto_switch'))
<x-filament::dropdown>
<x-slot name="trigger">
<x-filament::dropdown.list.item icon="phosphor-baseball-helmet">
Swop Client
</x-filament::dropdown.list.item>
</x-slot>
<x-filament::dropdown.list>
@foreach ($clients as $id => $name)
<x-filament::dropdown.list.item wire:click="swopClient({{ $id }})"
icon="phosphor-arrow-fat-right">
{{ $name }}
</x-filament::dropdown.list.item>
@endforeach
</x-filament::dropdown.list>
</x-filament::dropdown>
@endif
</div>
@@ -0,0 +1,9 @@
<div>
<x-filament::input.wrapper prefix-icon="{{ $sporticon }}" prefix-icon-color="primary">
<x-filament::input.select wire:model="sport_id" wire:change="swopSport">
@foreach ($sports as $id => $name)
<option value="{{ $id }}">{{ $name }}</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
</div>
@@ -60,23 +60,13 @@
</x-filament::dropdown.list>
</x-filament::dropdown>
{{-- Swop Sport --}}
<x-filament::input.wrapper prefix-icon="{{ $sporticon }}" prefix-icon-color="primary">
<x-filament::input.select wire:model="sport_id" wire:change="swopSport">
@foreach ($sports as $id => $name)
<option value="{{ $id }}">{{ $name }}</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
{{-- Event Mapper --}}
<x-filament::modal width="7xl" icon="phosphor-arrows-in-line-horizontal" :close-by-clicking-away="false" :close-by-escaping="false"
:close-button="true">
<x-slot name="trigger">
<x-filament::button outlined icon="phosphor-arrows-in-line-horizontal" color="gray">
Event Mapper
<x-filament::button outlined icon="phosphor-arrows-in-line-horizontal" color="gray"
tooltip="Event Mapper">
</x-filament::button>
</x-slot>
@@ -168,8 +158,7 @@
<x-filament::dropdown>
<x-slot name="trigger">
<x-filament::button outlined icon="heroicon-o-adjustments-horizontal" color="gray">
Settings
<x-filament::button outlined icon="heroicon-o-adjustments-horizontal" color="gray" tooltip="Settings">
</x-filament::button>
</x-slot>
@@ -249,24 +238,4 @@
</x-filament::dropdown.list>
</x-filament::dropdown>
@endif
@if (auth()->user()->hasRole('konto_switch'))
<x-filament::dropdown>
<x-slot name="trigger">
<x-filament::button icon="phosphor-play">
{{ $client }}
</x-filament::button>
</x-slot>
<x-filament::dropdown.list>
@foreach ($clients as $id => $name)
@if ($name != $client)
<x-filament::dropdown.list.item wire:click="swop({{ $id }})" icon="phosphor-play">
{{ $name }}
</x-filament::dropdown.list.item>
@endif
@endforeach
</x-filament::dropdown.list>
</x-filament::dropdown>
@endif
</div>