<div id="egreso" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Registro de Egresos</h4>
            </div>
            <div class="modal-body ">
                <form name="form_egreso" id="form_egreso" method="post" action=""  onsubmit="return checkSubmit();">
                    <div class="">
                        <label>Fecha</label>
                        <input type="date" value="<?php echo  date('Y-m-d');?>"  name="fecha" id="fecha" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus">
                    </div> <!-- /.form-group -->
                    <div class="">
                        <label>Concepto</label>
                        <input type="text"  name="concepto" id="concepto" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required>
                    </div> <!-- /.form-group -->
                        <input type="hidden"  name="cantidad" id="cantidad" class="form-control input-sm" autocomplete="off" value="1" autofocus="autofocus" required>
                    <div class="">
                        <label>Valor</label>
                        <input type="number"  name="total" id="total" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required>
                    </div> </p>

                    <div id="ventana2">
                        <div class="middle" >
                            <label>
                                <input type="radio" name="radio" id="Efectivo" value="Efectivo" checked onchange="javascript:showContent()"/>
                                <div class="front-end box"><span>EFECTIVO</span></div>
                            </label>
                            <label>
                                <input type="radio" name="radio" id="Transferencia" value="Transferencia" onchange="javascript:showContent()"/>
                                <div class="back-end box"><span>TRANSFERENCIA</span></div>
                            </label>
                        </div>  
                    </div>

                     <input class="form-control" type="hidden" name="usuario" id="usuario" value="<?php echo $usu_id ?>">

                    <div id="ventana_efec">
                        <div id="efe" style="display: block;">   </div>
                    </div>

                    <!-- /.TRANSFERENCIA -->
                    <div id="ventana_transferencia">   
                        <div id="tran" style="display: none;">
                            <label>PLATAFORMA DE PAGO</label>
                            <section id="intro" >
                                <select name="banco" id="banco" class="form-control name_list input-sm" required>
                                   
                                    <?php
                                        $datos = mysqli_query($con,"SELECT * FROM banco WHERE empresa='$empresa' order by ban_nombre asc") ;
                                        while( $fila = mysqli_fetch_array( $datos ) )
                                        {
                                            echo' <option value="'.$fila['ban_nombre'].'">'.$fila['ban_nombre'].'</option>';
                                        }
                                    ?>
                                </select>
                            </section>
                        </div>
                    </div>
                              
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button name="registrar" value="registrar" type="submit" class="btn btn-success"><i class="icon-ok"></i> <strong>Registrar</strong></button>
                    </div>
                </form>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<!-- ESTYLOS BOTONES -->
<link href="css/botones_factura.css" rel="stylesheet" media="all"> 

<script language="javascript">
  $( "#form_egreso" ).submit(function( event ) {
  $('#registrar').attr("disabled", true);

 var parametros = $(this).serialize();
   $.ajax({
      type: "POST",
      url: "php_egresos/registrar_egreso.php",
      data: parametros,
        beforeSend: function(objeto){
         $('#resultados').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
      success: function(datos){
      $("#resultados").html(datos);
      $('#registrar').attr("disabled", false);
      $('#egreso').modal('hide');
      $('body').removeClass('modal-open');
      $('.modal-backdrop').remove();
      load(1);
      }
  });
  event.preventDefault();
})


function showContent() 
{
    efe = document.getElementById("efe");
    tran = document.getElementById("tran");
   
    Efectivo = document.getElementById("Efectivo");
    Transferencia = document.getElementById("Transferencia");     
    
    if (Efectivo.checked) 
    {
        efe.style.display='block';
        tran.style.display='none';
    }
    else  if (Transferencia.checked)
    {
        efe.style.display='none';
        tran.style.display='block';
    }
}

</script>