[MVC] Полная миграция на MVC архитектуру
- Создано ядро MVC: App, Router, Controller, Model, View, Database - Созданы модели: User, Product, Category, Cart, Order - Созданы контроллеры: Home, Auth, Product, Cart, Order, Page, Admin - Созданы layouts и partials для представлений - Добавлены все views для страниц - Настроена маршрутизация с чистыми URL - Обновлена конфигурация Docker и Apache для mod_rewrite - Добавлена единая точка входа public/index.php
This commit is contained in:
43
app/Views/admin/users/index.php
Normal file
43
app/Views/admin/users/index.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php use App\Core\View; ?>
|
||||
|
||||
<h2>Пользователи</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>ФИО</th>
|
||||
<th>Email</th>
|
||||
<th>Телефон</th>
|
||||
<th>Город</th>
|
||||
<th>Роль</th>
|
||||
<th>Регистрация</th>
|
||||
<th>Последний вход</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users as $u): ?>
|
||||
<tr>
|
||||
<td><?= $u['user_id'] ?></td>
|
||||
<td><?= htmlspecialchars($u['full_name'] ?? '-') ?></td>
|
||||
<td><?= htmlspecialchars($u['email']) ?></td>
|
||||
<td><?= htmlspecialchars($u['phone'] ?? '-') ?></td>
|
||||
<td><?= htmlspecialchars($u['city'] ?? '-') ?></td>
|
||||
<td>
|
||||
<?php if ($u['is_admin']): ?>
|
||||
<span style="background: #617365; color: white; padding: 3px 10px; border-radius: 4px; font-size: 12px;">
|
||||
<i class="fas fa-user-shield"></i> Админ
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<span style="background: #28a745; color: white; padding: 3px 10px; border-radius: 4px; font-size: 12px;">
|
||||
<i class="fas fa-user"></i> Пользователь
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= $u['created_at'] ? View::formatDateTime($u['created_at']) : '-' ?></td>
|
||||
<td><?= $u['last_login'] ? View::formatDateTime($u['last_login']) : 'Не было' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user