<?php $r="../../";
require_once($r."inc/funciones.php");
validNotSession($r);
$mysqli = connectDB($r);
$spe=$_SESSION['perfil'];
roleaccess(4);
?>
<!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="content-wrapper">
    <div class="container-fluid">
      <?php include $r."inc/nav.php"; ?>
      <div class="col-sm-12">
        <form name="consulta" action="consulta.php" method="get">
          <div class="form-group">
            <label for="nombre">Nombre cliente</label>
              <select data-placeholder="Digite datos cliente" class="chosen-select" name="id" >
                    <? $resultado = $mysqli->query("SELECT * FROM z_clientes");
                    $resultado2 = $mysqli->query("SELECT * FROM z_clientes");
                  do{echo '<option value="'.$fila["id"].'"> '.$fila["nombre"].'</option>';
                    }while ($fila = $resultado->fetch_assoc());
                    do{echo '<option value="'.$fila["id"].'"> '.$fila["contacto1"].'</option>';
                    }while ($fila = $resultado2->fetch_assoc()); ?>
              </select>
          </div>
          
          <div class="form-group">
            <label for="nombre">Localidad</label>
              <select data-placeholder="Selecione Localidad" class="chosen-select" name="localidad" >
                    <? $domiciliarios = $mysqli->query("SELECT * FROM z_localidades");
                  do{echo '<option value="'.$domiciliario["id"].'"> '.$domiciliario["localidad"].'</option>';
                    }while ($domiciliario = $domiciliarios->fetch_assoc()); ?>
              </select>
          </div>
          
          <div class="form-group">
            <label for="nombre">Ruta</label>
              <select data-placeholder="Selecione la Ruta" class="chosen-select" name="ruta" >
                    <? $domiciliarios = $mysqli->query("SELECT * FROM z_ruta");
                  do{echo '<option value="'.$domiciliario["id"].'"> '.$domiciliario["nombre"].'</option>';
                    }while ($domiciliario = $domiciliarios->fetch_assoc()); ?>
              </select>
          </div>
          <hr>
          <button type="submit" class="btn btn-primary col-sm-12 mr-1">Consultar</button>
        </form>
       </div>
      <?php include $r."inc/foot.php"; ?>
    </div>
  </div>
</body>
</html>