<!DOCTYPE html>
<?php
ob_start();
$session_id = trim($_REQUEST['session_id']);
session_save_path("../sesiones/");
session_name($session_id);
session_start(); 
$id_persona = $_SESSION['ID_PERSONA'];
  if(isset($id_persona)){
    include("../datos/mysqlpersona.php");                         
     $p = new mysqlpersona();
     $data = $p->getPersonaID($id_persona);
       for($i =0;$i<count($data);$i++){
            $nombre=  $data[$i]['NOMBRE'];
            $apellido_pa=  $data[$i]['APE_PATERNO'];
            $apellido_ma=  $data[$i]['APE_MATERNO'];
            $perfil =  $data[$i]['PERFIL'];
            $id_perfil=  $data[$i]['ID_PERFIL'];
            //DATA PERSONAL
            $email = $data[$i]['EMAIL'];
            $celular = $data[$i]['CELULAR'];
        }  
            $_SESSION['nombre']= $nombre;
            $_SESSION['ape_paterno']= $apellido_pa;
            $_SESSION['ape_materno']= $apellido_ma;
            $_SESSION['perfil']= $perfil;
            $_SESSION['id_perfil']= $id_perfil;
            //DATA PERSONAL
            $_SESSION['email']=$email;
            $_SESSION['celular']=$celular;
            $_SESSION['id_persona_registro'] = $_SESSION['ID_PERSONA'];
            $_SESSION['url'] = SID.'&session_id='.$session_id;
  }else{
     echo "<meta http-equiv='refresh' content='0;url=../administracion'>";
}
?>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <title>Propiedades</title>
        <link href="../css/style.default.css" rel="stylesheet">
        <link href="../css/select2.css" rel="stylesheet" />
        <link href="../css/bootstrap-dialog.min.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/tabletools/2.2.3/css/dataTables.tableTools.css">
        <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/plug-ins/9dcbecd42ad/integration/bootstrap/3/dataTables.bootstrap.css">
        <link rel="stylesheet" type="text/css" href="//editor.datatables.net/examples/resources/bootstrap/editor.bootstrap.css">
        <link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet"/>
        <link href="../css/multi-select.css" media="screen" rel="stylesheet" type="text/css">

    </head>
    <style type="text/css">
.bg{background-color:#5bc0de;}
    </style>
    <body>
        
        <header>
        <div class="headerwrapper">
                <div class="header-left">  
                    <div class="pull-right">
                        <a href="#" class="menu-collapse">
                            <i class="fa fa-bars"></i>
                        </a>
                    </div>
                </div><!-- header-left -->
                
                <div class="header-right">   
                    <div class="pull-right">                    
                        <div class="btn-group btn-group-option">
                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                              <i class="fa fa-caret-down"></i>
                            </button>
                            <ul class="dropdown-menu pull-right" role="menu">
                               
                              <li><a id="configcuenta" href="#"><i class="glyphicon glyphicon-cog"></i> Configuración cuenta</a></li>
                              <li class="divider"></li>
                               <li><a id="cerrar_session" href="#"><i class="glyphicon glyphicon-log-out"></i>Cerrar sesión</a></li>
                            </ul>
                        </div><!-- btn-group -->    
                    </div><!-- pull-right -->
                    
                </div><!-- header-right -->
                
            </div><!-- headerwrapper -->

        </header>
        
        <section>
             <div class="mainwrapper">
             
                 <div class="leftpanel">
                    <div class="media profile-left">
                        <div class="media-body">
                            <h4 class="media-heading"><?php echo $_SESSION['perfil'];?></h4>
                            <small class="text-muted"><?php echo $_SESSION['nombre']." ".$_SESSION['ape_paterno'] ;?></small>
                        </div>
                    </div><!-- media -->
                    
                    <h5 class="leftpanel-title">Menu</h5>
                    <ul class="nav nav-pills nav-stacked">
                    <li><a href="dashboard?<?php echo SID.'&session_id='.$session_id?>"><i class="fa fa-home"></i> <span>Dashboard</span></a></li>
                          
                <li class="parent" ><a href="#" ><i class="fa fa-inbox"></i> <span>Requerimientos</span></a>
                            <ul class="children">
                                 <li><a href="requerimientos?<?php echo SID.'&session_id='.$session_id?>">Lista</a></li>
                            </ul>
                        </li>
                          <li class="parent"><a href="#"><i class="fa fa-calendar"></i> <span>Calendario</span></a>
                            <ul class="children">
                                 <li><a href="calendario?<?php echo SID.'&session_id='.$session_id?>">Calendario</a></li>
                                 <li><a href="configuracioncalendario?<?php echo SID.'&session_id='.$session_id?>">Configuración</a></li>
                            </ul>
                        </li>
                   <li class="parent active"><a href="#"><i class="fa fa-briefcase"></i> <span>Proyectos</span></a>
                            <ul class="children">          
                                <li class="active"><a href="proyectos?<?php echo SID.'&session_id='.$session_id?>">Lista Proyectos</a></li>
                                <li><a href="proyectomasivo?<?php echo SID.'&session_id='.$session_id?>">Crear Proyecto</a></li>
                                <li ><a href="ambientes?<?php echo SID.'&session_id='.$session_id?>">Ambientes</a></li>
                                <li><a href="tipopropiedad?<?php echo SID.'&session_id='.$session_id?>">Tipo Propiedad</a></li>
                                <li><a href="modelospropiedades?<?php echo SID.'&session_id='.$session_id?>">Modelos Propiedades</a></li>
                                <li><a href="personas?<?php echo SID.'&session_id='.$session_id?>">Personas</a></li>
                                <li><a href="propiedades?<?php echo SID.'&session_id='.$session_id?>">Propiedades</a></li>
                            </ul>
                        </li>
                         <li class="parent"><a href="#"><i class="fa fa-pencil"></i> <span>Datos</span></a>
                            <ul class="children">
                                <li><a href="usuarios?<?php echo SID.'&session_id='.$session_id?>">Usuarios</a></li>
                                <li><a href="empresa?<?php echo SID.'&session_id='.$session_id?>">Empresa</a></li>
                                <li><a href="categoria?<?php echo SID.'&session_id='.$session_id?>">Categoría</a></li>
                                <li><a href="preguntas?<?php echo SID.'&session_id='.$session_id?>">Preguntas</a></li>
                                <li><a href="responsable?<?php echo SID.'&session_id='.$session_id?>">Responsable</a></li>
                                <li><a href="servicios?<?php echo SID.'&session_id='.$session_id?>">Servicios</a></li>
                            </ul>
                        </li>
                          <li class="parent "><a href="#"><i class="fa fa-suitcase"></i> <span>Terceros</span></a>
                            <ul class="children">
                                 <li ><a href="procesoterceros?<?php echo SID.'&session_id='.$session_id?>">Generar Postventa</a></li>

                            </ul>
                        </li>

                             <li class="parent"><a href="#"><i class="fa fa-copy"></i> <span>Reportes</span></a>
                            <ul class="children">
                                <li><a href="reportepostventa?<?php echo SID.'&session_id='.$session_id?>">Lista Reportes</a></li>                         
                                <li><a href="ReporteTransparencia?<?php echo SID.'&session_id='.$session_id?>">Reporte Transparencia</a></li>  
                            </ul>
                        </li>
                        <li class="parent"><a href="#"><span>Otras Páginas</span></a>
                            <ul class="children">
                                <li><a href="https://login.microsoftonline.com/">Microsoft Office 365</a></li>
                                <li><a href="http://vain-arm.cl/">Vain - Arm</a></li>
                                <li><a href="http://www.itodoslossantos.cl/web/">Inmobiliaria Todos los Santos</a></li>                           
                            </ul>
                        </li>
                    </ul>
                </div><!-- leftpanel -->
                <div class="mainpanel">
                    <div class="pageheader">
                        <div class="media">
                            <div class="pageicon pull-left">
                                <i class="fa fa-briefcase"></i>
                            </div>
                            <div class="media-body">
                                <ul class="breadcrumb">
                                    <li><a href="#"><i class="glyphicon glyphicon-briefcase"></i></a></li>
                                     <li>Proyecto</li>
                                </ul>
                                <h4>Proyectos</h4>
                            </div>
                        </div><!-- media -->
                    </div><!-- pageheader -->
                    <div class="contentpanel contentpanel-wizard">                        
                        <div class="row">
                            <div class="col-md-12">
                                <?php 
                                    include("../datos/mysqlproyecto.php");
                                    $pro = new mysqlproyecto();
                                ?>
                                  <div class="panel panel-primary-head">
                                    <p class="mb20">Lista Proyectos</p>
                                    <div class="btn-list">
                                          <button id="nuevopropiedad" class="btn btn-primary">Nuevo</button>
                                           <table id="tablaproyecto" class="table  table-bordered responsive">
                                                <thead class="">
                                                      <tr>
                                                        <th></th>
                                                     </tr>
                                                </thead>
                                                <tbody>
 
                                  <?php
                                            $ar = $pro->getProyectos();
                                            for($i =0;$i<count($ar);$i++){
                                              if(empty($ar)){
                                                ?>
                                                <tr><td></td></tr>
                                                <?php 
                                              }else{

                                                $clave = base64_encode($ar[$i]['ID_PROYECTO']);
                                              
                                            ?> 
                               <tr>
                                        <td>
                                            <ul class="media-list msg-list">
                                                    <li class="media unread">
                                                        <div class="media-body">
                                                            <div class="pull-right media-option">
                                                                <small>Abreviatura <?php echo $ar[$i]['ABREVIATURA'];   ?></small>
                                                            </div>
                                                            <p>
                                                            <a href="detalleproyecto.php?ticket=<?php echo $clave.'&'.SID.'&session_id='.$session_id;?>">
                                                                 <h4 class="sender">
                                                                N° Etapas 
                                                                 <small>
                                                                     10
                                                                    </small>
                                                                </h4>

                                                                    <strong class="subject">
                                                                   <?php echo $ar[$i]['PROYECTO']   ;?>,
                                                                    </strong> 
                                            
                                                                </a>
                                                            </p>
                                                        </div>
                                                    </li>
                                                </ul>
                                          </td>
                                        </tr>                          
       

                                        <?php 

                                            }
                                          }
                                        ?>

                                             </tbody>
                                        </table>
                   


                                    </div>

                              </div>
                        </div><!-- row -->
                    </div><!-- contentpanel -->
                    
                </div><!-- mainpanel -->
            </div><!-- mainwrapper -->
        </section>




          <script src="../js/jquery-1.11.1.min.js"></script>
        <script src="../js/jquery-migrate-1.2.1.min.js"></script>
      
        <script src="https://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
        <script src="../js/bootstrap.min.js"></script>
        <script src="../js/modernizr.min.js"></script>
        <script src="../js/pace.min.js"></script>
        <script src="../js/retina.min.js"></script>
        <script src="../js/jquery.cookies.js"></script>
        <script src="../js/bootstrap-wizard.min.js"></script>
        <script src="../js/jquery.validate.min.js"></script>
        <script src="../js/jquery.dataTables.min.js"></script>
        <script src="http://cdn.datatables.net/plug-ins/725b2a2115b/integration/bootstrap/3/dataTables.bootstrap.js"></script>
        <script src="http://cdn.datatables.net/responsive/1.0.1/js/dataTables.responsive.js"></script>
        <script src="../js/select2.min.js"></script>
        <script src="../js/custom.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
        <script src="../js/bootstrap-dialog.min.js"></script>
        <script src = "../js/funciones.js" type="text/javascript"></script>
        <script src="../js/jquery.multi-select.js"></script>
        <script src = "../js/funciones.js" type="text/javascript"></script>

        <script>
        jQuery(document).ready(function() {

        var id_sesion = "<?php echo $_SESSION['sesion'];?>" ;

              jQuery('#tablaproyecto').DataTable({
                   responsive: true,
                   "bSort": false
              });                
      });
        </script>

    </body>
</html>
