Show correct zone_id in echoarea/filearea selection

This commit is contained in:
Deon George 2023-07-29 20:50:56 +10:00
parent 7f144c3420
commit df559b6b39
2 changed files with 10 additions and 12 deletions

View File

@ -1,7 +1,6 @@
@if(($x=\App\Models\Domain::active()
->select('domains.*')
->join('zones',['zones.domain_id'=>'domains.id'])
->whereIn('zones.id',$o->sessions->pluck('pivot.zone_id'))
@if(($x=\App\Models\Zone::active()
->whereIn('id',$o->sessions->pluck('pivot.zone_id'))
->orderBy('zone_id')
->get())->count())
<form class="row g-0 needs-validation" method="post" action="{{ url('ftn/system/echoarea',$o->id) }}" novalidate>
@ -18,8 +17,8 @@
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="echoarea_domain_id" name="domain_id" required>
<option></option>
@foreach($x as $do)
<option value="{{ $do->id }}" @if(old('domain_id') == $do->id)selected @endif>{{ $do->id }} <small>({{ $do->name }})</small></option>
@foreach($x as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">

View File

@ -1,7 +1,6 @@
@if(($x=\App\Models\Domain::active()
->select('domains.*')
->join('zones',['zones.domain_id'=>'domains.id'])
->whereIn('zones.id',$o->sessions->pluck('pivot.zone_id'))
@if(($x=\App\Models\Zone::active()
->whereIn('id',$o->sessions->pluck('pivot.zone_id'))
->orderBy('zone_id')
->get())->count())
<form class="row g-0 needs-validation" method="post" action="{{ url('ftn/system/filearea',$o->id) }}" novalidate>
@ -18,8 +17,8 @@
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="filearea_domain_id" name="domain_id" required>
<option></option>
@foreach($x as $do)
<option value="{{ $do->id }}" @if(old('domain_id') == $do->id)selected @endif>{{ $do->id }} <small>({{ $do->name }})</small></option>
@foreach($x as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">