<?php
    error_reporting(0);

    if(!isset($_SESSION)){ 
        session_start(); 
    }

    if($_SESSION['perfil_estrategia']==""){
        header('Location:../');
    }


    include "./js/conectpoo.php";
    include "./funciones.php";

    $kueryimgeperfil = "SELECT * FROM `imagenes` WHERE `id_usr` = ".$_SESSION['id_estrategia']." AND `perfil` = ".$_SESSION['perfil_estrategia']." ORDER BY `imagenes`.`id_imagenes` DESC";
    $objetoimg= new db();
    
    $imageperfilresult=$objetoimg->consultaregistros($kueryimgeperfil);
    $imagenperfil = "imgperfil/".$imageperfilresult[0]["imagen"];

    if($imagenperfil=="imgperfil/"){
        $imagenperfil = "imgperfil/img.jpg";
    }

    if (isset($_SESSION['perfil_estrategia'])) {
        $menu_estrategia = getmenu();
    }else{}

    $kueryimgeperfilq = "SELECT * FROM `empresa`";
    $objetoimgq= new db();
    $resultq=$objetoimgq->consultaregistros($kueryimgeperfilq);
    $tituloherramienta = $resultq[0]["nombre"];

    $host= $_SERVER["HTTP_HOST"];
    $url= $_SERVER["REQUEST_URI"];
    $rest = substr($url, 24, -4);

    $nombreusuario = $_SESSION['nombre_estrategia'];
    $mensaje="Mensaje de Alerta";

    $varfirst=<<<jjj
        <!DOCTYPE html>
            <html lang="en">
                <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                    <!-- Meta, title, CSS, favicons, etc. -->
                    <meta charset="utf-8">
                    <meta http-equiv="X-UA-Compatible" content="IE=edge">
                    <meta name="viewport" content="width=device-width, initial-scale=1">

                    <title>Inicio : $tituloherramienta</title>
                    <link rel="icon" href="imgperfil/tool-copia.png">
        
                    <!-- Bootstrap -->
                    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
                    <!-- Font Awesome -->
                    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
                    <!-- NProgress -->
                    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">

                    <!-- Custom Theme Style -->
                    <link href="../build/css/custom.min.css" rel="stylesheet">

                    <!-- Datatables -->
                    <link href="../vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
                    <link href="../vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
                    <link href="../vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
                    <link href="../vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
                    <link href="../vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">
    
                    <style>
                        .ddh6{
                            color:white;font-family: "Tw Cen MT";font-size: 1.8em;     width: 100%;
                        }

                        img{
                            align-content:center;
                        }
        
                        .prueba{
                            //border-radius: 40px;
                            //background: #FFFFFF;
                            background-image: url("imgperfil/logo-menu.jpg");
                            background-position: center;
                            padding: 11%;//px; 
                            width: 100%;
                            height: 90px;
                            margin: 0 auto;
                            position:absolute;
                            text-align: center;
                        }
                </style>    
            </head>
            
            <!--3A4050-->
            <body class="nav-md" style="background-color:#173548">
                <div class="container body">
                    <div class="main_container" style="background-color:#161617">            
                        <div class="col-md-3 left_col">
                            <a href="home.php">
                                    <div class="left_col scroll-view" style="background-color:#161617; width:100%">
                                        <div class="navbar prueba" style="background-color:#173548"></div>
                                        </a>
                                        <br><br>
                                        <div class="clearfix"></div>

                                        <!-- menu profile quick info -->
                                        <div class="profile clearfix">
                                            <div class="profile_info"><br></div>
                                            <div class="clearfix"></div>
                                        </div>
            
                                        <!-- /menu profile quick info -->
                                        <br/>
                                        <!-- sidebar menu -->
                                        <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                                            <div class="menu_section">
                                                <h3>Menú</h3><br>
                                                <ul class="nav side-menu">
                                                    $menu_estrategia
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                        </div>

                        <!-- top navigation -->
                        <div class="top_nav">
                            <div class="nav_menu" style="background-color:linear-gradient(#000000, #F7FBF7)">
                                <nav>
                                    <div class="nav toggle">
                                        <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                                    </div>

                                    <ul class="nav navbar-nav navbar-right">
                                        <li class="">
                                            <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                                <img src="$imagenperfil" alt="">$nombreusuario
                                                <span class=" fa fa-angle-down"></span>
                                            </a>
                                            
                                            <ul class="dropdown-menu dropdown-usermenu pull-right">
                                                <li><a href="perfil.php"> Perfil</a></li>
                                                <li>
                                                    <a href="configuracion.php">
                                                        <span>Configuración</span>
                                                    </a>
                                                </li>
                                                <li><a href="../"><i class="fa fa-sign-out pull-right"></i>Salir</a></li>
                                            </ul>
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                    </div>
jjj;

$varend =<<<kkk
    <footer>
        <div class="pull-right">
            by J&R Consultores - v3.0.0
        </div>
        <div class="clearfix"></div>
    </footer>
    
    <!-- /footer content -->
    </div></div>

    <!-- jQuery -->
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
    
    <!-- Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
    <script src="../js/functions.js"></script>

    <!-- Datatables -->
    <script src="../vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="../vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="../vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="../vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="../vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="../vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="../vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="../vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
    <script src="../vendors/jszip/dist/jszip.min.js"></script>
    <script src="../vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="../vendors/pdfmake/build/vfs_fonts.js"></script>
kkk;

    $cerrarend=<<<jjj
            </body>
        </html>
jjj;

?>