<?php $r="../";
require_once($r."inc/funciones.php");
validNotSession($r);
$mysqli = connectDB($r);
$spe=$_SESSION['perfil'];
if($spe!=$pad && $spe!=$psu && $spe!=$pbo){ exit(header("Location:".$r."dashboard.php?error=NO TIENES PERMISO PARA ESTA SECCION"));}
$row1 = $mysqli->query("SELECT * FROM z_ruteros WHERE estado=0 AND eliminado=0");
$arrayruteros = array();
while($row2 = $row1->fetch_assoc()) {
    $item=$row2['id'];
    if (in_array($item, $arrayruteros)) {}else{array_push($arrayruteros,$item);}
    
}
?>
<!DOCTYPE html>
<html lang="en">
  <?php include $r."inc/head.php"; ?>
  <style>
      .container-fluid{padding-right:5px;padding-left:5px;}
  </style>
<body class="fixed-nav sticky-footer sidenav-toggled bg-dark" id="page-top">
  <?php include $r."inc/nav.php"; ?>
  <div class="content-wrapper">
    <div class="container-fluid">
      <div class="card mb-3">
        <div class="h3 card-header">
          <i class="icon-casco"></i> COBROS POR DOMICILIARIOS <? $rutero=srute($idrutero); echo $rutero['nombre']; ?></div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
              <thead>
                <tr>
                  <th>Rutero</th>
                  <th>accion</th>
                </tr>
              </thead>
              <tfoot>
                <tr>
                  <th>Rutero</th>
                  <th>accion</th>
                </tr>
              </tfoot>
              <tbody>
              <? foreach($arrayruteros as $key => $item){ ?>
                <tr>
                  <td><? $rutero=srute($item); echo $rutero['nombre'];?></td>
                  <td width="20px"><a class="btn_default text-primary h5 m-0 p-0 " href="cobra-por-rutero.php?idrutero=<?php echo $rutero['id'] ?>"><i class="fa fa-eye"></i></a></td>
                </tr>
              <? }?>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php include $r."inc/foot.php"; ?>
</body>
</html>    
    
 