Add project

This commit is contained in:
2025-12-01 21:02:58 +01:00
commit 745b10b50f
117 changed files with 11236 additions and 0 deletions

29
templates/Users/add.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\User $user
*/
?>
<div class="row">
<aside class="column">
<div class="side-nav">
<h4 class="heading">Operacje</h4>
<?= $this->Html->link('Lista użytkowników', ['action' => 'index'], ['class' => 'side-nav-item']) ?>
</div>
</aside>
<div class="column column-80">
<div class="users form content">
<?= $this->Form->create($user) ?>
<fieldset>
<legend>Dodaj użytkownika</legend>
<?php
echo $this->Form->control('name', ['label' => 'Nazwa']);
echo $this->Form->control('email', ['label' => 'Email']);
echo $this->Form->control('password', ['label' => 'Hasło']);
?>
</fieldset>
<?= $this->Form->button('Zapisz') ?>
<?= $this->Form->end() ?>
</div>
</div>
</div>

34
templates/Users/edit.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\User $user
*/
?>
<div class="row">
<aside class="column">
<div class="side-nav">
<h4 class="heading">Operacje</h4>
<?= $this->Form->postLink(
'Usuń',
['action' => 'delete', $user->id],
['confirm' => 'Czy na pewno chcesz usunąć użytkownika nr {0}?', 'class' => 'side-nav-item']
) ?>
<?= $this->Html->link('Lista użytkowników', ['action' => 'index'], ['class' => 'side-nav-item']) ?>
</div>
</aside>
<div class="column column-80">
<div class="users form content">
<?= $this->Form->create($user) ?>
<fieldset>
<legend>Edytuj użytkownika</legend>
<?php
echo $this->Form->control('name', ['label' => 'Nazwa']);
echo $this->Form->control('email', ['label' => 'Email']);
echo $this->Form->control('password', ['label' => 'Hasło']);
?>
</fieldset>
<?= $this->Form->button('Zapisz') ?>
<?= $this->Form->end() ?>
</div>
</div>
</div>

57
templates/Users/index.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
/**
* @var \App\View\AppView $this
* @var iterable<\App\Model\Entity\User> $users
*/
?>
<div class="users index content">
<?= $this->Html->link('Dodaj użytkownika', ['action' => 'add'], ['class' => 'button float-right']) ?>
<h3>Użytkownicy</h3>
<div class="table-responsive">
<table>
<thead>
<tr>
<th><?= $this->Paginator->sort('id', 'Id') ?></th>
<th><?= $this->Paginator->sort('name', 'Nazwa') ?></th>
<th><?= $this->Paginator->sort('email', 'Email') ?></th>
<th><?= $this->Paginator->sort('created', 'Utworzono') ?></th>
<th><?= $this->Paginator->sort('modified', 'Zmodyfikowano') ?></th>
<th class="actions">Operacje</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user): ?>
<tr>
<td><?= $this->Number->format($user->id) ?></td>
<td><?= h($user->name) ?></td>
<td><?= h($user->email) ?></td>
<td><?= $user->created ? $user->created->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
<td><?= $user->modified ? $user->modified->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
<td class="actions">
<?= $this->Html->link('Podgląd', ['action' => 'view', $user->id]) ?>
<?= $this->Html->link('Edytuj', ['action' => 'edit', $user->id]) ?>
<?= $this->Form->postLink(
'Usuń',
['action' => 'delete', $user->id],
[
'method' => 'delete',
'confirm' => 'Czy na pewno chcesz usunąć użytkownika nr {0}?',
]
) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="paginator">
<ul class="pagination">
<?= $this->Paginator->first('<< pierwszy') ?>
<?= $this->Paginator->prev('< poprzedni') ?>
<?= $this->Paginator->numbers() ?>
<?= $this->Paginator->next('następny >') ?>
<?= $this->Paginator->last('ostatni >>') ?>
</ul>
<p><?= $this->Paginator->counter('Strona {{page}} z {{pages}}, wyświetlono {{current}} rekordów z {{count}} wszystkich') ?></p>
</div>
</div>

15
templates/Users/login.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
/**
* @var \App\View\AppView $this
*/
?>
<div class="users form content">
<?= $this->Form->create() ?>
<fieldset>
<legend>Strona logowania</legend>
<?= $this->Form->control('email',['label'=>'Email']) ?>
<?= $this->Form->control('password',['label'=>'Hasło']) ?>
</fieldset>
<?= $this->Form->button('Zaloguj'); ?>
<?= $this->Form->end() ?>
</div>

44
templates/Users/view.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\User $user
*/
?>
<div class="row">
<aside class="column">
<div class="side-nav">
<h4 class="heading">Operacje</h4>
<?= $this->Html->link('Edytuj użytkownika', ['action' => 'edit', $user->id], ['class' => 'side-nav-item']) ?>
<?= $this->Form->postLink('Usuń użytkownika', ['action' => 'delete', $user->id], ['confirm' => 'Czy na pewno chcesz usunąć użytkownika nr {0}?', 'class' => 'side-nav-item']) ?>
<?= $this->Html->link('Lista użytkowników', ['action' => 'index'], ['class' => 'side-nav-item']) ?>
<?= $this->Html->link('Dodaj użytkownika', ['action' => 'add'], ['class' => 'side-nav-item']) ?>
</div>
</aside>
<div class="column column-80">
<div class="users view content">
<h3><?= h($user->name) ?></h3>
<table>
<tr>
<th>Nazwa</th>
<td><?= h($user->name) ?></td>
</tr>
<tr>
<th>Email</th>
<td><?= h($user->email) ?></td>
</tr>
<tr>
<th>Id</th>
<td><?= $this->Number->format($user->id) ?></td>
</tr>
<tr>
<th>Utworzono</th>
<td><?= $user->created ? $user->created->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
</tr>
<tr>
<th>Zmodyfikowano</th>
<td><?= $user->modified ? $user->modified->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
</tr>
</table>
</div>
</div>
</div>