Lager-v3/resources/views/Partials/Form/Input/date_end.blade.php

43 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2022-09-28 07:38:08 +00:00
<div class="mb-3 row">
<label for="date_end_input" class="col-2 col-form-label fw-bold">@lang('date_end') : </label>
@if(isset($date_end_permanent))
<div class="col-1 align-middle pt-2">
<input type="checkbox" id="permanent_input" name="permanent" class="form-check-input" oninput="permanent_change(this)">
<label for="permanent_input" class="form-check-label fw-bold">@lang('permanent')</label>
</div>
@endif
<div
@if(isset($date_end_permanent))
class="col-9 align-middle"
@else
class="col-10"
@endif
>
<input
type="date"
class="form-control"
name="date_end"
id="date_end_input"
placeholder="@lang('date_end')"
min="{{date('Y-m-d',strtotime(now()))}}"
@if(old('date_end') !== null)
value="{{old('date_end')}}"
@elseif(isset($data->date_end))
value="{{date('Y-m-d',strtotime($data->date_end))}}"
@else
value="{{date('Y-m-d',strtotime(now()))}}"
@endif
required
>
</div>
</div>
<script>
function permanent_change(elem){
if ($(elem).is(':checked')) {
$('#date_end_input').prop('disabled', true);
} else {
$('#date_end_input').prop('disabled', false);
}
}
</script>