<?php 
   error_reporting(0);
   ini_set('display_errors','On');
   define('_JEXECGS',1);
   require($_SERVER['DOCUMENT_ROOT'].'/shine/'.'configuracion/'.'config.php');
   session_start();
   if(!isset($_SESSION['tip_cambiar'])){
   	session_destroy();
   	header('Location: http://'.$_SERVER['HTTP_HOST'].'/shine/login.php');
   	exit;
   }
   /*
   if(isset($_SESSION['tip_cambiar']) && $_SESSION['tip_cambiar']==1){
   	header('Location: http://'.$_SERVER['HTTP_HOST'].'/DocumentosElectronicos/index.php?opt=clave');
   	exit;
   }*/
   ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
       <!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
      <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
      <meta name="lang" content="en">
      <link rel="shortcut icon" href="favicon.ico">
      <meta name="robots" content="index, follow">
      <meta name="keywords" content="facturación electrónica">
      <meta name="description" content="Facturación electrónica">
      <title><?php echo $CONF_site_name; ?></title>
      <link href="script/maqueta.css" rel="stylesheet" type="text/css">
      <link href="script/styles.css" rel="stylesheet" type="text/css">
      <script type="text/javascript" src="script/funciones.js"></script>
      <link href='http://fonts.googleapis.com/css?family=Arimo' rel='stylesheet' type='text/css'>
      <link href='script/frm.css' rel='stylesheet' type='text/css'>
      <link rel="stylesheet" href="script/jquery-ui.css" type="text/css" >
      <script type="text/javascript" src="script/jquery-1.11.1.min.js"></script>
      <script type="text/javascript" src="script/jquery.dataTables.min.js"></script>
      <link href="script/jquery.dataTables.css" rel="stylesheet" type="text/css">
      <script type="text/javascript" src="script/jquery-ui.js"></script>
      <script type="text/javascript">
         function MET_Salir(){
         	var ruta = 'controller/ctrlUsuario.php?opt=salir';	
         	document.frm.action = ruta;
         	document.frm.submit();
         }
      </script>
      
      <style>
                      .h2, h2 {
    font-size: 15px!important;
}
      </style>
      
      
      <?php
         if(isset($_SESSION['msj_sistema']) && $_SESSION['msj_sistema']!=''){
         	echo '<script type="text/javascript">';
         	echo 'alert("';
         	echo 'Mensaje del Sistema\n\n';
         	echo $_SESSION['msj_sistema'];
         	echo '")';
         	echo '</script>';
         }
         unset($_SESSION['msj_sistema']);
         ?>
   </head>
   <body >
      <div id="contenedor">
         <div id='perfil_usuario'>
            <p><?php echo 'Cliente: '.$_SESSION['num_identificacion'].' - '.$_SESSION['razon_social']; ?>
               <!--<input name="btn_salir" type="button" class="txt_textbox" id="btn_salir" value="Salir" style="width:70px" onClick="MET_Salir();" />-->
            </p>
         </div>
         <div id="cabecera">
            <p><?php echo '<img width="200px" src="'.$CONF_logo.'">'; ?></p>
            <p><?php echo $CONF_site_name; ?></p>
            <p><?php //echo $CONF_empresa; ?></p>
         </div>
         <div id="barra-menu">
            <?php include 'view/menu.php';?>
         </div>
         <center>
                <div style="font-size:20px;margin-top:20px">Bienvenido/a al Portal de AgroCapital</div>
            </center>
            <?php 
            $host= $_SERVER["HTTP_HOST"];
            $url= $_SERVER["REQUEST_URI"];
            $ruta =  $host . $url;
            
            $home = $_GET['home'];
            $consulta = $_GET['consulta'];
             
             if($home == "inicio" || $ruta == "agrocapital.zambrano.com.uy/shine/index.php"){
            ?>
                <div class="container pl-5 pr-5 mt-5">
                    <div class="row">
                        <div class="col-4 justify-content-center align-items-center flex-column d-flex">
                            <img width="80px" src="http://agrocapital.zambrano.com.uy/shine/images/3.png" alt="">
                            <p class="text-center mt-2" style="font-size:18px; color: #12418b;font-weight: 600;">Mi Perfil</p>
                            <span class="text-center" style="font-size: 13px;">Para ver sus datos personales, en caso de querer agregar o modificar alguno de ellos, comunicarse al <b> <br> 091 685 135.</b></span>
                        </div>
                        
                        <div class="col-4 justify-content-center align-items-center flex-column d-flex">
                            <img width="80px" src="http://agrocapital.zambrano.com.uy/shine/images/1.png" alt="">
                            <p class="text-center mt-2" style="font-size:18px; color: #12418b;font-weight: 600;">Mis consultas</p>
                            <span class="text-center" style="font-size: 13px;">Para ver detalles de las inversiones realizadas y sus respectivas ventas. <br><br></span>
                        </div>
                        <div class="col-4 justify-content-center align-items-center flex-column d-flex">
                            <img width="80px" src="http://agrocapital.zambrano.com.uy/shine/images/2.png" alt="">
                            <p class="text-center mt-2" style="font-size:18px; color: #12418b;font-weight: 600;">Clave</p>
                            <span class="text-center" style="font-size: 13px;">Para modificar la contrase&ntilde;a preestablecida. <br><br> <br></span>
                        </div>

                    </div>
                </div>

                <?php }  ?>

                    <div id="contenido">
                        
                         <div id="reportesForm" style="display: none;">
       
    </div>
   
         
   
         
       
         
         
         
         <div id="contenido">
            <?php
            
             if ($consulta == "consultas"){
                    
               			include('form/reportesadmin.php');
               	
                   }
                   
                    if ($consulta == "reportes"){
                    
               			include('form/reportesadmin.php');
               	
                   }
                   
               if (isset($_GET['opt'])){
               	switch($_GET['opt']){
               		case 'contacto':
               			include('form/contacto.php');
               			break;
               		case 'clave':
               			include('form/clave.php');
               			break;
               		case 'perfil':
               			include('form/perfil.php');
               			break;
               		case 'clientes':
               			include('form/perfil.php');
               			break;	
               			
               		case 'pedidos':
               			include('form/pedido.php');
               			break;	
               		default:
               			//include('/shine/view/main.php');
               			//echo 'Aqui';
               			//echo $_SESSION['num_identificacion'];
               			if($_SESSION['num_identificacion']=='AGROBONOSADMIN'){
               			    include('/shine/view/main.php');
               			}else{
               			    include('form/reportes.php');
               			}
               			break;
               	  } // end switch
               }else{
                //   include('form/reportes.php');
               		//include('view/main.php');
               		//break;
               }
               ?>
         </div>
         
         
         
         
         
         
         <div id="sec3">
            Copyright &copy; 2022<br />
            Todos los derechos reservados<br />
            <strong>
            <a href="mailto:contacto.uy@seidor.com"><img src="https://www.seidor.com/_next/image?url=%2Ficons%2Fseidor.jpeg&w=1920&q=90" width="70"></a>
            </strong>
         </div>
      </div>
      </div> 
   </body>
</html>