Primero hacemos las funciones una para cada boton
1: function Agregar(){
2: document.getElementById("usuarioslocos").style.display = "none";
3: document.getElementById("divpararegistrar").style.display = "table";
4: }
5:
6: function Eliminar(){
7: if(obtenerRadioSeleccionado("form", "radios")!=false){
8: if(confirm("Deseas Realmente eliminar este registro?")){
9: var id = obtenerRadioSeleccionado("form", "radios").value;
10: location.href= "index.php/welcome/deleteUserId/" + id;
11: }
12: else{ }
13: }
14: else{alert("No a seleccionado un registro !!");}
15: }
16:
17:
18: function Editar(){
19:
20: if(obtenerRadioSeleccionado("form", "radios")!=false){
21: if(confirm("Desea Modificar el registro?")){
22: var id = obtenerRadioSeleccionado("form", "radios").value;
23: location.href= "index.php/welcome/updateUserId/" + id;
24: }
25: else{ }
26: }
27: else{alert("No a seleccionado un registro !!");}
28: }
Creamos los botones y le asignamos una función a cada una
1: <button onclick="Agregar()" type="button">Agregar
2: <button onclick="Editar()" type="button">Editar
3: <button onclick="Eliminar()" type="button">Eliminar
4: <button onclick="PDF()" type="button">PDF
Luego configuramos los divs
1: <div id="usuarioslocos">
2: <table border="0" align="center" id="tabla">
3: <tr bgcolor="#7362ec" align="center" onmouseover='this.style.backgroundColor='#E13300''
4: onmouseout='this.style.backgroundColor='#7362ec''>
5:
6:ID
7:NOMBRE
8:APELLIDO
9:RFC
10:CONTRASEÑA CERTIFICADO
11:CERTIFICADO
12:LLAVE
13:SELECCIONAR
14:
15:"; 16:
17: <?php
18: $colorfila=0;
19:
20:
21: if($records!=false){22: foreach($records->result() as $row){23: if ($colorfila==0){24: $color= "#b5b5b5";25: $colorfila=1;
26: }else{27: $color="#f7f7f7";28: $colorfila=0;
29: }
30: echo "<tr bgcolor='".$color."' align='center' ";?> onmouseover="this.style.backgroundColor='#E13300'"31: onmouseout="this.style.backgroundColor=''">32:
33: <?php
34: echo ""; 35:
36: echo pintar($busqueda,$row->Cliente)."37:".pintar($busqueda,$row->Nombre)." 38:".pintar($busqueda,$row->Apellido)." 39:".pintar($busqueda,$row->RFC)." 40:".pintar($busqueda,$row->contraCertificado)." 41:".pintar($busqueda,$row->nombreCertificado)." 42:".pintar($busqueda,$row->nombreLlave)." 43:
44:
45:
46:<input type='radio' name='radios' value='".$row->Cliente."'>"; 47:
48: echo "
49: }
50:
51: }
52: ?>
53:
54:
55:
56:
57:
58:
59:
60:
Deja un comentario