Ver Mensaje Individual
  #12 (permalink)  
Antiguo 14/03/2014, 14:45
and_l_f
 
Fecha de Ingreso: febrero-2014
Ubicación: Cali
Mensajes: 20
Antigüedad: 10 años, 2 meses
Puntos: 0
Respuesta: Problemas al cargar formulario ajax y javascript

cargar los menus
Código PHP:
Ver original
  1. <?php
  2. require_once("../modelo/conectar.php");
  3. require_once("cargarItems.php");
  4.  
  5.  function cargarMenu()
  6. {
  7. $con=conectar();
  8. $sql= "select * from menus where pertenece=0" ;
  9. $res= mysql_query($sql,$con);
  10. //$contador=0;
  11. while ($reg= mysql_fetch_array($res)) {
  12. ?>
  13.  
  14.  
  15.   <li id="<?php echo $reg['id_html'];  ?>">
  16.   <a  href="index.php?id=<?php echo $reg['menu_codi']; ?>" id="<?php echo $reg['id_html'];  ?>"> <?php  echo $reg["menu_nomb"];  ?></a>
  17. </li>
  18.  
  19.  
  20.  
  21. <?php
  22. $_SESSION['var']=$reg['menu_codi'];
  23. //cargarItems();
  24.  
  25.  
  26. }
  27. }



pagina principal


Código HTML:
Ver original
  1. <?php
  2. require('php_lib/include-pagina-restringida.php');
  3. require_once("../control/cargar.php");
  4. if(!isset($_SESSION))
  5.  {
  6.     session_start();
  7.  }
  8.  
  9. ?>
  10.  
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  12. <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.google.com/2005/gml/b" xmlns:data="http://www.google.com/2005/gml/data" xmlns:expr="http://www.google.com/2005/gml/expr" style="height: 100%;">
  13.  
  14.  
  15. <?php $licencia1=$_SESSION['LICENCIA'];  ?>
  16.    <title>Menu incluido</title>
  17.     <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  18.     <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' />
  19.  <script language="javascript" type="text/javascript" src="jquery.js"> </script>
  20.  <script type="text/javascript" language="javascript" src="funcionesJquery.js"></script>
  21.  <link rel='stylesheet' type='text/css' href='estilo.css' />
  22.  <script language="javascript">
  23.         $(document).ready(Inicio); //funcion inicial de JQuery
  24.     </script>
  25.   </head>
  26.  
  27.  
  28.   <label>Bienvenido Mr. <strong> <?php print_r($_SESSION['NOMBRE']) ; ?></strong></label>
  29.   <a href='logout.php' title="Cerrar mi sesion como usuario validado">Cerrar Sesion</a>
  30.  
  31. <div id="cssmenu">
  32. <ul>
  33.  <?php
  34. cargarMenu();
  35.  
  36. ?>
  37. </ul>
  38. </div>
  39. <div id="cajaSM">
  40.  
  41.   <?php
  42.  cargarSM();
  43.  ?>
  44. </div>
  45.  
  46.  
  47.       <div id="cajaInf">
  48.  
  49.  
  50.                 </div>
  51. </body>
  52. </html>


funcionesJquery.js

Código Javascript:
Ver original
  1. function Inicio () {
  2.     // body...
  3.    
  4.  $.ajax({
  5.             type: "post",
  6.             url: "prospectos.php",
  7.             dataType: "html",
  8.             success: function(result) {
  9.                 $("#cajaInf").html(result);
  10.             }
  11.         });
  12.  
  13. }


formulario a cargar

Código HTML:
Ver original
  1.     <head>
  2.         <title>Listado de Prospectos</title>
  3.     <script language="javascript" type="text/javascript" src="jquery.js"> </script>
  4.     <script type="text/javascript" language="javascript" src="funcionesJquery.js"></script>
  5.         <link rel="stylesheet" type="text/css" href="estiloP.css" />
  6.        
  7.     </head>
  8.     <body>
  9.        
  10.             <?php foreach($listado as $fila){ ?>
  11.            
  12.             <div class="contenedor">
  13.             <div class="datos1">
  14.             <div class="circular" style="float:left">
  15.             <label ><center>1</center></label>
  16.             </div>
  17.             <div  style="float:left; width: 6%; height: 12%"; >
  18.                 <IMG SRC="<?php  echo $fila['campo24']; ?>" width=100% height=100% />
  19.             </div>
  20.  
  21.             <div class="info">
  22.                 <ul class="nombre" align="center">
  23.                
  24.                     <li><b><?php echo $fila['nombres'] ?></b> </li>
  25.                
  26.                     <li><?php echo $fila['campo3'] ?> </li>
  27.                
  28.                 </ul>
  29.                
  30.                 <ul>
  31.                
  32.                     <li> <IMG SRC="images/tel.png"/> <?php echo $fila['campo5'] ?> </li>
  33.                
  34.                     <li><IMG SRC="images/cel.png"> <?php echo $fila['campo6'] ?> </li>
  35.                
  36.                     <li> <IMG SRC="images/dir.png"> <?php echo $fila['campo4'] ?> </li>
  37.            
  38.                     <li> <IMG SRC="images/mail.png"> <?php echo $fila['campo7'] ?> </li>
  39.  
  40.                 </ul>  
  41.             </div> 
  42.             <div class="diasR">
  43.                 <ul>
  44.                     <li><center><IMG SRC="images/torta.jpg"  /></center></li>
  45.                     <li><center>Quedan 5 dias</center></li>
  46.                 </ul>
  47.             </div>
  48.  
  49.             <div class="referido">
  50.                 <IMG SRC="images/referido.png" class="Adias" title="<?php echo "Referido"; ?>"/>
  51.             </div>
  52.  
  53.             <div class="recordatorio">
  54.                 <IMG SRC="images/recordatorio.png" class="Arecordatorio" title="<?php echo "Referido"; ?>"/>
  55.             </div>
  56.  
  57.             <div class="mapa">
  58.     <!--<iframe  frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.es/?ie=UTF8&amp;ll=3.444883,-76.437378&amp;spn=0.834815,1.352692&amp;t=m&amp;z=10&amp;output=embed"></iframe><br />
  59.         --> </div>
  60.  
  61.             </div>
  62.  
  63.             <div>
  64.             <div class="comentarios">
  65.  
  66.            
  67.                
  68.             </div>
  69.         </div>
  70.             <div class="cajaComunicacion">
  71.                 <label> <center>Zona comunicacion</center></label>
  72.             </div>
  73.             <div class="cajaR">
  74.                 <label> <center>Zona Recordatorio</center></label>
  75.                
  76.             </div>
  77.  
  78.             </div>
  79.         <hr size="1px" color="red" />
  80.        
  81.             <?php } ?>
  82.        
  83.     </body>
  84. </html>



amigo eso es todo lo que tengo