<html>
<div id="page-content-wrapper">
<div class="page-content inset">
<div class="row">
 <div class="col-md-10 div-centrado">
    
 
 
<head>
<!-- Manda a traer el javascript para validar el formulario -->
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- jQuery timepicker library -->
<!-- <link rel="stylesheet" href="jquery-timepicker/jquery.timepicker.min.css"> -->
<!-- <script src="jquery-timepicker/jquery.timepicker.min.js"></script> -->
    <!-- <script src="http://code.jquery.com/jquery-1.0.4.js"/> -->
  <script src="<?php echo base_url().'assets/dist/js/jquery/jquery-3.3.1.js'?>" type="text/javascript"></script>
  <script src="<?php echo base_url().'assets/dist/js/jquery/jquery-ui.js'?>" type="text/javascript"></script>
    <link rel="stylesheet" href="<?php echo base_url().'assets/dist/js/jquery/jquery-ui.css'?>">
  <link rel="stylesheet" href="<?php echo base_url().'assets/dist/css/styles.css'?>">
    <script type="text/javascript" src="<?php echo base_url()?>assets/dist/js/site.js"></script>
    <script src="<?php echo base_url().'assets/plugins/notify/notify.min.js'?>" type="text/javascript"></script>
     <script type="text/javascript" src="<?php echo base_url()?>assets/dist/js/agenda.js"></script>
     <link rel="stylesheet" href="<?php echo base_url().'assets/dist/css/validacion.css'?>"> 
    <script type="text/javascript" src='<?php echo base_url()?>assets/plugins/clock/bootstrap-clockpicker.js'></script>
  <script type="text/javascript" src='<?php echo base_url()?>assets/plugins/clock/bootstrap-clockpicker.min.js'></script>
  <script type="text/javascript" src='<?php echo base_url()?>assets/plugins/clock/jquery-clockpicker.min.js'></script>
  <script type="text/javascript" src='<?php echo base_url()?>assets/plugins/clock/jquery-clockpicker.js'></script>
  <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/clock/bootstrap-clockpicker.css'?>">
  <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/clock/bootstrap-clockpicker.min.css'?>">
  <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/clock/bootstrap-clockpicker.css'?>">
  <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/clock/bootstrap-clockpicker.min.css'?>">
  <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/srclock/clockpicker.css'?>">
  <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/srclock/standalone.css'?>">
  <script type="text/javascript" src='<?php echo base_url()?>assets/plugins/srclock/clockpicker.js'></script>
  <script type="text/javascript">
      var base_url="<?php echo base_url()?>";
      var rol="<?php echo $this->session->userdata('Rol_IdRol')?>";
  </script>

</head>
<style type="text/css">
  /*form#Agregarcita {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
   form#Agregarcita .form-group {
    width: 50%;
  }*/
  .date-picker#name1, #txthorai, #txthoraf{
    background: rgba(0, 60, 166, 0.18) !important;
  }
  .clockpicker-dial.clockpicker-hours  > div.clockpicker-tick:nth-child(2),
  .clockpicker-dial.clockpicker-hours  > div.clockpicker-tick:nth-child(3),
  .clockpicker-dial.clockpicker-hours  > div.clockpicker-tick:nth-child(4),
  .clockpicker-dial.clockpicker-hours  > div.clockpicker-tick:nth-child(5),
  .clockpicker-dial.clockpicker-hours  > div.clockpicker-tick:nth-child(6)
   {
    display: none;
  }
</style>
 <div class="title_right">
<div class="x_panel"> 
<br>

<center class="col-md-10"><h1>Nueva cita</h1></center>

<form name="Agregarcita" id="Agregarcita" action="<?php echo base_url();?>agenda/cosmetologo/listacitasC/guardar" method="POST">

<!--     <select class="form-control" name="txtcliente" required>   <option value="">Selecione un cliente</option> <?php foreach ($ReCliente as $i => $cliente)    
    echo '<option value="',$i,'">',$cliente,'</option>'; ?> </select> -->
    <!-- <div class="form-group col-md-5"> 
      <label for="name1">Categoría </label>
      <select class="form-control" name="txtcategoria" required>    <option value="">Seleciona una categoria</option><?php foreach ($ReCategoria as $i => $categoria)    
      echo '<option value="',$i,'">',$categoria,'</option>'; ?> </select>
    </div> -->

  <div class="form-group col-md-10"> 
    <label for="name1">Servicios/Promociones</label>
    <input type="text" class="form-control" id="servicioP" name="servicioP" required="" placeholder="Servicio" data-toggle="tooltip" data-placement="bottom"  title="Buscar servicios / promociones">
  </div>
   <!-- <div class="form-group"> 
    <label for="name1">Promociones Franquicias</label>
    <input type="text" class="form-control" id="txt_promocioneslocales" name="txt_promocioneslocales" required="" placeholder="Promociones Franquicias"   data-toggle="tooltip" data-placement="bottom" title="Elegir una promoción franquicia">

    </div>
  <div class="form-group"> 
  <label for="name1">Promociones Institucionales </label>
  <input type="text" class="form-control" id="txt_promocionesinstitucionales" name="txt_promocionesinstitucionales" required="" placeholder="Promociones Institucionales" data-toggle="tooltip" data-placement="bottom"  title="Elegir una promoción Institucional">
   </div>

   <div class="form-group"> 
    <label for="name1">Servicios Adicionales y Personalizados </label>
    <input type="text" class="form-control" id="txt_serviciosAP" name="txt_serviciosAP" required="" placeholder="Servicio" data-toggle="tooltip" data-placement="bottom"  title="Elige un servicio Adicional o Personalizados">
  </div>
    <div class="form-group"> 
    <label for="name1">Servicios Generales y Muestra </label>
    <input type="text" class="form-control" id="txt_serviciosGM" name="txt_serviciosGM" required="" placeholder="Servicio"  data-toggle="tooltip" data-placement="bottom" title="Elige un servicio General o Muestra">
  </div> -->
    <div class="form-group col-md-5"> 
      <label for="name1">Cliente  </label>
      <input type="text" class="form-control" id="txtcliente" name="txtcliente" required="" placeholder="Nombre del cliente" onkeypress="return validaLetra(event)"  >
    </div>
    <div id="botonAdeudos" class="form-group col-md-5 invisible"> 
          <button type="button" id="bAdeudos" class="btn btn-primary alinAdeudos col-md-12">
          <span class="glyphicon glyphicon-list-alt"></span> Adeudos
          </button>
    </div> 
    <div class="form-group col-md-5"> 
    <label for="name1">Fecha</label>
    <input type="text" class="form-control date-picker readonly"  id="name1" name="txtfecha" placeholder="dd/mm/aaaa" autocomplete="off" required> 
    </div>
    <div class="form-group col-md-5">
    <label for="name1">Hora inicio</label>
    <input type="time" class="form-control time-picker" id="txthorai"  name="txthorai" maxlength='11' placeholder="00:00" onKeyup="validaHora();" autocomplete="off" required >

    </div>

    <div class="form-group col-md-5"> 
    <label for="name1">Hora fin </label>
    <input type="time" class="form-control time-picker" id="txthoraf"   name="txthoraf" maxlength='11' placeholder="00:00" onKeyup="validaHora();" autocomplete="off" required>
    </div>

    <div class="form-group col-md-5"> 
    <label for="txtstatus">Estado</label>
    <select id= "txtstatus" name="txtstatus" class="form-control" required>
    <option value="">Selecione un estado</option>
    <?php foreach ($ReEstatusCita as $i => $estatuscita)   
    if($i!=3){echo '<option value="',$i,'">',$estatuscita,'</option>'; }?> </select>
    </div>
    

    <div class="form-group col-md-5"> 
    <label for="name1">Cosmetolog@ Asignado </label>
    <select class="form-control" name="txtusuario" required> <option value="">Selecione un Cosmetologo</option><?php foreach ($ReUsuario as $i => $usuario)   
    echo '<option value="',$i,'">',$usuario,'</option>'; ?> </select>
    </div>

    <div class="form-group col-md-5"> 
    <label for="name1">Cabina </label>
    <select class="form-control" name="txt_cabina" required>   <option value="">Selecione una cabina</option> <?php foreach ($ReCabina as $i => $cabina)    
    echo '<option value="',$i,'">',$cabina,'</option>'; ?> </select>
    </div>

   <!-- <div class="form-group col-md-5"> 
    <label for="name1">Franquicia  </label>
    <select class="form-control" name="txt_franquicia" readonly=""> <?php foreach ($ReFranquicia as $i => $franquicia)    
    echo '<option value="',$i,'">',$franquicia,'</option>'; ?> </select>
    </div> -->

    <div class="form-group col-md-5"> 
    <label for="name1">Observaciones</label>
    <input type="text" class="form-control" id="name1" name="txt_observaciones" placeholder="Observaciones">
    </div>
   

    <div class="form-group col-md-10 "> 
      <button type="submit" id="guarda" class="btn btn-primary col-md-4 pull-right"> <span class="glyphicon glyphicon-floppy-disk"> </span> Guardar</button>
      <a href="javascript:window.history.back()" ><button type="button" class="btn btn-danger col-md-4 pull-left"> <span class="glyphicon glyphicon-circle-arrow-left"> </span> Regresar</button></a>  
    </div>
    
    <div>
 <!-- Input invisible para cachar los ID -->
      <input class="form-control invisible" type="text"  id="idcliente" name="idcliente">
      <input class="form-control invisible" type="text"  id="cliente1" name="cliente1">
      <input class="form-control invisible" type="text"  id="idpromo" name="idpromo">
      <input class="form-control invisible" type="text"  id="promo1" name="promo1">
      <input class="form-control invisible" type="text"  id="idservi" name="idservi">
      <input class="form-control invisible" type="text"  id="servi1" name="servi1">

    </div>
<br>
<br>
<br>

</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- modal adeudos -->
<div class="modal" tabindex="-1" role="dialog" id="modal-adeudos" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <center> <h4> Adeudos</h4></center>
      </div>
      <div class="modal-body scroll scrollbar-primary">
      <table class="table">
        <thead>
          <tr>
            <th>Fecha venta</th>
            <th>Nombre</th>
            <th>Abono</th>
            <th>Adeudo</th>
            <th></th>
          </tr>
        </thead>
        <tbody id="listaAdeudos">
        </tbody>
      </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger pull-left" id="cerrarModalAdeudos" data-dismiss="modal">Cerrar</button>
       
      </div>
    </div>
  </div>
</div>
<!-- Fin modal adeudos -->
</html>

<script type="text/javascript">

$(document).ready(function() {
  <?php 
    if(isset($IdClientes))
    {$var1= $IdClientes;}
    else{$var1='';}
    ?>
 var id='<?php if(isset($IdClientes)){echo $IdClientes;}else echo ""?>';
  var nombre='<?php if(isset($NombreCliente)){echo $NombreCliente;}else echo ""?>';
  if (id!='' && nombre!='') {
    $(function() {
      $("#txtcliente").keyup();
    });
        $('[name="idcliente"]').val(id);
        $('[name="txtcliente"]').val(nombre);
        $('[name="cliente1"]').val(nombre);
        buscarAdeudos(id);
  }
  });

</script>
              

