workArea.php
1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
session_start();
if($_SESSION['name']){
echo"<br>" . "Bienvenue sur la gestion de documents de l'application SSR Marc Sautelet!" ."<br>". "Username: " . $_SESSION['name'] ."<p>";
if($_SESSION['name'] == "Administrateur")
{
echo "<a href='register.php'>Click here to register a new member</a>" ."<p>";
echo "<a href='deleteMember.php'>Click here to delete a member</a>" ."<p>";
}
echo "<a href='logout.php'>Click here to logout</a>";
}else header('Location: index.php');
?>
<html>
<table>
<tr>
<form action="create_file.php" method="post">
<P><FONT face="Verdana" color="black" size="4">Create new HTML File</FONT>
<br><br>File name: <input type="text" name="name" required>
<input type="submit" value="Create File">
</form>
</tr>
<tr>
<td>
<form action="upload.php" method="POST"enctype="multipart/form-data">
<P><FONT face="Verdana" color="black" size="4">Upload new file (.html, .jpg, .png...)</FONT>
<br><br><input type="file" name="upload" required>
<input type="submit" value="Save">
</form>
</td>
</tr>
</table>
<br><P><FONT face="Verdana" color="blue" size="3">List of files</FONT><br>
<P><FONT face="Verdana" color="#FF3300" size="2">HTML Files:</FONT><br>
<?php
foreach (glob("*.html") as $file){
echo "<a href='$file'target='_blank'>$file</a> ---> <a href='edit.php?name=$file'>Edit</a> ---> <a href='delete.php?name=$file'>Delete</a>" . "<br>";
}
?>
<P><FONT face="Verdana" color="#FF3300" size="2">Images Files:</FONT><br>
<?php
foreach (glob("*.{jpg,jpeg,gif,png,PNG,GIF,JPG,JPEG}", GLOB_BRACE) as $file){
echo "<a href='$file' target='_blank'>$file</a> ---> <a href='delete.php?name=$file'>Delete</a>" . "<br>";
}
?>
</html>