Ver Mensaje Individual
  #35 (permalink)  
Antiguo 03/10/2012, 17:14
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 8 meses
Puntos: 10
Respuesta: Funcion en Paneles

Buenos dias, como veo que no me contesta nadie, pienso que no me explico lo suficiente o que no estoy en el foro adecuado. Por favor hago algunas aclaraciones para que se me entienda un poco mejor. Necesito saber como puedo pasar una variable de un archivo js a un php.
La variable es num_usuario, y la tengo en un formulario llamado index.php en el cual puedo buscar por nº de teléfono, localidad etc. El caso es que en este index.php tengo dos solapas, una llamada Usuarios y otra Aparatos.En la primera solapa Usuarios me salen en un div un listado de los usuarios buscados, y luego con un input radio html_user += '<td ><input name="demo" type="radio" value=""/></td>';, selecciono el usuario que yo quiera y paso la variable num_usuario a la pestaña Aparatos para que me liste en otro div llamado pestaña1 los aparatos que tiene el usuario que anteriormente habia seleccionado con el input radio.El problema está en que cuando selecciono el input y pincho en la pestaña Aparatos, solo me sale el php llamado listado_aparatos.php sin nigún dato.
Agradecería algún comentario.

index.php


Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <script type="text/javascript" src="assets/js/jquery-1.7.2.min.js"></script>
  5. <script type="text/javascript" src="assets/jqueryui/js/jquery-ui-1.8.16.custom.min.js"></script>
  6. <script type="text/javascript" src="assets/js/js.js"></script>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <title>Documento sin título</title>
  9. <link href="estilo1.css" rel="stylesheet" type="text/css" />
  10. <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
  11. <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
  12. <script>
  13. function mostrar(){
  14. $('#cover').html('<img src="cargando.gif">');
  15. var define ="nada"
  16. var pos_url = 'datos.php';
  17. var req = new XMLHttpRequest();
  18. if (req) {
  19. req.onreadystatechange = function() {
  20. if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {
  21.  
  22. document.getElementById('cover').innerHTML = req.responseText;}}
  23.  
  24. req.open('GET', pos_url +'?define='+define,true);
  25. req.send(null);}}
  26. </script>
  27. </head>
  28. <body >
  29. <div id="contenedor">
  30. <div id="cabecera">Consulta de intervenciones</div>
  31. <div id="tabla">
  32.     <div id="formulario">
  33.     <form id="frm_filtro" method="post" action="" name="form1">
  34.             <table width="685">
  35.   <tr>
  36.     <td width="9%" class="campo_apellidos2">Teléfonos</td>
  37.     <td width="9%"><input name="telefono" type="text" size="9" /></td>
  38.     <td width="9%"><input name="telefono2" type="text" id="telefono2" size="9" /></td>
  39.     <td width="9%"><input name="telefono3" type="text" id="telefono3" size="9" /></td>
  40.     <td width="32%">&nbsp;</td>
  41.     <td width="18%" class="campo_apellidos2">NIF</td>
  42.     <td width="14%"><input name="NIF" type="text" id="NIF" size="9" /></td>
  43.   </tr>
  44.   <tr>
  45.     <td class="campo_apellidos2">Nombre</td>
  46.     <td colspan="4"><input name="nombre_apellidos" type="text" size="30" />
  47.     <td>&nbsp;</td>
  48.     <td>&nbsp;</td>
  49.   </tr>
  50.   <tr>
  51.     <td class="campo_apellidos2">Localidad</td>
  52.     <td colspan="4"><input name="poblacion" type="text" size="30" />
  53.       <span class="campo_apellidos2">C.Postal</span>      <input name="cod_postal" type="text" id="cod_postal" size="5" /></td>
  54.     <td class="campo_apellidos2">Provincia</td>
  55.     <td><input name="provincia" type="text" size="9" /></td>
  56.   </tr>
  57.   <tr>
  58.     <td class="campo_apellidos2">Calle</td>
  59.     <td colspan="4"><input name="calle" type="text" id="calle" size="45" />
  60.       <span class="campo_apellidos2"></span>      <input name="numero" type="text" id="numero" size="5" /></td>
  61.     <td class="campo_apellidos2">Edificio</td>
  62.     <td><input name="edificio" type="text" id="edificio" size="5" /></td>
  63.   </tr>
  64.   <tr>
  65.     <td class="campo_apellidos2">Puerta</td>
  66.     <td colspan="3"><input name="puerta" type="text" id="puerta" size="5" />
  67.       <span class="campo_apellidos2">      Piso</span>
  68.       <input name="piso" type="text" id="piso" size="5" />
  69.       <span class="campo_apellidos2">Letra</span>        <input name="letra" type="text" id="letra" size="5" /></td>
  70.     <td>&nbsp;</td>
  71.     <td><span class="campo_apellidos2">Nº Mante.</span></td>
  72.     <td><input name="mantenimiento" type="text" id="mantenimiento" size="5" /></td>
  73.   </tr>
  74.   </table>
  75.   <table width="100%">
  76.   <tr>
  77.     <th scope="col"><button type="button"  id="btnfiltrar" name="btnfiltrar" style="border:0; margin:0; padding:0;cursor:pointer">
  78.   <img src="imagenes_menu/boton_buscar.png"/>
  79. </button>
  80. </th>
  81.   </tr>
  82. </table>                
  83.           </form>        
  84.  
  85.     </div>
  86.     <div id="paneles">
  87.       <div id="TabbedPanels1" class="TabbedPanels">
  88.         <ul class="TabbedPanelsTabGroup">
  89.           <li class="TabbedPanelsTab" tabindex="0">Usuarios</li>
  90.           <li class="TabbedPanelsTab" tabindex="0" onclick="buscarAparatos();">Aparatos</li>
  91.           <li class="TabbedPanelsTab" tabindex="0">Intervenciones</li>
  92. </ul>
  93.         <div class="TabbedPanelsContentGroup">
  94.           <div class="TabbedPanelsContent">
  95.            <div id="usuario">
  96.             <table width="100%" id="data" class="table-dg-grid" >
  97.              <thead>
  98.               <tr>
  99.        <tr bgcolor=#DFEBFF id=t70 ondblclick='coloreaf(70,1)' onMouseOver='coloreamosin(70,1)' onMouseOut='coloreamosout(70,1)'>
  100.                    <th><span title="nu_usuario">Nº Usuario</span></th>
  101.                     <th><span title="telefono">Teléfono</span></th>
  102.                     <th><span title="nombre">Nombre</span></th>
  103.                     <th><span title="poblacion">Población</span></th>  
  104.                      </tr>
  105.                 </thead>
  106.                 <tbody>
  107.                 </tbody>
  108.             </table>
  109.                 </div>
  110.           </div>
  111.           <div class="TabbedPanelsContent" id="pestaña1" >
  112.  
  113.           </div>
  114.           <div class="TabbedPanelsContent">
  115.            
  116.           <table cellpadding="0" cellspacing="0" id="data2">
  117.                 <thead>
  118.                   <tr>
  119.                     <th><span title="num_aviso"></span></th>
  120.                     <th><span title="num_usuario"></span></th>
  121.                     <th><span title="aparato"></span></th>
  122.                     <th><span title="calle"></span></th>
  123.                     <th><span title="fecha_recepcion"></span></th>
  124.                     <th><span title="fecha_recepcion"></span></th>
  125.                     <th><span title="sintoma"></span></th>
  126.                   </tr>
  127.                 </thead>
  128.                 <tbody>
  129.                 </tbody>
  130.               </table>            
  131.           </div>
  132. </div>
  133.       </div>
  134.       <table width="100%">
  135.         <tr>
  136. <th scope="col"><a class="" href="javascript:enviar_formulario()"><span></span><img src="imagenes_menu/generar_aviso1.png" width="150" height="40" border="0"/></a>
  137. </th>
  138.           <th scope="col">&nbsp;</th>
  139.           <th scope="col"></th>
  140.           <th scope="col"><a class="" href="javascript:enviar_formulario1()"><span></span><img src="imagenes_menu/boton_salir.png" width="150" height="40" border="0"/></a>
  141.  </th>
  142.         </tr>
  143.       </table>
  144.     </div>
  145. </div>
  146. </div>
  147. <script type="text/javascript">
  148. var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
  149. </script>
  150. </body>
  151. </html>

Última edición por satjaen; 04/10/2012 a las 02:20 Razón: No me contesta nadie?