<?php $r="../";
$id=$_GET['id'];
require_once($r."inc/funciones.php");
validNotSession($r);
$mysqli = connectDB($r);
$row1 = $mysqli->query("SELECT * FROM z_ruta WHERE id='$id'");
$row1=$row1->fetch_assoc();
?>
<!DOCTYPE html>
<html lang="en">
  <?php include $r."inc/head.php"; ?>
<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">
      <h2 class="text-center"><i class="fa fa-map-signs"></i> NUEVA RUTA</h2><hr/>
      <form id="formulario" name="editar" action="acciones.php" method="post">
        <h6>INFORMACION EMPRESARIAL</h6><hr/>
        <div class="form-group row">
            <label for="nombre" class="col-sm-12 col-form-label"><span class="text-danger h5">*</span>Nombre de la Ruta</label>
            <div class="col-sm-12">
                <input type="text" class="form-control" id="nombre" name="nombre" placeholder="Nombre de la ruta" value="<? echo $row1['nombre'];?>" autocomplete="off" required>
            </div>
        </div>
        <div class="form-group row">
            <label for="direccion" class="col-sm-12 col-form-label"><span class="text-danger h5">*</span>Domiciliario Asignado</label>
            <div class="col-sm-12">
                
            <? $row4 = $mysqli->query("SELECT * FROM z_ruteros WHERE eliminado=0 AND estado=0"); ?>
            <select name="rutero" class="form-control" required>
              <?  while($row5 = $row4->fetch_assoc()) {?><option value="<? echo $row5['id']; ?>" <? if($row5["id"]==$row1['idrutero']){echo 'selected="selected"'; } ?>><? echo $row5['nombre']; ?></option><? } ?>
            </select>
            </div>
        </div>
        <hr/>
            <input type="hidden" name="editar" value="<? echo $id ?>">
          <button type="submit" class="btn btn-primary btn-block">Actualizar</button>
          <a class="btn btn-success btn-block" onclick="history.back()">Atras</a>                  
                            
                          
      </form>
    </div>
  </div>
  <? include $r."inc/foot.php"; ?>
</body>
</html>