Зачатки MVC

This commit is contained in:
lopar
2020-07-04 13:49:43 +03:00
parent 25a6f17d7e
commit c6316820a0
6 changed files with 146 additions and 3 deletions
+6 -3
View File
@@ -1,7 +1,7 @@
<?php
session_start();
include_once 'functions.php';
include_once 'models/PresentsModel.php';
//$login = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
$login = urldecode($_SERVER['QUERY_STRING']) ?? '';
$uid = $_SESSION['uid'] ?? null;
@@ -22,6 +22,9 @@ function private_access($uid)
return false;
}
$presentsModel = new PresentsModel();
$presentsList = $presentsModel->getAllPresents($user->id);
if (empty($user->id)): ?>
<!doctype html>
<html lang="ru">
@@ -49,7 +52,7 @@ if (empty($user->id)): ?>
<table width=100%>
<tr>
<td style="width: 250px; vertical-align: top;">
<?php /*echo showinf_pers($user['id']);*/
<?php echo showinf_pers($user['id']);
if (!empty($user->married)): ?>
<a href="inf.php?<?= $user->married ?>" target=_blank>
<img alt="В браке с <?= $user->married ?>" src="i/married.gif"
@@ -79,7 +82,7 @@ if (!empty($user->realname)) {
?>
<p style="font-family: Consolas,monospace;"><?= nl2br($user->info) ?></p>
<hr>
<?php $user->showPresents(); ?>
<?php include_once 'views/presents-list.php'; ?>
<?php
# Секретный раздел
# Если я любой паладин, и смотрю не админа, или я сам админ.