fix input radio id and default to multi on shift creation
This commit is contained in:
parent
559517e017
commit
fdddd63aae
|
@ -29,7 +29,7 @@ function admin_shifts()
|
|||
$session = session();
|
||||
$start = Carbon::createTimestampFromDatetime(date('Y-m-d') . 'T00:00');
|
||||
$end = $start;
|
||||
$mode = '';
|
||||
$mode = 'multi';
|
||||
$angelmode = 'manually';
|
||||
$length = '';
|
||||
$change_hours = [];
|
||||
|
|
|
@ -140,10 +140,13 @@ function form_checkbox($name, $label, $selected, $value = 'checked', $html_id =
|
|||
*/
|
||||
function form_radio($name, $label, $selected, $value)
|
||||
{
|
||||
$value = htmlspecialchars((string)$value);
|
||||
$id = preg_replace('/\s/', '-', $name . '_' . $value);
|
||||
|
||||
return '<div class="form-check">'
|
||||
. '<input class="form-check-input" type="radio" id="' . $name . '" name="' . $name . '" value="' . htmlspecialchars((string)$value) . '" '
|
||||
. '<input class="form-check-input" type="radio" id="' . $id . '" name="' . $name . '" value="' . $value . '" '
|
||||
. ($selected ? ' checked="checked"' : '') . ' />'
|
||||
. '<label class="form-check-label" for="' . $name . '">'
|
||||
. '<label class="form-check-label" for="' . $id . '">'
|
||||
. $label
|
||||
. '</label></div>';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue