<!--

https://www.webslesson.info/2017/07/php-filesystem-with-ajax-jquery.html#google_vignette

https://www.webslesson.info/2024/07/efficient-task-management-system-in-php-with-source-code.html

https://codewithawa.com/posts/user-account-management,-roles,-permissions,-authentication-php-and-mysql---part-3

// share documents

User account management, roles, permissions,

// https://sourcecodehero.com/category/php/


https://webscodex.medium.com/creating-multi-user-role-based-admin-using-php-mysql-and-bootstrap-dbebf2740411

https://codewithawa.com/posts/admin-and-user-login-in-php-and-mysql-database


session_start();
if (!isset($_SESSION["email"])) {
    header("location: /login.php");
}

if ($_SESSION["role"] == "user") {
    header("location: /user_page.php");
}
if ($_SESSION["role"] == "manager") {
    header("location: /managerpage.php");
}

-->

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/>
		<link rel="stylesheet" type="text/css" href="bootstrap.css"/>
	</head>
<body>
	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<a class="navbar-brand" href="https://www.google.fr/">Dossiers</a>
		</div>
	</nav>
	<div class="col-md-3"></div>
	<div class="col-md-6 well">
		<h3 class="text-primary">Dynamically Create Folder Using PHP Source Code</h3>
		<hr style="border-top:1px dotted #ccc;"/>
		<div class="col-md-4">
			<form method="POST" action="create_folder01.php">
				<div class="form-group">
					<label>Enter a text</label>
					<input type="text" name="dir" class="form-control">
				</div>
				<center><button class="btn btn-primary" name="create">Create</button></center>
			</form>
		</div>
		<div class="col-md-8">
			<table class="table table-bordered">
				<thead class="alert-info">
					<tr>
						<th>Folder</th>
						<th>Location</th>
					</tr>
				</thead>
				<tbody>
					<?php
						$files = scandir('folders');
						foreach($files as $file){
							if($file != "." && $file != ".."){
					?>
						<tr>
							<td><?php echo $file."<br />";?></td>
							<td><?php echo realpath('folders/'.$file) ?></td>
						</tr>
					<?php
							}
 
						}
					?>
 
				</tbody>
			</table>
		</div>
	</div>
</body>
</html>