<div class="page-content-wrapper">
<!-- Keep all page content within the page-content inset div! -->
<div class="page-content inset">
<head>
  <!-- Manda a traer el javascript para validar el formulario -->
  <script type="text/javascript" src="<?php echo base_url()?>assets/dist/js/site.js"></script>
  <script type="text/javascript" src="<?php echo base_url()?>assets/dist/js/editarPago2.js"></script>
   <link rel="stylesheet" href="<?php echo base_url().'assets/dist/css/validacion.css'?>">
   <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'?>">
	<link rel="stylesheet" type="text/css" href='<?php echo base_url()?>assets/dist/css/styleTable.css' /> 
   <link rel="stylesheet" type="text/css" href='<?php echo base_url()?>assets/dist/css/table.css' />
   <link rel="stylesheet" href="<?php echo base_url().'assets/plugins/select/bootstrap-select.min.css'?>">
    <!-- Latest compiled and minified JavaScript -->
    <script src="<?php echo base_url().'assets/plugins/select/bootstrap-select.min.js'?>"></script>
</head>
<style>
.parent-container {
    margin-bottom: 100px !important;
}
@media(max-width: 991px)
{
  .parent-container {
    margin-bottom: 50px !important;
}
}
</style>
  <center><h1>Pago de Servicios</h1></center>
  <form name="Pagos" id="Pagos" action="<?php echo base_url();?>pagos/cosmetologo/PagosC/editarenlaceS/<?=$IdVentasServicios?>/<?=$ventas_IdVentas?>" method="POST" >
  <input type="text" id="fecha" name="fecha" class="invisible">
  <div class="parent-container no-margin-left col-md-10 div-centrado">
  <div class="no-margin-left col-md-4" >
      <ul class="list-group mb-3 heig" id="DatosGenerales">
          <li class="data-container list-group-item d-flex justify-content-between lh-condensed">
            <div>
              <h5 class="headers">Nombre Cliente</h5>
              <span class="text-muted"><?=$ClienteVenta?></span>
            </div>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between lh-condensed">
            <div>
              <h5 class="headers">Nombre Servicio</h5>
              <span class="text-muted"><?=$NombreServicio?></span>
            </div>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between lh-condensed">
            <div>
              <h5 class="headers">Folio de Venta</h5>
              <span class="text-muted"><?=$folio?></span>
            </div>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between lh-condensed">
            <div>
              <h5 class="headers">Exhibiciones</h5>
              <span id="exhibiciones" class="text-muted"><?=$exhibiciones_IdExhibiciones?></span><a href="#" id="masExhibiciones" onClick="masExhibicion(2, <?=$IdVentasServicios?>)" class="label label-primary invisible pull-right"><span class="glyphicon glyphicon-plus"></a></span>
            </div>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between">
            <span class="quantities">Subtotal:</span>
            <strong class="quantities">$ <?=$SubTotalS?></strong>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between">
            <span class="quantities" >Descuento:</span>
            <strong class="quantities">$ <?=$DescuentoS?></strong>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between">
            <span class="quantities" >Abono:</span>
            <strong id="Abono" name="Abono"class="quantities">$ <?=$Abono?></strong>
          </li>
          <li class="data-container list-group-item d-flex justify-content-between">
            <span class="quantities">Adeudo:</span>
            <strong class="debit" id="Adeudo"  name="Adeudo">$ <?=$Adeudo?></strong>
          </li>
          <li class="data-container list-group-item detalle pago1 invisible">
            <span class="fechaPago">FECHA PAGO 1:</span>
            <strong class="fechaPago"><?=$Fecha1?></strong>
          </li>
          <li class="data-container list-group-item detalle pago1 invisible">
            <div>
              <h5 class="headers">Comentario de descuento</h5>
              <span class="text-muted"><?=$ComentarioDesS?></span>
            </div>
          </li>
          <li class="data-container list-group-item detalle pago1 invisible">
            <div>
              <h5 class="headers">Vendedor 1</h5>
              <span class="text-muted"><?=$Usuario1?></span>
            </div>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="fechaPago">FECHA PAGO 2:</span>
            <strong class="fechaPago" id="fecha2"><?=$Fecha2?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="headers">Folio:</span>
            <strong class="text-muted"><?=$FolioVenta2?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="headers">Folio 2:</span>
            <strong class="text-muted"><?=$folio2?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="headers">Efectivo 2: </span>
            <strong class="text-muted">$ <?=$Contado2?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="headers">Tipo Tarjeta 2: </span>
            <strong class="text-muted"><?=$TipoTarjeta2?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="headers">Cantidad Tarjeta 2: </span>
            <strong class="text-muted">$ <?=$CTarjeta2?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <div>
              <h5 class="headers">Vendedor 2</h5>
              <span class="text-muted"><?=$Usuario2?></span>
            </div>
          </li>
          <li class="data-container list-group-item detalle pago3 invisible">
            <span class="fechaPago">FECHA PAGO 3:</span>
            <strong class="fechaPago" id="fecha3"><?=$Fecha3?></strong>
          </li>
          <li class="data-container list-group-item detalle pago2 invisible">
            <span class="headers">Folio:</span>
            <strong class="text-muted"><?=$FolioVenta3?></strong>
          </li>
          <li class="data-container list-group-item detalle pago3 invisible">
            <span class="headers">Folio 3:</span>
            <strong class="text-muted"><?=$folio3?></strong>
          </li>
          <li class="data-container list-group-item detalle pago3 invisible">
            <span class="headers">Efectivo 3: </span>
            <strong class="text-muted">$ <?=$Contado3?></strong>
          </li>
          <li class="data-container list-group-item detalle pago3 invisible">
            <span class="headers">Tipo Tarjeta 3: </span>
            <strong class="text-muted"><?=$TipoTarjeta3?></strong>
          </li>
          <li class="data-container list-group-item detalle pago3 invisible">
            <span class="headers">Cantidad Tarjeta 3: </span>
            <strong class="text-muted">$ <?=$CTarjeta3?></strong>
          </li>
          <li class="data-container list-group-item detalle pago3 invisible">
            <div>
              <h5 class="headers">Vendedor 3</h5>
              <span class="text-muted"><?=$Usuario3?></span>
            </div>
          </li>
          <li id="botonDetalle" class="detail-button list-group-item d-flex justify-content-between">
           <center><span id="nombreBoton" class="glyphicon glyphicon-eye-open"> Detalle</span></center>       
          </li>
        </ul>
    </div>
    <div class="col-md-8" id="pagar">
      <div class="col-md-8 div-centrado">
        <label for="name1" id="mensaje"></label>
      </div>
      <center id="tituloPagar"><h3>Pagar</h3></center>
        <div class="child-container">
          <label >Efectivo</label>
          <input type="text" class="form-control" id="Contado"  name="Contado"  value="" placeholder="Efectivo"  min="0" onkeypress="return validaPunto(event)">
        </div>
        <div class="child-container">
          <label >Recibí</label>
          <input type="number" class="form-control" id="Recibi"  name="Recibi"  value="" placeholder="Recibí" min="0" onkeypress="return validaPunto(event)">
        </div>
        <div class="child-container">
          <label >Cambio</label>
          <input type="number" class="form-control" id="Cambio"  name="Cambio"  value="" readonly placeholder="Cambio" min="0" onkeypress="return validaPunto(event)">
        </div>
        <div class="child-container">
          <label >Tipo Tarjeta</label>
          <select type="text" class="form-control" id="TipoTarjeta"  name="TipoTarjeta"  value="">
          <option value="">---Selecciona---</option>
          <option value="TARJETA DE CREDITO" >TARJETA DE CRÉDITO</option> 
          <option value="TARJETA DE DEBITO" >TARJETA DE DÉBITO</option> 
          </select>
        </div>
        <div class="child-container">
          <label >Cantidad </label>
          <input type="text" class="form-control" id="CTarjeta" name="CTarjeta" placeholder="Cantidad Abonada" readonly="" onInput="CalculaPago2();" min="0" onkeypress="return validaPunto(event)">
        </div>
        <div class="child-container">
          <label >Folio Terminal Bancaria</label>
          <input type="text" class="form-control" id="FolioTarjeta" name="FolioTarjeta" placeholder="Folio Terminal Bancaria" readonly="" onkeypress="return valida(event)">
        </div>
        <div class="child-container">
          <label for="name1">Vendedor</label>
          <select name="Usuario" id="Usuario" class="form-control"  required="" title="Este campo es requerido"> 
          <option value="">--- Seleccione un Usuario  ---</option>  
          <?php foreach ($ReUsuario as $i => $usuario)   
          echo '<option value="',$i,'">',$usuario,'</option>'; ?> </select>
        </div>
    </div>
        <input type="text" class="oculto form-control" id="AdeudoV"  name="AdeudoV" value="<?=$AdeudoVenta?>">
        <div class="form-group col-md-10 div-centrado"> 
          <button type="submit" id="guarda" class="btn btn-primary col-md-4 col-sm-5 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 col-sm-5 pull-left"> <span class="glyphicon glyphicon-circle-arrow-left"> </span> Regresar</button></a>  
        </div>
        <input type="text" class="oculto col-md-12" id="AbonoV"  name="AbonoV" value="<?=$AbonoVenta?>">
        <input type="text" class="oculto col-md-12" id="Abono2"  name="Abono2" value="<?=$Abono?>">
        <input type="text" class="invisible" id="AdeudoVenta"  name="AdeudoVenta">
        <input type="text" class="invisible" id="AbonoVenta"  name="AbonoVenta"> 
        <input type="text" class="invisible" id="pago"  name="pago">
        <input type="text" class="invisible" id="AbonoFinal"  name="AbonoFinal">
        <input type="text" class="invisible" id="AdeudoFinal"  name="AdeudoFinal"> 
        <!-- <input type="text" class="invisible" id="PiezasTotales"  name="PiezasTotales" value='<?=$PiezasTotales-$PiezasP?>'>  -->
        <!-- <input type="text" class="invisible" id="IdProductosFranquicias" name="IdProductosFranquicias" value='<?=$productosfranquicias_IdProductosFranquicias?>'> -->

  </form>
</div>
</div>
</div>
<script>
if(document.getElementById('Usuario').value!="")
{
  location.href='<?php echo base_url()?>pagos/cosmetologo/pagosC/UltimasVentas';
}
  var adeudoGeneral='<?=$Adeudo?>';
  var abonoGeneral='<?=$Abono?>';
  var base_url='<?php echo base_url()?>';
  
  if('<?=$Fecha2?>'=='' || '<?=$Fecha2?>'=='0000-00-00 00:00:00')
  {
    document.getElementById('pago').value=2;
  }else if('<?=$Fecha3?>'=='' || '<?=$Fecha3?>'=='0000-00-00 00:00:00')
  {
    document.getElementById('pago').value=3;
  } else if('<?=$Fecha4?>'=='' || '<?=$Fecha4?>'=='0000-00-00 00:00:00')
  {
    document.getElementById('pago').value=4;
  }
mueveReloj();
</script>