wip del err
This commit is contained in:
1 parent
812736ca9a
commit
9bcd4432c6
1210 files changed
-220941
No files matched your search
@@ -1,85 +0,0 @@
|
||||
<?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::where('event_id', $record->id)
|
||||
->join('bookmakers', 'bookmakers.id', '=', 'event_bookmakers.bookmaker_id')
|
||||
->select('bookmaker_id', 'starttime')
|
||||
->orderBy('bookmakers.name')
|
||||
->get();
|
||||
|
||||
$pop = '<div class="grid grid-cols-2 gap-1 text-xs m-2">';
|
||||
$pop .= '<div class="fi-color fi-color-success fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item">TxOdds</div>';
|
||||
$txstarttime = Carbon::createFromTimestamp(strtotime($record->starttime))->timezone('CET');
|
||||
$pop .= '<div class="text-right fi-color fi-color-success fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item">'.$txstarttime->format('H:i').'</div>';
|
||||
foreach ($bookmaker_starttimes as $value) {
|
||||
|
||||
$starttime = Carbon::createFromTimestamp(strtotime($value->starttime))->timezone('CET');
|
||||
|
||||
if ($value->bookmaker->name == auth()->user()->bookmaker->name) {
|
||||
$pop .= '<div class="fi-color fi-color-info fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item">'.$value->bookmaker->name.'</div>';
|
||||
$pop .= '<div class="text-right fi-color fi-color-info fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item">'.$starttime->format('H:i').'</div>';
|
||||
} else {
|
||||
$pop .= '<div>'.$value->bookmaker->name.'</div>';
|
||||
$pop .= '<div class="text-right">'.$starttime->format('H:i').'</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-info 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-success 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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user