<?php $r="../";
require_once($r."inc/funciones.php");
validNotSession($r);
$spe=$_SESSION['perfil'];
if($spe!=$pad && $spe!=$psu){ echo '<div class="alert alert-danger  alert-dismissible text-center"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a><h6>NO TIENES PERMISO PARA ESTA SECCION</h6></div>';exit();}
$mysqli = connectDB($r);
$row1 = $mysqli->query("SELECT * FROM z_tinversiones");
?>
<!DOCTYPE html>
<html lang="en">
  <?php include $r."inc/head.php"; ?>
<body class="fixed-nav sidenav-toggled sticky-footer bg-dark" id="page-top">
  <div class="container">
    <div id="mensaje" style="position:fixed;width:90%;padding-left:10%;top:20px;left:0px;margin:0 auto;z-index:9999;"></div>
  </div>
  <?php include $r."inc/nav.php"; ?>
  
  <div class="content-wrapper">
    <div class="container-fluid">
      <div class="card mb-3">
        <div class="card-header">
          <i class="fa fa-table"></i> <?  ?></div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"><style>
    .table td, .table th {    padding: 0.25rem;}
</style>
              <thead>
                <tr>
                  <th>Categoria</th>
                  <th>tipo</th>
                </tr>
              </thead>
              <tfoot>
                <tr>
                  <th>Categoria</th>
                  <th>tipo</th>
                </tr>
              </tfoot>
              <tbody>
                    <?php while($row2 = $row1->fetch_assoc()) { ?>
                      <tr>
                        <td><?php $idcategoria=$row2["idcategoria"]; $row3 = $mysqli->query("SELECT * FROM z_cinversiones WHERE id='$idcategoria'");$row4 = $row3->fetch_assoc();echo $row4['nombre']?></td>
                        <td><?php ;echo $row2['nombre']?></td>
                    
                        </tr>
                    <?php
                    }
                    ?>
              <tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php include $r."inc/foot.php"; ?>
</body>

<script>
$('#dataTable').DataTable( {
        "order": [[ 0, "desc" ]],
        "lengthMenu": [[25, 50, 100, 500], [25, 50, 100, 500 ]]
    } );
</script>
<script>
    function popitup(url){
	    newwindow=window.open(url,'name','height=600,width=320'); 
	    if (window.focus) {newwindow.print();}
	    return false; 
    }
</script>
</html>    