some lesson
This commit is contained in:
parent
425591aba7
commit
a4a6e36b3e
@ -570,10 +570,6 @@ video {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.relative {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-0 {
|
.left-0 {
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
@ -699,10 +695,6 @@ video {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.min-h-screen {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.w-10 {
|
.w-10 {
|
||||||
width: 2.5rem;
|
width: 2.5rem;
|
||||||
}
|
}
|
||||||
@ -814,10 +806,6 @@ video {
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overflow-hidden {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overflow-y-auto {
|
.overflow-y-auto {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
@ -883,6 +871,11 @@ video {
|
|||||||
background-color: rgb(219 234 254 / var(--tw-bg-opacity, 1));
|
background-color: rgb(219 234 254 / var(--tw-bg-opacity, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-blue-500 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1));
|
||||||
|
}
|
||||||
|
|
||||||
.bg-blue-700 {
|
.bg-blue-700 {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));
|
background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));
|
||||||
@ -1107,6 +1100,11 @@ video {
|
|||||||
transition-duration: 75ms;
|
transition-duration: 75ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hover\:bg-blue-700:hover {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));
|
||||||
|
}
|
||||||
|
|
||||||
.hover\:bg-gray-100:hover {
|
.hover\:bg-gray-100:hover {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__ . "/../model/AboutModule.php";
|
require_once __DIR__ . "/../model/MusicModule.php";
|
||||||
require_once __DIR__ . "/../view/View.php";
|
require_once __DIR__ . "/../view/View.php";
|
||||||
class AboutController
|
class AboutController
|
||||||
{
|
{
|
||||||
public function actionIndex()
|
public function actionIndex()
|
||||||
{
|
{
|
||||||
$result = AboutModel::getData();
|
$result = MusicModel::getData();
|
||||||
// var_dump($result);
|
// var_dump($result);
|
||||||
echo (View::render([
|
echo (View::render([
|
||||||
'box' => $result,
|
'box' => $result,
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require_once __DIR__ . "/../view/View.php";
|
require_once __DIR__ . "/../view/View.php";
|
||||||
class AdminController
|
class AdminController
|
||||||
{
|
{
|
||||||
@ -14,7 +12,7 @@ class AdminController
|
|||||||
isset($_SESSION['IS_AUTH'])
|
isset($_SESSION['IS_AUTH'])
|
||||||
and $_SESSION['IS_AUTH'] == true
|
and $_SESSION['IS_AUTH'] == true
|
||||||
) {
|
) {
|
||||||
echo (View::render([], 'admin.php'));
|
echo (View::render(['content' => ''], 'layout_admin.php'));
|
||||||
} else {
|
} else {
|
||||||
header("Location:http://localhost:8000/login");
|
header("Location:http://localhost:8000/login");
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ class AuthController
|
|||||||
{
|
{
|
||||||
const PASSWD = 123;
|
const PASSWD = 123;
|
||||||
const LOGIN = 'none@none.ru';
|
const LOGIN = 'none@none.ru';
|
||||||
const DOMAIN = 'http://localhost:8000/admin';
|
const DOMAIN = 'http://localhost:8000/';
|
||||||
|
|
||||||
public $login = null;
|
public $login = null;
|
||||||
public $password = null;
|
public $password = null;
|
||||||
@ -26,10 +26,10 @@ class AuthController
|
|||||||
// setcookie("password", $this->password, time() + 3600); // Истекает через 1 час
|
// setcookie("password", $this->password, time() + 3600); // Истекает через 1 час
|
||||||
// header("Set-Cookie: login=$login; Secure; Path=/; SameSite=None; Partitioned;");
|
// header("Set-Cookie: login=$login; Secure; Path=/; SameSite=None; Partitioned;");
|
||||||
// header("Set-Cookie: passwd=$password; Secure; Path=/; SameSite=None; Partitioned;");
|
// header("Set-Cookie: passwd=$password; Secure; Path=/; SameSite=None; Partitioned;");
|
||||||
header("Location:". self::DOMAIN);
|
header("Location:". self::DOMAIN."admin");
|
||||||
} else {
|
} else {
|
||||||
// редирект на форму логина с предупреждением
|
// редирект на форму логина с предупреждением
|
||||||
header("Location:http://localhost:8000/login");
|
header("Location:". self::DOMAIN."login");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -40,6 +40,9 @@ class AuthController
|
|||||||
|
|
||||||
public function actionLogout()
|
public function actionLogout()
|
||||||
{
|
{
|
||||||
echo ('print Logout');
|
// echo ('print Logout');
|
||||||
|
session_unset();
|
||||||
|
session_destroy();
|
||||||
|
header("Location:". self::DOMAIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__ . "/../model/AboutModule.php";
|
require_once __DIR__ . "/../model/MusicModel.php";
|
||||||
require_once __DIR__ . "/../view/View.php";
|
require_once __DIR__ . "/../view/View.php";
|
||||||
|
|
||||||
class MainController
|
class MainController
|
||||||
{
|
{
|
||||||
public function actionIndex() {
|
public function actionIndex() {
|
||||||
echo(View::render([], 'index_tpl.php'));
|
$result = MusicModel::getData();
|
||||||
|
echo(View::render(['box' => $result], 'index_tpl.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
35
engine/app/controller/UploadController.php
Normal file
35
engine/app/controller/UploadController.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
require_once __DIR__ . "/../view/View.php";
|
||||||
|
|
||||||
|
class UploadController
|
||||||
|
{
|
||||||
|
public function actionIndex()
|
||||||
|
{
|
||||||
|
// todo: Вынести проверку авторизации в отдельный модуль
|
||||||
|
if (
|
||||||
|
isset($_SESSION['IS_AUTH'])
|
||||||
|
and $_SESSION['IS_AUTH'] == true
|
||||||
|
) {
|
||||||
|
$portial = (View::render([], 'upload_tpl.php'));
|
||||||
|
echo (View::render(['content' => $portial], 'layout_admin.php'));
|
||||||
|
} else {
|
||||||
|
header("Location:http://localhost:8000/login");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionAddfile()
|
||||||
|
{
|
||||||
|
$uploaddir = 'C:\\Lerning\\itmo-php-course\\engine\\uploads\\';
|
||||||
|
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
||||||
|
|
||||||
|
echo '<pre>';
|
||||||
|
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
|
||||||
|
echo "Файл не содержит ошибок и успешно загрузился на сервер.\n";
|
||||||
|
} else {
|
||||||
|
echo "Возможная атака на сервер через загрузку файла!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class AboutModel
|
class MusicModel
|
||||||
{
|
{
|
||||||
static function getData()
|
static function getData()
|
||||||
{
|
{
|
||||||
$box = [];
|
$box = [];
|
||||||
if ($handle = opendir('./upload')) {
|
if ($handle = opendir('./uploads')) {
|
||||||
while (false !== ($entry = readdir($handle))) {
|
while (false !== ($entry = readdir($handle))) {
|
||||||
$ext = pathinfo($entry, PATHINFO_EXTENSION);
|
$ext = pathinfo($entry, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
if ($ext == 'mp3') {
|
if ($ext == 'mp3') {
|
||||||
array_push($box, "./upload/$entry");
|
array_push($box, "./uploads/$entry");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
Тип кодирования данных, enctype, требуется указывать только так, как показывает пример
|
|
||||||
<form enctype="multipart/form-data" action="file_upload.php" method="POST">
|
|
||||||
Поле MAX_FILE_SIZE требуется указывать перед полем загрузки файла
|
|
||||||
<input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
|
|
||||||
Название элемента input определяет название элемента в суперглобальном массиве $_FILES
|
|
||||||
Отправить файл: <input name="userfile" type="file" />
|
|
||||||
<input type="submit" value="Отправить файл" />
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white" for="file_input">Upload file</label>
|
|
||||||
<input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400" aria-describedby="file_input_help" id="file_input" type="file" value="Отправить файл">
|
|
||||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-300" id="file_input_help">SVG, PNG, JPG or GIF (MAX. 800x400px).</p>
|
|
@ -34,6 +34,51 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
<div class="flex border-b">
|
||||||
|
<button id="tab1" class="px-4 py-2 border-b-2 border-blue-500 text-blue-500 font-medium active" onclick="showTab('tab1')">Classic</button>
|
||||||
|
<button id="tab2" class="px-4 py-2 border-b-2 border-transparent text-gray-500 font-medium hover:text-gray-700 hover:border-gray-300" onclick="showTab('tab2')">Jazz</button>
|
||||||
|
<button id="tab3" class="px-4 py-2 border-b-2 border-transparent text-gray-500 font-medium hover:text-gray-700 hover:border-gray-300" onclick="showTab('tab3')">Rock</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="content1" class="p-4">
|
||||||
|
<?php foreach ($box as $item): ?>
|
||||||
|
<audio controls>
|
||||||
|
<source src="<?php echo $item; ?>" type="audio/mpeg">
|
||||||
|
</audio>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<div id="content2" class="p-4 hidden">
|
||||||
|
Содержимое вкладки 2
|
||||||
|
</div>
|
||||||
|
<div id="content3" class="p-4 hidden">
|
||||||
|
Содержимое вкладки 3
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function showTab(tabId) {
|
||||||
|
const tabs = document.querySelectorAll('.flex button');
|
||||||
|
const contents = document.querySelectorAll('.p-4');
|
||||||
|
|
||||||
|
tabs.forEach(tab => {
|
||||||
|
tab.classList.remove('active');
|
||||||
|
tab.classList.remove('border-blue-500');
|
||||||
|
tab.classList.remove('text-blue-500');
|
||||||
|
tab.classList.add('border-transparent');
|
||||||
|
tab.classList.add('text-gray-500');
|
||||||
|
});
|
||||||
|
|
||||||
|
contents.forEach(content => {
|
||||||
|
content.classList.add('hidden');
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById(tabId).classList.add('active');
|
||||||
|
document.getElementById(tabId).classList.add('border-blue-500');
|
||||||
|
document.getElementById(tabId).classList.add('text-blue-500');
|
||||||
|
document.getElementById(tabId).classList.remove('border-transparent');
|
||||||
|
document.getElementById(tabId).classList.remove('text-gray-500');
|
||||||
|
document.getElementById(`content${tabId.slice(-1)}`).classList.remove('hidden');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
|
||||||
|
<link rel="stylesheet" href="./../../app/assets/css/styles.css">
|
||||||
<title>Resposive Layout</title>
|
<title>Resposive Layout</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -56,31 +57,22 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
<a href="./upload" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
||||||
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 18 20">
|
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 18 20">
|
||||||
<path d="M17 5.923A1 1 0 0 0 16 5h-3V4a4 4 0 1 0-8 0v1H2a1 1 0 0 0-1 .923L.086 17.846A2 2 0 0 0 2.08 20h13.84a2 2 0 0 0 1.994-2.153L17 5.923ZM7 9a1 1 0 0 1-2 0V7h2v2Zm0-5a2 2 0 1 1 4 0v1H7V4Zm6 5a1 1 0 1 1-2 0V7h2v2Z" />
|
<path d="M17 5.923A1 1 0 0 0 16 5h-3V4a4 4 0 1 0-8 0v1H2a1 1 0 0 0-1 .923L.086 17.846A2 2 0 0 0 2.08 20h13.84a2 2 0 0 0 1.994-2.153L17 5.923ZM7 9a1 1 0 0 1-2 0V7h2v2Zm0-5a2 2 0 1 1 4 0v1H7V4Zm6 5a1 1 0 1 1-2 0V7h2v2Z" />
|
||||||
</svg>
|
</svg>
|
||||||
<span class="flex-1 ms-3 whitespace-nowrap">Products</span>
|
<span class="flex-1 ms-3 whitespace-nowrap">Загрузка</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
<a href="./logout" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
||||||
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 16">
|
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 16">
|
||||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 8h11m0 0L8 4m4 4-4 4m4-11h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-3" />
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 8h11m0 0L8 4m4 4-4 4m4-11h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-3" />
|
||||||
</svg>
|
</svg>
|
||||||
<span class="flex-1 ms-3 whitespace-nowrap">Sign In</span>
|
<span class="flex-1 ms-3 whitespace-nowrap">Log Out</span>
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
|
||||||
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
|
||||||
<path d="M5 5V.13a2.96 2.96 0 0 0-1.293.749L.879 3.707A2.96 2.96 0 0 0 .13 5H5Z" />
|
|
||||||
<path d="M6.737 11.061a2.961 2.961 0 0 1 .81-1.515l6.117-6.116A4.839 4.839 0 0 1 16 2.141V2a1.97 1.97 0 0 0-1.933-2H7v5a2 2 0 0 1-2 2H0v11a1.969 1.969 0 0 0 1.933 2h12.134A1.97 1.97 0 0 0 16 18v-3.093l-1.546 1.546c-.413.413-.94.695-1.513.81l-3.4.679a2.947 2.947 0 0 1-1.85-.227 2.96 2.96 0 0 1-1.635-3.257l.681-3.397Z" />
|
|
||||||
<path d="M8.961 16a.93.93 0 0 0 .189-.019l3.4-.679a.961.961 0 0 0 .49-.263l6.118-6.117a2.884 2.884 0 0 0-4.079-4.078l-6.117 6.117a.96.96 0 0 0-.263.491l-.679 3.4A.961.961 0 0 0 8.961 16Zm7.477-9.8a.958.958 0 0 1 .68-.281.961.961 0 0 1 .682 1.644l-.315.315-1.36-1.36.313-.318Zm-5.911 5.911 4.236-4.236 1.359 1.359-4.236 4.237-1.7.339.341-1.699Z" />
|
|
||||||
</svg>
|
|
||||||
<span class="flex-1 ms-3 whitespace-nowrap">Sign Up</span>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
@ -112,9 +104,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-center h-48 mb-4 rounded bg-gray-50 dark:bg-gray-800">
|
<div class="flex items-center justify-center h-48 mb-4 rounded bg-gray-50 dark:bg-gray-800">
|
||||||
<p class="text-2xl text-gray-400 dark:text-gray-500">
|
<p class="text-2xl text-gray-400 dark:text-gray-500">
|
||||||
<svg class="w-3.5 h-3.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
|
<?php if ($content): ?>
|
||||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16" />
|
<?php echo $content ?>
|
||||||
</svg>
|
<?php else: ?>
|
||||||
|
<?php echo "Нужен контент" ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-2 gap-4 mb-4">
|
<div class="grid grid-cols-2 gap-4 mb-4">
|
@ -29,7 +29,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<label for="email" class="block text-sm text-gray-800">Email</label>
|
<label for="email" class="block text-sm text-gray-800">Email</label>
|
||||||
<input type="email"
|
<input type="email"
|
||||||
class="block w-full px-4 py-2 mt-2 text-purple-700 bg-white border rounded-md focus:border-purple-400 focus:ring-purple-300 focus:outline-none focus:ring focus:ring-opacity-40" name="login">
|
class="block w-full px-4 py-2 mt-2 text-purple-700 bg-white border rounded-md focus:border-purple-400 focus:ring-purple-300 focus:outline-none focus:ring focus:ring-opacity-40" name="login" value="none@none.ru">
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,39 +1,50 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title><?php echo $pageTitle; ?></title>
|
<title><?php echo $pageTitle; ?></title>
|
||||||
<style>
|
<style>
|
||||||
body { font-family: sans-serif; }
|
body {
|
||||||
.audio-player { margin-bottom: 10px; }
|
font-family: sans-serif;
|
||||||
.logout, .login { margin-bottom: 10px; }
|
}
|
||||||
|
|
||||||
|
.audio-player {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout,
|
||||||
|
.login {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php if ($auth): ?>
|
<?php if ($auth): ?>
|
||||||
<div class="logout"><a href="logout.php">Выход</a></div>
|
<div class="logout"><a href="logout.php">Выход</a></div>
|
||||||
<?php else: ?>
|
|
||||||
<div class="login"><a href="login.php">Вход</a></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$audioFiles = $box; // Переименовали переменную для ясности
|
|
||||||
foreach ($audioFiles as $file):
|
|
||||||
if (file_exists($file)) : ?>
|
|
||||||
<div class="audio-player">
|
|
||||||
<audio controls="controls">
|
|
||||||
<source src="<?php echo htmlspecialchars($file); ?>" type="audio/mpeg">
|
|
||||||
Ваш браузер не поддерживает HTML5 audio.
|
|
||||||
</audio>
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<p>Файл "<?php echo htmlspecialchars($file); ?>" не найден.</p>
|
<div class="login"><a href="login.php">Вход</a></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$audioFiles = $box; // Переименовали переменную для ясности
|
||||||
|
foreach ($audioFiles as $file):
|
||||||
|
if (file_exists($file)) : ?>
|
||||||
|
<div class="audio-player">
|
||||||
|
<audio controls="controls">
|
||||||
|
<source src="<?php echo htmlspecialchars($file); ?>" type="audio/mpeg">
|
||||||
|
Ваш браузер не поддерживает HTML5 audio.
|
||||||
|
</audio>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<p>Файл "<?php echo htmlspecialchars($file); ?>" не найден.</p>
|
||||||
<?php endif;
|
<?php endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
11
engine/app/template/upload_tpl.php
Normal file
11
engine/app/template/upload_tpl.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form enctype="multipart/form-data" action="file_upload" method="POST">
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="30000000" />
|
||||||
|
|
||||||
|
Отправить файл: <input name="userfile" type="file" />
|
||||||
|
|
||||||
|
<input class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" type="submit" value="Отправить файл" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white" for="file_input">Upload file</label>
|
||||||
|
<input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400" aria-describedby="file_input_help" id="file_input" type="file" value="Отправить файл">
|
||||||
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-300" id="file_input_help">SVG, PNG, JPG or GIF (MAX. 800x400px).</p> -->
|
@ -4,9 +4,12 @@ return array(
|
|||||||
'news' => 'news/index', // actionIndex в NewsController
|
'news' => 'news/index', // actionIndex в NewsController
|
||||||
'products' => 'product/list', // actionList в ProductController
|
'products' => 'product/list', // actionList в ProductController
|
||||||
'about' => 'about/index',
|
'about' => 'about/index',
|
||||||
'admin' => 'admin/index',
|
|
||||||
'login' => 'login/index',
|
'login' => 'login/index',
|
||||||
|
'admin' => 'admin/index',
|
||||||
'auth' => 'auth/login',
|
'auth' => 'auth/login',
|
||||||
|
'logout' => 'auth/logout',
|
||||||
|
'upload' => 'upload/index',
|
||||||
|
'file_upload' => 'upload/addfile',
|
||||||
);
|
);
|
||||||
// - где 'news' - строка запроса
|
// - где 'news' - строка запроса
|
||||||
// 'news/index' - имя контроллера и экшена для обработки этого запроса (путь обработчика)
|
// 'news/index' - имя контроллера и экшена для обработки этого запроса (путь обработчика)
|
||||||
|
BIN
engine/uploads/Схема Rally.pdf
Normal file
BIN
engine/uploads/Схема Rally.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user