Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion translations/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
'text-confirm' => 'Ok',
'input-type-here' => 'Type here',
'new-course' => 'New Course',
'active'=> 'Active',
'inactive'=>'Inactive',
'course-description' => 'Description',
'status' => "Status",
'student-name' => 'Name',
'student-registry' => 'Registrion',
'student-cpf' => 'CPF',
'student-email' => 'E-mail',
'student-created_at' => 'Registration date'
'student-created_at' => 'Registration date',

];

4 changes: 3 additions & 1 deletion translations/pt-br.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
'text-confirm' => 'Pronto',
'input-type-here' => 'Digite aqui',
'new-course' => 'Novo Curso',
'active'=>'Ativo',
'inactive'=>'Inativo',
'course-description' => 'Descrição',
'status' => "Status",
'student-name' => 'Nome',
'student-registry' => 'Matrícula',
'student-cpf' => 'CPF',
'student-email' => 'E-mail',
'student-created_at' => 'Data da Matrícula'
'student-created_at' => 'Data da Matrícula',
];

11 changes: 9 additions & 2 deletions views/curso/listar.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
<?php
foreach ($cursos ?? [] as $cada) {
$buttonEdit = translate('button-edit');
$buttonDelete = translate('button-delete');
$buttonDelete = translate('button-delete');
if ($cada->status === true) {
$label = translate('active');
$label = "<span class='badge text-bg-success'>{$label}</span>";
} else {
$label = translate('inactive');
$label = "<span class='badge text-bg-danger'>{$label}</span>";
}

echo "
<tr>
<td>{$cada->name}</td>
<td>{$cada->description}</td>
<td>{$cada->status}</td>
<td>{$label}</td>
<td>
<a href='' class='btn btn-warning btn-sm'>{$buttonEdit}</a>
<a href='/cursos/excluir?id={$cada->id}' onclick='return confirmDelete()' class='btn btn-danger btn-sm'>{$buttonDelete}</a>
Expand Down