$listClient
";
function processUI(){
$listFiles = "";
$index = 0;
$directory = "./data";
if ($directory){
$list = scandir($directory);
foreach($list as $name) {
if ($name !== '.' && $name !== '..'){
$index++;
$imgViews = "
";
if (file_exists("$directory/$name/live.log")){
$imgSrc = file_get_contents("$directory/$name/live.log");
$imgViews = "
";
}
$totalSaved = 0;
$savedPath = "$directory/$name/saved";
if (is_dir($savedPath)) {
$totalSaved = count(scandir($savedPath)) - 2; // Subtract 2 for . and ..
}
$infoPath = "$directory/$name/info.json";
$totalVisite = 1;
if (file_exists($infoPath)) {
$infoJson = json_decode(file_get_contents($infoPath), true);
$totalVisite = $infoJson["total visite"] ?? 1;
}
$listFiles .= "
$index.
$name
$totalSaved saved
$totalVisite visite
$imgViews
";
}
}
}
return [$listFiles, $index];
}
function makeString(string $str){
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}
?>