Error al mostrar Informacion Div"s ocultos con informacion extraida de la DB
Publicado por nitramara (22 intervenciones) el 27/07/2019 17:57:10
Hola, si es posible alguien me podria colaborar e indicarme cual o cuales podrian ser los errores.
Veran, lo que intento hacer.. es que segun el usuario se muestre los datos asignados a el, "hasta aqui no hay lio,," luego que si el usuario quiere ampliar la informacion de los datos asignados, que de click sobre el dato y este despliegue div mostrando la informacion que ha de ser cargada en ese div oculto. "aca el lio.. " NO SE.. como o porque no me carga la informacion en la variable que ha de contener el ID especifico para que muestra la informacion que debe mostrar..
//Inicia la Conexion a la DB
Código PHP :
Código :
Código :
Código PHP :
Veran, lo que intento hacer.. es que segun el usuario se muestre los datos asignados a el, "hasta aqui no hay lio,," luego que si el usuario quiere ampliar la informacion de los datos asignados, que de click sobre el dato y este despliegue div mostrando la informacion que ha de ser cargada en ese div oculto. "aca el lio.. " NO SE.. como o porque no me carga la informacion en la variable que ha de contener el ID especifico para que muestra la informacion que debe mostrar..
//Inicia la Conexion a la DB
Código PHP :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include("conec.php");
conecta();
//Busqueda en tabla segun criterio
$sql = "SELECT * FROM prueba WHERE funci_asig = 'YM' order by registro ASC";
$result = mysql_query($sql);
?>
//Scrip oculta muestra div's
Código :
<script type="text/javascript">
document.write('<style type="text/css">div.cp_oculta{display: none;}</style>');
function MostrarOcultar(capa,enlace)
{
if (document.getElementById)
{
var aux = document.getElementById(capa).style;
aux.display = aux.display? "":"block";
}
}
</script>
//Div muestra informacion extraida segun criterio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<div align='center'>
<table border='1' cellpadding='0' cellspacing='0' width='600' bgcolor='#F6F6F6' bordercolor='#FFFFFF'>
<tr>
<td width='300' style='font-weight: bold'>NOMBRE</td>
<td width='300' style='font-weight: bold'>radicado</td>
</tr>
<?php
while ($registro = mysql_fetch_array($result)){
echo"<tr style='background-color:#FFFFFF;'>";
echo "<td width='200'>".$registro["funci_asig"]."</td>";
echo "<td width='200'><a href=javascript:MostrarOcultar('texto') ?ref=".$registro['rad_nurf2']." >".$registro['rad_nurf2']."</a></td>";
echo"</tr>";
}
?>
</table>
</div>
//Div que muestra y se oculta debe contener ampliada la informacion segun criterio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<div class="cp_oculta" id="texto">
<br><br>
<legend><b style="color: black;">Solicitudes</b></legend>
<div class="table-responsive">
<table class='table table-striped table-bordered' id='user_data'>
<thead>
<th style='aling center'>Asignación</th>
<th style='aling center'>Número</th>
<th style='aling center'>Radicado Nurf2</th>
<th style='aling center'>Gestion</th>
<th style='aling center'>Peticionario</th>
<th style='aling center'>Documento</th>
<th style='aling center'>cargo</th>
<th style='aling center'>teléfono</th>
<th style='aling center'>dirección</th>
<th style='aling center'>Correo</th>
</thead>
<?php
//pilas aca.. no se muestra el resultado de la DB por numero de radicado
//aca lio no obtiene la info que deberia traer para realizar la busqueda ampliada segun se de click sobre el argumento
$id = $_GET['ref'];
$query = "select * from prueba where rad_nurf2 = '$id'";
$result = mysql_query($query);
while ($registro = mysql_fetch_array($result)){
echo "
<td width='150'>$id</td>
<td width='150'>".$registro['fecha_ela']."</td>
<td width='150'>".$registro['registro']."</td>
<td width='150'>".$registro['gestion']."</td>
<td width='150'>".$registro['nombres']."</td>
<td width='150'>".$registro['documento']."</td>
<td width='150'>".$registro['cargo']."</td>
<td width='150'>".$registro['telefono']."</td>
<td width='150'>".$registro['direccion']."</td>
<td width='150'>".$registro['email']."</td>
";
}
?>
</table>
</div>
</div>
//Cierra conexion
1
2
3
<?php
mysql_close($conexion);
?>
Valora esta pregunta


0