@php
$rAdd = $rAdd ?? false;
$rEdit = $rEdit ?? false;
$id = $item->id ?? 0;
$happyHourBegin = $item->happy_hours_begin ?? 0;
$happyHourBeginHH = (int)($happyHourBegin/60);
$happyHourBeginMM = (($happyHourBegin-$happyHourBeginHH) > 0) ? ($happyHourBegin-($happyHourBeginHH*60)) : '';
if($happyHourBegin > 0) {
$happyHourBeginHH = str_pad($happyHourBeginHH,2,'0',STR_PAD_LEFT);
$happyHourBeginMM = str_pad($happyHourBeginMM,2,'0',STR_PAD_LEFT);
}
$happyHourEnd = $item->happy_hours_end ?? 0;
$happyHourEndHH = (int)($happyHourEnd/60);
$happyHourEndMM = (($happyHourEnd-$happyHourEndHH) > 0) ? ($happyHourEnd-($happyHourEndHH*60)) : '';
if($happyHourEnd > 0) {
$happyHourEndHH = str_pad($happyHourEndHH,2,'0',STR_PAD_LEFT);
$happyHourEndMM = str_pad($happyHourEndMM,2,'0',STR_PAD_LEFT);
}
$localeAddURL = route('promotion.v2.add',['id'=>$id]);
$localeEditURL = $editURL = route('promotion.v2.edit',['id'=>$id]);
@endphp
|
|
{{$id}} |
{{$item->name}} |
{{Common::date($item->starts_at)}} |
{{Common::date($item->ends_at)}} |
@if($happyHourBegin > 0 && $happyHourEnd > 0)
{{$happyHourBeginHH . ':' . $happyHourBeginMM}} - {{$happyHourEndHH . ':' . $happyHourEndMM}}
@elseif($happyHourBegin > 0)
{{$happyHourBeginHH . ':' . $happyHourBeginMM}} - {{$happyHourEndHH . ':59'}}
@elseif($happyHourEnd > 0)
{{$happyHourEndHH . ':00'}} - {{$happyHourEndHH . ':' . $happyHourEndMM}}
@endif
|
@if($item->dayofmonth_begin > 0 && $item->dayofmonth_end > 0)
{{$item->dayofmonth_begin}} - {{$item->dayofmonth_end}}
@elseif($item->dayofmonth_begin > 0)
{{$item->dayofmonth_begin}}
@elseif($item->dayofmonth_end > 0)
{{$item->dayofmonth_end}}
@endif
|
@include('components.elements.locale-td',[
'localeBW' => $item->locale_bw ?? 0,
'localeAddURL' => $localeAddURL,
'localeEditURL' => $localeEditURL,
'rAdd' => $rAdd,
'rEdit' => $rEdit,
])
@if(isset($item->status->code))
{{trans('admin::message.status.' . $item->status->code)}}
@endif
|