AliceClass/_layouts/dashboard.php

51 lines
1.3 KiB
PHP
Raw Normal View History

2024-08-05 17:20:51 -03:00
---
layout: default
lang: pt
---
<?php
// Autenticação básica HTTP para obter o nome de usuário
$username = $_SERVER['PHP_AUTH_USER'];
//$username = "fls";
$target_dir = "/var/www/html/aliceclass_videos/" . $username;
# check if user dir exists
if (!file_exists($target_dir)) {
# if not, create it
if (mkdir($target_dir, 0775, true)) {
// echo "Directory created successfully.";
}
if (mkdir($target_dir . "/src", 0775, true)) {
// echo "Directory created successfully.";
}
if (mkdir($target_dir . "/dest", 0775, true)) {
// echo "Directory created successfully.";
}
}
// Verifica se o diretório existe
if (is_dir($target_dir)) {
// Obtém a lista de arquivos
$files = scandir($target_dir . "/dest");
// Remove os elementos '.' e '..' da lista de arquivos
$files = array_diff($files, array('.', '..'));
// Conta a quantidade de arquivos restantes
$file_count = count($files);
}
?>
<div class="dashboard-content">
<div class="banner">
<h1>Bem vindo <?php echo $username; ?> </h1>
</div>
<div class="menu">
<a class="button" href="{{ site.baseurl }}/dashboard/home.php" >Início</a>
<a class="button" href="{{ site.baseurl }}/dashboard/upload.php" >Criar aula</a>
</div>
{{ content }}
</div>