From 33b7f19d157e62af6b93900d2cfd0674dcce2500 Mon Sep 17 00:00:00 2001 From: andre Date: Fri, 25 Sep 2026 21:45:04 +0100 Subject: [PATCH] refactor(horario): partilhar _form.php entre create e edit (audit 6.8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extrai os campos comuns (modalidade, dia, início, fim, sala) para _form.php. create.php formatava hora_inicio/hora_fim sem substr() enquanto edit.php aplicava substr(..., 0, 5) para cortar os segundos que vêm da coluna TIME da BD — unificado na versão de edit.php (mais defensiva; sem efeito em create.php, cujos valores já vêm em "HH:MM"). Co-Authored-By: Claude Sonnet 5 --- views/admin/horario/_form.php | 35 ++++++++++++++++++++++++++++++++++ views/admin/horario/create.php | 27 +------------------------- views/admin/horario/edit.php | 27 +------------------------- 3 files changed, 37 insertions(+), 52 deletions(-) create mode 100644 views/admin/horario/_form.php diff --git a/views/admin/horario/_form.php b/views/admin/horario/_form.php new file mode 100644 index 0000000..477358a --- /dev/null +++ b/views/admin/horario/_form.php @@ -0,0 +1,35 @@ + of both +// create.php and edit.php. Expects: +// $data : associative array with every horario column (id_modalidade, +// dia_semana, hora_inicio, hora_fim, local) +// $modalidades : rows from db_modalidades_options($pdo) +// $dias : dia_semana value => label map +// $salas : local value => label map +?> +
+
+
+
+
+
+
+
+
+
+
+
diff --git a/views/admin/horario/create.php b/views/admin/horario/create.php index bb4d2aa..643a90f 100644 --- a/views/admin/horario/create.php +++ b/views/admin/horario/create.php @@ -41,32 +41,7 @@ include __DIR__ . '/../../../includes/header.php';
-
-
-
-
-
-
-
-
-
-
-
-
+
Cancelar diff --git a/views/admin/horario/edit.php b/views/admin/horario/edit.php index 88185ed..ada8f7a 100644 --- a/views/admin/horario/edit.php +++ b/views/admin/horario/edit.php @@ -51,32 +51,7 @@ include __DIR__ . '/../../../includes/header.php';
-
-
-
-
-
-
-
-
-
-
-
-
+
Cancelar