www/iflpanel/path.php
2024-01-01 11:20:16 +03:00

130 lines
No EOL
4.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<?php
### ERROR HANDLING ###
function warnError($errno, $errstr, $errfile, $errline)
{
echo "<br><p style='padding:0px;margin:0px;background-color:white;color:black;'><b style='color:red;'>Error:</b> [$errno] $errstr <br> in file <b style='color:blue'>$errfile</b> line <b style='color:red'>$errline</b></p>";
}
set_error_handler("warnError");
if (!$_SERVER['DOCUMENT_ROOT']) {
$_SERVER['DOCUMENT_ROOT'] = '/weblink';
}
# TODO separate file
?>
<head>
<!-- Meta Content -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="İFL/Eğitim odaklı geliştirme yol haritası">
<meta name="keywords" content="roadmap,yol haritası">
<meta name="author" content="Aliberk Sandıı">
<!-- CSS Files -->
<link rel="stylesheet" type="text/css" href="../bagis/bagis.css"> <!-- INNER CSS !!! -->
<link rel="stylesheet" type="text/css" href="/assets/css/extra_without_scss.css">
<style>
.inner-xy{
list-style-position: inside;
}
</style>
<title>
Yol Haritası | Aliberk Sandıı
</title>
<link rel="shortcut icon" href="/assets/images/icons/favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<a href="/" id="hlogo" style="margin:auto;"><img src="/assets/images/icons/favicon.png"></a>
</header>
<div class="main-scrollable">
<article class="plain" style="text-align:center;align-items:center;">
<h1 style="margin-bottom:0px;">Yol Haritası</h1>
<p>Yapacağım geliştirmelerde bana yardımcı olmak için <a href="../bagis/">bağışta</a> bulunabilirsiniz</p>
<sup>Değerlere ulaşıldıkça gerekli özellikler için çalışılmaya başlanacaktır. Bu, özelliklerin getirileceğini garanti etmez!</sup>
<div id="roadmap">
</div>
</article>
<footer>
<div class="tmpinfo">2024 &#x1f12f; Aliberk Sandıı</div>
</footer>
</div>
<?php
$dir = new DirectoryIterator($_SERVER['DOCUMENT_ROOT'] . "/assets/js");
foreach ($dir as $file) {
if ((!$file->isDot()) && str_ends_with($file, ".js") && $file != "jquery.js") {
echo '<script src="/assets/js/' . $file . '"></script>' . PHP_EOL . ' ';
}
} ?>
<script>
function b64DecodeUnicode(str) {
// Going backwards: from bytestream, to percent-encoding, to original string.
return decodeURIComponent(atob(str).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
//
// PUBLIC DATA
//
var localtest = 0;
var activeUntil;
var untilAmount;
let url2 = 'https://git.aliberksandikci.com.tr/api/v1/repos/asandikci.com/www/contents/public-data.json';
// let url2 = "http://127.0.0.1:PORT/public-data.json";
// localtest = 1;
fetch(url2)
.then(res => res.json())
.then(out => {
var publicjson;
if (localtest) {
publicjson = out[0]["public-todo"];
activeUntil = out[0]["todo-active-until"];
} else {
var cnt = out.content;
console.log("base64: " + cnt);
publicjson = JSON.parse(b64DecodeUnicode(cnt))[0]["public-todo"];
activeUntil = JSON.parse(b64DecodeUnicode(cnt))[0]["todo-active-until"];
}
publicjson.sort(function(a, b) {
return Number(Object.keys(a)) > Number(Object.keys(b));
});
console.log(publicjson);
untilAmount = Number(activeUntil);
console.log(untilAmount);
var curi = 0;
for (let i = 0; i < publicjson.length; i++) {
const element = Number(Object.keys(publicjson[i]));
document.getElementById("roadmap").innerHTML += "<p style='text-align:left; font-size:25px; font-weight: 700px; color:orange;'>"+element+"₺</p><ul>";
for (let j = 0; j < publicjson[i][element].length; j++) {
const elin = publicjson[i][element][j];
document.getElementById("roadmap").innerHTML += "<li class='inner-xy'>" + elin + "</li>";
}
document.getElementById("roadmap").innerHTML += "</ul>";
if (element >= untilAmount) {
break;
}
}
})
.catch(err => {
throw err
});
</script>
</body>
</html>