
Problema para ejecutar un archivo dentro de un DIV
Publicado por Eric (77 intervenciones) el 10/06/2014 19:58:15
Buen dia amigos, hoy tengo una interrogante en la cual quiero que me ayuden, un par de dias atras cree un programa para hacer busquedas de libros y cargar los detalles de los libros dentro de un DIV, porq necesito ver los detalles en la misma pagina lo hago asi:
Y EL ARCHIVO PHP, que ejecuto dentro del DIV es : detalles_libros.php el siguiente:
El detalle es el siguiente, que en el DIV si se me cargan los detalles del libro pero cuando, doy clic en el boton:boleta, dentro del DIV en el formulario detalles_libros.php, no me hace nada y lo raro es que ya probe fuera del DIV y ahi si me trabaja perfectamente.

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<html>
<head>
<script type='text/javascript' src='jquery.min.js'></script>
<TITLE>Muestra los resultados paginados con Paginator.</TITLE>
<!--termina el reloj-->
<script src="../../SexyAlertBox/mootools.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../SexyAlertBox/sexyalertbox.css" type="text/css" media="all" />
<script src="../../SexyAlertBox/sexyalertbox.packed.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
<link href="../../css/Estilo_siadace.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="fe" id="f1" action="" method="post">
<h3> </H3>
<H2><CENTER><STRONG>ADMINISTRACION DE BIBLIOTECA<STRONG><CENTER><H2>
<table width="750" border="1" align="center" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#F0F0F0" frame="box" rules="all" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" bgcolor="#a6cbea"><h3 align="center">Catalogo de busqueda de Biblioteca</h3></td>
</tr>
<tr>
<td width="131" rowspan="2"><p></p></td>
<td width="160">Buscar Por:
<select name="tipobusqueda">
<option value="V_autor_1">Autor
<option value="V_tipo_contexto">Título
</select></td>
<td width="451">Termino de Busqueda:
<input name="terminobusqueda" type=text size="50"></td>
</tr>
<tr>
<td colspan="2">
CATEGORIAS
<p>
<ul id="nav">
<li><a href="Consulta_por_categorias.php">Generalidades</a></li>
<li><a href="Form_buscador_libros.php">Enlace Dos</a></li>
</ul>
<ul id="nav">
<?
$var="";
if(isset($_POST["btn1"])){
$btn=$_POST["btn1"];
if($btn=="busca"){
trim ($terminobusqueda);
if (!$tipobusqueda || !$terminobusqueda)
{
echo "<script> alert('No hay busqueda');</script>";
echo "<Script language='JavaScript'>";
echo"location.href='estandar.php';";
echo"</script>";
//echo "No has introducido los detalles de la busqueda. Por favor vuelve e inténtalo de nuevo.";
exit;
}
$tipobusqueda = addslashes($tipobusqueda);
$terminobusqueda = addslashes($terminobusqueda);
@ $db = mysql_pconnect("localhost", "root", "root");
if (!$db)
{
echo "Error: No se ha podido conectar a la base de datos. Por favor, prueba de nuevo más tarde.";
exit;
}
mysql_select_db("siadace01");
$consulta = "select * from tb_ejemplar where ".$tipobusqueda." like '%".$terminobusqueda."%'";
$resultado = mysql_query($consulta);
$num_resultados = mysql_num_rows($resultado);
echo "<p>Número de libros encontrados: ".$num_resultados."</p>";
for ($i=0; $i <$num_resultados; $i++)
{
$row = mysql_fetch_array($resultado);
echo "<p><strong>".($i+1).". Título: ";
echo"<li><a href=detalles_libros.php?codigo=".$row['C_codi_ejemp'].">".$row['V_tipo_contexto']."</a></li>";
echo "</p>";
}
}
}
?>
</ul>
<div id="show"></div>
</td>
</tr>
<tr>
<td height="26" colspan="3" align="center">
<input name="btn1" type="submit" class="clase_formulario" value="busca"/></td>
</tr>
</table>
</form>
<script type="text/javascript">
$(document).ready(function(){
$("#nav a").each(function(){
var href = $(this).attr("href");
$(this).click(function(){
$("#show").hide().load(href).fadeIn("slow"); //Le damos efecto
$(this).attr({ href: "#"});
});
});
});
</script>
</body>
</html>
Y EL ARCHIVO PHP, que ejecuto dentro del DIV es : detalles_libros.php el siguiente:
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
include("conexion.php");
$sql = "SELECT * FROM tb_ejemplar where C_codi_ejemp='$codigo'";
$rs = mysql_query($sql, $cn);
$row= mysql_fetch_assoc($rs);
?>
<html>
<head>
<TITLE>Muestra los resultados paginados con Paginator.</TITLE>
<!--termina el reloj-->
<script type='text/javascript' src='jquery.min.js'></script>
<script src="../../SexyAlertBox/mootools.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../SexyAlertBox/sexyalertbox.css" type="text/css" media="all" />
<script src="../../SexyAlertBox/sexyalertbox.packed.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
<link href="../../css/Estilo_siadace.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
//function llamaform()
//{
//location.href='Form_boleta_libros.php?codigo=codigo';
//}
function boleta()
{
document.fe.bandera.value="boleta";
document.fe.submit();
}
</script>
</head>
<body>
<form name="fe" id="f1" action="" method="post">
<h3> </H3>
<H2><CENTER><STRONG><STRONG><CENTER><H2>
<table width="385" border="1" align="center" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#F0F0F0" frame="box" rules="all" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" bgcolor="#a6cbea"><H3 align="center">Detalles de Material Didactivo</H3></td>
</tr>
<tr>
<td width="117">Tipo</td>
<td width="262"><?php echo $row['V_tipo_contenido']; ?> </td>
</tr>
<tr>
<td>Codigo</td>
<td><?php echo $row['C_codi_ejemp']; ?> </td>
</tr>
<tr>
<td>Titulo</td>
<td><?php echo $row['V_tipo_contexto']; ?> </td>
</tr>
<tr>
<td>Descripción</td>
<td><?php echo $row['V_descripcion']; ?> </td>
</tr>
<tr>
<td>Autores</td>
<td><?php echo $row['V_autor_1']; ?></td>
</tr>
<tr>
<td>Edición</td>
<td><?php echo $row['V_edicion_ejm']; ?> </td>
</tr>
<tr>
<td>Editorial</td>
<td><?php echo $row['V_editorial']; ?> </td>
</tr>
<tr>
<td>Disponiblilidad</td>
<td> </td>
</tr>
<tr>
<td><label></label></td>
<td> </td>
</tr>
<tr>
<input type="hidden" name="bandera">
<td colspan="2"><div align="center">
<input name="btn1" type="button" class="clase_formulario" value="Iniciar Prestamo" onClick="llamaform()"/>
<input name="bt_guardar2" type="button" class="clase_formulario" onClick="boleta()" value="Boleta" id="bt_guardar2" />
</div></td>
</tr>
</table>
</form>
<?
if($bandera=="boleta"){
echo "<Script language='JavaScript'>";
echo"location.href='Form_boleta_libros.php?codigo=$codigo';";
echo"</script>";
}
?>
</body>
</html>
El detalle es el siguiente, que en el DIV si se me cargan los detalles del libro pero cuando, doy clic en el boton:boleta, dentro del DIV en el formulario detalles_libros.php, no me hace nada y lo raro es que ya probe fuera del DIV y ahi si me trabaja perfectamente.
Valora esta pregunta


0