<?php
    $id = "login";
    if (isset($_REQUEST["id"])){
        $id = $_REQUEST["id"];
    }
    $sid = "main";
    if (isset($_REQUEST["sid"]))
        $sid = $_REQUEST["sid"];
?>

<!DOCTYPE html>
<html lang="es">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/ico" href="./img/favicon.png"/>
    
    <!--Recursos-->
    <link rel="stylesheet" href="./hooks/tags-input/tags-input.css">
    <script src="./hooks/tags-input/tags-input.js"></script>
    <script src="./hooks/ckeditor5custom/build/ckeditor.js"></script>
    
    <link rel="stylesheet" href="./css/main.css?v=4">
    <link rel="stylesheet" href="./fonts/fonts.css">
    <link href="./css/font-awesome/all.css" rel="stylesheet">
    
<?php
    if (file_exists("./css/".$id.".css")){
        echo ('<link rel="stylesheet" href="./css/'.$id.'.css?v=4">');
    }
    if (file_exists("./css/".$id."/".$sid.".css")){
        echo ('<link rel="stylesheet" href="./css/'.$id."/".$sid.'.css?v=4">');
    }
?>
    <title>AFX - CMS</title>
</head>
<body>
<?php
    if (file_exists("./content/".$id.".php")){
        include_once("./content/".$id.".php");
    }
?>
<script type="text/javascript" src="./hooks/icons.js"></script>
<script type="text/javascript" src="./js/main.js?v=4"></script>
<?php  
    /***JS***/
    if (file_exists("./js/".$id.".js")){
        echo ('<script type="text/javascript" src="./js/'.$id.'.js?v=4"></script>');
    }
    if (file_exists("./js/".$id."/".$sid.".js")){
        echo ('<script type="text/javascript" src="./js/'.$id.'/'.$sid.'.js?v=4"></script>');
    }
?>
</body>
</html>