change date format to have correct order in sql request, next add validate form in php file for available equipment output

This commit is contained in:
JBthePenguin 2021-06-10 00:05:45 +02:00
parent d58ae812b5
commit b8a7d664c2
9 changed files with 40 additions and 19 deletions

View file

@ -14,6 +14,20 @@ $eqmts_by_cat = $eqmt->GetAvailableListByCategory();
$csrf_key = 'add_output';
if (f('save') && $form->check($csrf_key) && !$form->hasErrors())
{
$output_date_format = date_create_from_format(
"d/m/Y", f('entry_date'))->format("Y-m-d");
$output->add([
'kind' => f('kind'),
'equipment_number' => (int) f('equipment_number'),
'equipment_id' => f('equipment_id'),
'output_date' => $output_date_format,
'additional_comment' => f('additional_comment'),
]);
Utils::redirect(PLUGIN_URL . 'entrees/index.php');
}
$kinds = $output->listKinds();
$selected_kind = $kinds[0];