<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <title>Cobradores a monitorear</title>
  </head>
  <body>
<div class="container">
    <h4>Cobradores a monitorear</h4>
    <hr>
    <div class="row mt-2">
        <div class="col-md-1">
            <b>#1</b>
        </div>
         <div class="col-md-11">
           <input type="text" id="c1" class="form-control" placeholder="Cobrador #1">
        </div>
        
     </div>   
     
     
     <div class="row mt-2">
        <div class="col-md-1">
            <b>#2</b>
        </div>
        
         <div class="col-md-11">
           <input type="text" id="c2" class="form-control" placeholder="Cobrador #2">
        </div>
    </div>
    <div class="row mt-2">
         <div class="col-md-1">
            <b>#3</b>
        </div>
        
        <div class="col-md-11">
           <input type="text" id="c3" class="form-control" placeholder="Cobrador #3">
        </div>
      </div>  
      <div class="row mt-2">
          <div class="col-md-1">
            <b>#4</b>
        </div>
        <div class="col-md-11">
           <input type="text" id="c4" class="form-control" placeholder="Cobrador #4">
        </div>
        
    </div>
    
    <div class="row mt-2">
          <div class="col-md-1">
            
        </div>
        <div class="col-md-11">
           <button class="btn btn-success" onClick="save()"> Configurar</button>
        </div>
        
    </div>
    
    <div class="row mt-2">
          <div class="col-md-1">
            
        </div>
        <div class="col-md-11">
           <div id="msg"></div>
        </div>
        
    </div>
 </div>
       
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  </body>
</html>

<script>
get();
function get(){
    $("#c1").val(localStorage.getItem("c1"))
    $("#c2").val(localStorage.getItem("c2"))
    $("#c3").val(localStorage.getItem("c3"))
    $("#c4").val(localStorage.getItem("c4"))
    
}
    function save(){
        var c1 = $("#c1").val();
        var c2 = $("#c2").val();
        var c3 = $("#c3").val();
        var c4 = $("#c4").val();
        if(c1==""){c1="----";}
        if(c2==""){c2="----";}
        if(c3==""){c3="----";}
        if(c4==""){c4="----";}
        localStorage.setItem("c1",c1);
        localStorage.setItem("c2",c2);
        localStorage.setItem("c3",c3);
        localStorage.setItem("c4",c4);
        $("#msg").html("<span class='text-success'>Cobradores configurados correctamente</span>");
        setTimeout(function(){
            window.location.href="menu_monitoreo.php"
        },2000)
        
    }
</script>