Viewing file: cCorriente_view.php (3.69 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<div> <h1><?= $titulo ?></h1> <div id="buscador"> <form action="<?php echo base_url()?>cuentaCorriente/index/" method="post"> <input type="text" name="buscando" id="buscando" /> <input type="submit" class="btn btn-primary btn-lg" value="Buscar" /> </form> </div> <form action="<?php echo base_url()?>cuentaCorriente/inicio/" method="post" name="cuentaCorriente" > <?php $this->table->set_heading( 'Nombre','Razon social', 'Direccion','localidad','Mail' ,'Telefono','Boton'); //crea la primera fila de la tabla con el encabezado $tmp = array ( 'table_open' => '<table class="table table-bordered table-striped" id="busquedaRecibo" width="100%">' ); //modifica el espaciado $this->table->set_template($tmp); //aplico los cambios de modificacion anterior foreach($results->result() as $dato): $this->table->add_row($dato->nombre,$dato->razon_social,$dato->direccion,$dato->localidad,$dato->mail,$dato->telefono,'<input class="btn btn-primary btn-lg" type="submit" name="botonDetalle" id="botonDetalle" class="btnBoton" value="Ver Detalle" onclick="elegirCliente('. $dato->id.')">'); //agregamos la celda a la tabla por cada iteracion endforeach; echo $this->table->generate(); //cuando termina generamos la tabla a partir del vector echo $this->pagination->create_links(); ?> <br> <input type="hidden" name="numeroClienteCC" id="numeroClienteCC" value=""> </input> </form> </div> <script type="text/javascript"> function doSearch() { var tableReg = document.getElementById('busquedaCuentaCorriente'); var searchText = document.getElementById('busquedaNombre').value.toLowerCase(); for (var i = 1; i < tableReg.rows.length; i++) { var cellsOfRow = tableReg.rows[i].getElementsByTagName('td'); var found = false; for (var j = 0; j < cellsOfRow.length && !found; j++) { var compareWith = cellsOfRow[j].innerHTML.toLowerCase(); if (searchText.length == 0 || (compareWith.indexOf(searchText) > -1)) { found = true; } } if (found) { tableReg.rows[i].style.display = ''; } else { tableReg.rows[i].style.display = 'none'; } } } function elegirCliente(numeroCliente){ document.getElementById("numeroClienteCC").value=numeroCliente; } $('form').keypress(function(e){ if(e == 13){ return false; } }); $('input').keypress(function(e){ if(e.which == 13){ return false; } }); document.onkeydown = function(){ if (window.event && (window.event.keyCode == 8)) { valor = document.activeElement.value; if (valor==undefined) { return false; } //Evita Back en página. else { if (document.activeElement.getAttribute('type')=='sel ect-one') { return false; } //Evita Back en select. if (document.activeElement.getAttribute('type')=='but ton') { return false; } //Evita Back en button. if (document.activeElement.getAttribute('type')=='rad io') { return false; } //Evita Back en radio. if (document.activeElement.getAttribute('type')=='che ckbox') { return false; } //Evita Back en checkbox. if (document.activeElement.getAttribute('type')=='fil e') { return false; } //Evita Back en file. if (document.activeElement.getAttribute('type')=='res et') { return false; } //Evita Back en reset. if (document.activeElement.getAttribute('type')=='sub mit') { return false; } //Evita Back en submit. else //Text, textarea o password { if (document.activeElement.value.length==0) { return false; } //No realiza el backspace(largo igual a 0). else { document.activeElement.value.keyCode = 8; } //Realiza el backspace. } } } if(window.event && window.event.keyCode == 505){ window.event.keyCode = 505; } } </script>
|