Files
ui/resources/views/form/fecha.blade.php
2021-12-01 21:04:06 -03:00

38 lines
1.0 KiB
PHP

<?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
<div class="col-md-1"><select name="day{{(isset($id)) ? $id : ''}}" class="form-control">
@for ($i = 0; $i < 31; $i ++)
<option value="{{$i + 1}}"
@if (isset($f))
@if ($f->day == $i + 1)
selected="selected"
@endif
@elseif ($t->day == $i + 1)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select></div>
<div class="col-md-1"><select name="month{{(isset($id)) ? $id : ''}}" class="form-control">
@for ($i = 0; $i < 12; $i ++)
<option value="{{$i + 1}}"
@if (isset($f))
@if ($f->month == $i + 1)
selected="selected"
@endif
@elseif ($t->month == $i + 1)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select></div>
<div class="col-md-2"><select name="year{{(isset($id)) ? $id : ''}}" class="form-control">
@for ($i = $t->year; $i > $t->year - 5; $i --)
<option value="{{$i}}"
@if (isset($f))
@if ($f->year == $i)
selected="selected"
@endif
@endif
>{{$i}}</option>
@endfor
</select></div>