Hola, por favor si pueden ayudarme se lo agradecería. Tengo un div(datos_usuario) en el cual cargo una página(modificar_datos_usuario.php) cuando llamo una funcion(modificar_datos_cliente), pero no me carga. Que tengo mal
index.html
Código HTML:
Ver original<a class="dock-item" href=''><span>Modificar datos personales del Cliente
</span><img src="imagenes_menu/almacen3.jpg" alt="Almacen Cliente" onclick="modificar_datos_cliente()" style="cursor:pointer" /></a>
<div class="datos_usuario" id="datos_usuario"> <form method="POST" name="form1" id="form1" action="<?php echo $editFormAction; ?>">
<th scope="col" width="57">Teléfonos
</th> <th scope="col" width="52"><input name="telefonos" id="telefonos "type="text" size="9" maxlength="9" value="<?php echo $row_usuarios['telefonos']; ?>" />
</th> <th scope="col" width="52"><input name="movil" type="text" size="9" maxlength="9" value="<?php echo $row_usuarios['movil']; ?>" />
</th> <th scope="col" width="52"><input name="telefonos3" type="text" size="9" maxlength="9" value="<?php echo $row_usuarios['telefonos3']; ?>" />
</th> <th scope="col" width="245"> </th> DNI
<input name="dni" type="text" id="dni" size="9" maxlength="9" value="<?php echo $row_usuarios['dni']; ?>"/>
</th> <th scope="col" width="46">Nombre
</th> <th scope="col" width="88"><input name="name" type="text" id="name" size="25" value="<?php echo utf8_encode($row_usuarios['name']); ?>"/>
</th> <th scope="col" width="403"><input name="apellidos" type="text" id="apellidos" size="35" value="<?php echo utf8_encode($row_usuarios['apellidos']); ?>" />
</th>
index.js
Código Javascript
:
Ver originalfunction modificar_datos_cliente(id_aviso)
{
var boton = confirm("¿Modificar datos usuario?");////Como puedo darle CSS a esta ventana?
if (boton){
var id_aviso = $('#id_aviso') .val();
createAjax();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("datos_usuario").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","modificar_datos_usuario.php?ID=" + id_aviso,true);
xmlhttp.send(null);
}
}
modificar_datos_usuario.php
Código PHP:
Ver original<?php
require_once('Connections/conexion.php');
$id_aviso=$_GET['ID'];
$query_usuarios = "(SELECT id_aviso,telefonos,telefonos3,name,apellidos,dni,movil
FROM usuarios
WHERE id_aviso = '$id_aviso')
UNION ALL
(SELECT id_aviso,telefonos,telefonos3,name,apellidos,dni,movil
FROM avisos
WHERE id_aviso = '$id_aviso')";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form method="POST" name="form4" action="<?php echo $editFormAction; ?>">
<table width="79%">
<tr>
<th scope="col" width="57">M.Teléfonos</th>
<th scope="col" width="52"><input name="telefonos" id="telefonos "type="text" size="9" maxlength="9" value="<?php echo $row_usuarios['telefonos']; ?>" /></th>
<th scope="col" width="52"><input name="movil" type="text" size="9" maxlength="9" value="<?php echo $row_usuarios['movil']; ?>" /></th>
<th scope="col" width="52"><input name="telefonos3" type="text" size="9" maxlength="9" value="<?php echo $row_usuarios['telefonos3']; ?>" /></th>
<th scope="col" width="245"> </th>
<th scope="col" width="245"><label for="dni"></label>
DNI
<input name="dni" type="text" id="dni" size="9" maxlength="9" value="<?php echo $row_usuarios['dni']; ?>"/></th>
</tr>
</table>
<table width="296">
<tr>
<th scope="col" width="46">Nombre</th>
<th scope="col" width="88"><input name="name" type="text" id="name" size="25" value="
<?php echo utf8_encode($row_usuarios['name']); ?>"/></th>
<th scope="col" width="403"><input name="apellidos" type="text" id="apellidos" size="35" value="
<?php echo utf8_encode($row_usuarios['apellidos']); ?>" /></th>
</tr>
</table>
</form>
</body>
</html>
Un saludo