% stash css=>["/home/admin/admin.css","/home/admin/event/event.css"];
% stash js=>["/home/admin/event/event.js"];
<section class="name" flex> <article class="user">  
  <p class="title">Editar Eventos</p>
</article> </section>

<section class="event flex">
  <article class="label">
    <ul>
      <li id="evento" value="event">Evento</li>
      <li id="curso" value="course">Curso</li>
      <li id="lugar" value="place">Lugar</li>
    </ul>
  </article>
  
  <article class="edit">
<!-- Evento ==============================================================  -->
    <div class="ehide" id="event"> <form action="/admin/eventos/e" method="POST">
      <div class="flex field">
        <label>Curso</label> 
        <select id="ecourse" name="ecourse"> 
       <% map{ %> 
              <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
        <% } %><% (@{stash('courses')}) %><% if defined(stash('courses')); %>
        </select> 
      </div>
      <div class="flex field"> 
      <label>Lugar</label> 
        <select id="eplace" name="eplace">  
       <% map{ %> 
              <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
        <% } %><% (@{stash('places')}) %><% if defined(stash('places')); %>
        </select> 
      </div> 
      <div class="flex field">
        <label>Fecha inicio</label> <!-- dropdown --> 
        <input id="dini" type="number" min="1" max="31" name="dini" value="1"/>   
        <select id="mini" name="mini">     
          <% map{ %> 
            <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
          <% } %><% (@{stash('months')}) %><% if defined(stash('months')); %>
        </select> 
        <input id="yini" type="number" min="2017" max="2050" name="yini" value="2017"/>
      </div>
      <div class="flex field">
      <label>Fecha fin</label> 
        <input id="dend" type="number" min="1" max="31" name="dend" value="1"/>    
        <select id="mend" name="mend">     
          <% map{ %> 
            <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
          <% } %><% (@{stash('months')}) %><% if defined(stash('months')); %>
        </select> 
        <input id="yend" type="number" min="2017" max="2050" name="yend" value="2017"/>   
      </div>
      <div class="flex field">
        <label>Costo</label> <input id="cost" type="text" name="cost"/>    
      </div>
      <div class="flex field"> 
        <label>Promoción</label><input id="promo" type="text" name="promo"/>   
        <label>Habilitar</label><input type="checkbox" checked="checked" id="pen" name="pen"/>
      </div>
      <div class="flex field">
        <label>Imagen</label> 
        <select id="eimg" name="eimg">    
          <option value="0" selected> -- Elegir imagen --  </option> 
            <% map{ %> 
              <option value="<%= $_ %>"><%= $_ %></option> 
            <% } %><% (@{stash('img')}) %><% if defined(stash('img')); %>
        </select> 
        <div id=esimg></div>
      </div>
      <div class="flex field">
        <label>Existente</label> 
        <select id="eprev" name="id">    
        <option value="0">-- Nuevo --</option>   
          <% map{ %> 
            <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
          <% } %><% (@{stash('events')}) %><% if defined(stash('events')); %>
        </select> 
      </div>
      <div class="flex field update">
        <input type="submit" name="req" value="Aceptar">     
        <input type="submit" name="req" value="Eliminar">     
        <label>Habilitar</label>
        <input id="een" type="checkbox" checked="checked" name="een" >    
      </div>
    </form> </div>
<!-- Curso ================================================================ -->
    <div class="ehide" id="course"> <form id="fcourse" action="/admin/eventos/c" method="POST">
      <div class="flex field">
        <label>Nombre</label>
        <input id="cname" type="text" name="cname"/> 
      </div> <div class="flex field">
        <label>Temario</label> 
        <textarea form="fcourse" id="csubjects" name="csubjects"></textarea>
      </div> <div class="flex field">
        <label>Servicios</label>
        <textarea form="fcourse" id="cservices" name="cservices"></textarea>
      </div> <div class="flex field">
        <label>Existente</label> 
        <select id="cprev" name="id"> 
        <option value="0">-- Nuevo --</option> 
          <% map{ %> 
            <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
          <% } %><% (@{stash('courses')}) %><% if defined(stash('courses')); %>   
        </select> 
      </div> <div class="flex field update">
        <input type="submit" name="req" value="Aceptar">
        <input type="submit" name="req" value="Eliminar">
        <label>Habilitar</label>
        <input type="checkbox" checked="checked" id="cen" name="cen" >
      </div>
    </form> </div>
<!-- Lugar ================================================================ -->
    <div class="ehide" id="place"><form action="/admin/eventos/p" method="POST">  
      <div class="flex field">
        <label>Nombre</label><input type="text" id= "pname" name="pname">  
      </div> <div class="flex field">
        <label>Direccion</label> <input type="text" id="paddr" name="paddr"> 
      </div> <div class="flex field">
        <label>Observación</label> <input type="text" id="pobs" name="pobs">
      </div> <div class="flex field">
        <label>Municipio</label> <input type="text" id="pto" name="pto"> 
      </div> <div class="flex field">
        <label>Entidad</label> <input type="text" id="pst" name="pst">  
      </div> <div class="flex field">
        <label>País</label> <input type="text" id="pco" name="pco">    
      </div> <div class="flex field">
        <label>Latitud</label>    <input type="text"id="plat" name="plat">
      </div> <div class="flex field">
        <label>Longitud</label> <input type="text" id="plng" name="plng"> 
      </div> <div class="flex field">
        <label>Existente</label> 
        <select id="pprev" name="id">   
        <option value="0">-- Nuevo --</option> 
          <% map{ %> 
            <option value="<%= $_->{'id'} %>"><%= $_->{'name'} %></option> 
          <% } %><% (@{stash('places')}) %><% if defined(stash('places')); %>
        </select>
      </div> <div class="flex field update">
        <input type="submit" name="req" value="Aceptar"> 
        <input type="submit" name="req" value="Eliminar">
        <label>Habilitar</label>
        <input id="pen" type="checkbox" checked="checked" name="pen" > 
      </div>
     </form> <div class="mapa"></div> 
  </article>
</section>
