|
@@ -2,17 +2,18 @@
|
|
|
|
|
|
|
|
class core
|
|
class core
|
|
|
{
|
|
{
|
|
|
- public static function switch(){
|
|
|
|
|
- if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
|
|
|
|
- if(isset($_POST["from"])){
|
|
|
|
|
- if($_POST["from"] == "cse.invent" AND isset($_POST["token"])){
|
|
|
|
|
- include_once "../core/submit/record.jwt.php";
|
|
|
|
|
- } elseif($_POST["from"] == "video.form.add") {
|
|
|
|
|
- include_once "../core/submit/video.add.php";
|
|
|
|
|
- } elseif($_POST["from"] == "video.form") {
|
|
|
|
|
- include_once "../core/submit/video.edit.php";
|
|
|
|
|
- } elseif($_POST["from"] == "video.cut") {
|
|
|
|
|
- include_once "../core/submit/video.cut.php";
|
|
|
|
|
|
|
+ public static function switch()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
|
|
+ if (isset($_POST["from"])) {
|
|
|
|
|
+ if ($_POST["from"] == "cse.invent" and isset($_POST["token"])) {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/submit/record.jwt.php";
|
|
|
|
|
+ } elseif ($_POST["from"] == "video.form.add") {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/submit/video.add.php";
|
|
|
|
|
+ } elseif ($_POST["from"] == "video.form") {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/submit/video.edit.php";
|
|
|
|
|
+ } elseif ($_POST["from"] == "video.cut") {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/submit/video.cut.php";
|
|
|
} else {
|
|
} else {
|
|
|
echo "Error : switch :. from else post";
|
|
echo "Error : switch :. from else post";
|
|
|
var_dump($_POST);
|
|
var_dump($_POST);
|
|
@@ -22,44 +23,43 @@ class core
|
|
|
echo "Error : switch :. from post";
|
|
echo "Error : switch :. from post";
|
|
|
exit();
|
|
exit();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- } elseif($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|
|
|
|
-
|
|
|
|
|
- if(isset($_GET["video"])){
|
|
|
|
|
- include_once "../core/page/video.show.php";
|
|
|
|
|
- } elseif(isset($_GET["preview"])){
|
|
|
|
|
- include_once "../core/page/video.preview.php";
|
|
|
|
|
- } elseif(isset($_GET["delete"])){
|
|
|
|
|
- include_once "../core/submit/video.delete.php";
|
|
|
|
|
|
|
+ } elseif ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($_GET["video"])) {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/video.show.php";
|
|
|
|
|
+ } elseif (isset($_GET["preview"])) {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/video.preview.php";
|
|
|
|
|
+ } elseif (isset($_GET["delete"])) {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/submit/video.delete.php";
|
|
|
} else {
|
|
} else {
|
|
|
- require_once "../core/controllers/session.php";
|
|
|
|
|
- include_once "../core/page/_header.php";
|
|
|
|
|
- if(empty($_GET["video"]) AND empty($_GET["preview"]) AND empty($_GET["edit"]) AND empty($_GET["cut"])){
|
|
|
|
|
- include_once "../core/page/videos.all.php";
|
|
|
|
|
- } elseif(isset($_GET["edit"]) AND $_GET["edit"] == "add"){
|
|
|
|
|
- include_once "../core/page/video.form.add.php";
|
|
|
|
|
- } elseif(isset($_GET["edit"]) AND $_GET["edit"] != "add"){
|
|
|
|
|
- include_once "../core/page/video.form.php";
|
|
|
|
|
- } elseif(isset($_GET["cut"])){
|
|
|
|
|
- include_once "../core/page/video.cut.php";
|
|
|
|
|
|
|
+ require_once ROOT_DIR . "/core/controllers/session.php";
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/_header.php";
|
|
|
|
|
+ if (empty($_GET["video"]) and empty($_GET["preview"]) and empty($_GET["edit"]) and empty($_GET["cut"])) {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/videos.all.php";
|
|
|
|
|
+ } elseif (isset($_GET["edit"]) and $_GET["edit"] == "add") {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/video.form.add.php";
|
|
|
|
|
+ } elseif (isset($_GET["edit"]) and $_GET["edit"] != "add") {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/video.form.php";
|
|
|
|
|
+ } elseif (isset($_GET["cut"])) {
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/video.cut.php";
|
|
|
} else {
|
|
} else {
|
|
|
echo "Error : switch :. from get";
|
|
echo "Error : switch :. from get";
|
|
|
exit();
|
|
exit();
|
|
|
}
|
|
}
|
|
|
- include_once "../core/page/_footer.php";
|
|
|
|
|
|
|
+ include_once ROOT_DIR . "/core/page/_footer.php";
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
echo "Error : switch";
|
|
echo "Error : switch";
|
|
|
exit();
|
|
exit();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static function print_r($_debug, int $_exit = NULL)
|
|
public static function print_r($_debug, int $_exit = NULL)
|
|
|
{
|
|
{
|
|
|
echo "<pre>";
|
|
echo "<pre>";
|
|
|
- if(is_array($_debug)) {
|
|
|
|
|
|
|
+ if (is_array($_debug)) {
|
|
|
print_r($_debug);
|
|
print_r($_debug);
|
|
|
- } elseif(is_object($_debug)){
|
|
|
|
|
|
|
+ } elseif (is_object($_debug)) {
|
|
|
var_dump($_debug);
|
|
var_dump($_debug);
|
|
|
} else {
|
|
} else {
|
|
|
echo $_debug;
|
|
echo $_debug;
|
|
@@ -68,27 +68,27 @@ class core
|
|
|
($_exit != NULL) ? exit() : NULL;
|
|
($_exit != NULL) ? exit() : NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function formatDuration(float $seconds = NULL, string $type = NULL) {
|
|
|
|
|
|
|
+ public static function formatDuration(float $seconds = NULL, string $type = NULL)
|
|
|
|
|
+ {
|
|
|
|
|
|
|
|
- if($seconds == NULL){
|
|
|
|
|
|
|
+ if ($seconds == NULL) {
|
|
|
return NULL;
|
|
return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Calculer les heures
|
|
// Calculer les heures
|
|
|
$hours = floor($seconds / 3600);
|
|
$hours = floor($seconds / 3600);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Calculer les minutes restantes après avoir soustrait les heures
|
|
// Calculer les minutes restantes après avoir soustrait les heures
|
|
|
$minutes = floor(($seconds % 3600) / 60);
|
|
$minutes = floor(($seconds % 3600) / 60);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Calculer les secondes restantes après avoir soustrait les minutes
|
|
// Calculer les secondes restantes après avoir soustrait les minutes
|
|
|
$remainingSeconds = $seconds % 60;
|
|
$remainingSeconds = $seconds % 60;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Retourner la durée formatée en "H:i:s"
|
|
// Retourner la durée formatée en "H:i:s"
|
|
|
- if($type == ":"){
|
|
|
|
|
|
|
+ if ($type == ":") {
|
|
|
return sprintf("%02d:%02d:%02d", $hours, $minutes, $remainingSeconds);
|
|
return sprintf("%02d:%02d:%02d", $hours, $minutes, $remainingSeconds);
|
|
|
} else {
|
|
} else {
|
|
|
return sprintf("%02dh %02dm %02ds", $hours, $minutes, $remainingSeconds);
|
|
return sprintf("%02dh %02dm %02ds", $hours, $minutes, $remainingSeconds);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+}
|