• Jueves 28 de Marzo de 2024, 21:39

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - AndresFCECEP

Páginas: [1]
1
PHP / Cargar datos de un foreach dentro de otro
« en: Martes 25 de Marzo de 2014, 14:52 »
Hola a toda la gente del foro tengo el siguiente problema resulta qque tengo un foreach el cual contiene otros 2 foreach ya que este tiene que pasarle una variable a esos otros dos foreach para poder que carguen los datos y lo que pasa es que se demora mucho en la carga de los datos y carga la pagina y al rato los datos como puedo mejorar esto aqui dejo algo de mi codigo.

Código: PHP
  1. <body>
  2.    
  3.    
  4.             <?php $Ncabezera=0; $ps=": " ?>
  5.                         <?php foreach($listado as $fila){
  6.                          
  7.              $idComen= $fila['id'];
  8.                          $Ncabezera= $Ncabezera + 1;
  9.              ?>
  10.                         <form method="post">
  11.                         <div style="float: left; border-bottom: 1px dotted #444; border-width: 2px; margin-top: 10px;">
  12.                              
  13.                  <div style="float: left; width: 100%; margin-bottom: 10px; ">
  14.                    
  15.                     <div style="float: left; width: 60%; margin-top: 5px;">
  16.                    
  17.                         <div style="float: left; width: 100%;">
  18.  
  19.                             <div style="float: left; width: 45%;">
  20.                              
  21.                               <div  style="float:left; width: 35%; height: auto;">
  22.                                               <ul style="font-family:sans-serif; font-size:11px; list-style:none; margin: 0; padding: 0;" align="left">
  23.                                     <li style="color: blue;"><?php echo $Ncabezera;  ?></li>
  24.                                     <li> <IMG SRC="<?php  echo $fila['campo24']; ?>" width=70% height=70px; /> </li>
  25.                                     <li>valor</li>
  26.                                   </ul>
  27.                                    
  28.                                       </div>                    
  29.                              
  30.                               <div  style="float:left; width: 65%; height: auto;">
  31.                                              
  32.                                   <ul style="font-family:sans-serif; font-size:12px; list-style:none; margin: 0; padding: 0;" align="left">
  33.                                                 <div style="margin-left: 10px;">      
  34.                                                        <li><b><?php echo $fila['nombres'] ?></b> </li>
  35.                                        
  36.                                                        <li><?php echo $fila['campo3'] ?> </li>
  37.        
  38.                                                            <li><IMG SRC="images/tel.png"/> <?php echo $fila['campo5'] ?> </li>
  39.                                                
  40.                                                            <li><IMG SRC="images/cel.png"> <?php echo $fila['campo6'] ?> </li>
  41.                                                
  42.                                                            <li><IMG SRC="images/dir.png"> <?php echo $fila['campo4'] ?> </li>
  43.                                        
  44.                                                            <li><IMG SRC="images/mail.png"> <?php echo $fila['campo7'] ?> </li>
  45.                                                 </div>
  46.                                   </ul>
  47.                                                                                  
  48.                                       </div>    
  49.                                              
  50.                             </div>
  51.                                    
  52.                             <div style="float: left; width: 50%;">
  53.                                        
  54.                                 <div style="float: left; width: 100%;">
  55.        
  56.                                     <div style="float: left;" >
  57.                                                         <IMG SRC="images/referido.png" class="Adias" title="<?php echo "Referido"; ?>"/>
  58.                                                 </div>
  59.                        
  60.                                                 <div style="float: right; ">
  61.                                                         <IMG SRC="images/recordatorio.png" class="Arecordatorio" title="<?php echo "Recordatorio"; ?>"/>
  62.                                                 </div>
  63.                                    
  64.                                 </div>
  65.                                
  66.                                 <div style="float: left; width: 100%;">
  67.                                     <iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="100%" 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 />
  68.                                     </div>
  69.                        
  70.                             </div>
  71.                        
  72.                         </div>
  73.                        
  74.                         <form method="post">
  75.                         <div style="float: left; width: 95%;">
  76.                        
  77.                             <label>Seguimiento</label> <label style="float: right;" > <a href="#">Ver mas comentarios</a></label>
  78.                            
  79.                             <?php  
  80.                             $comentarios= new Prospecto();
  81.                             $lista = $comentarios->comentarios($idComen);
  82.                            
  83.                             ?>
  84.                             <?php foreach($lista as $campo) {
  85.                                
  86.                                
  87.                                 $fechaCom = $campo['fecha'];
  88.                                 $horaCom = $campo['hora'];
  89.                                 date_default_timezone_set('UTC');
  90.                                 date_default_timezone_set("America/Bogota");
  91.                                 $fechaSis = date("Y-m-d");
  92.                                 $horaSis = date ("H:i:s",time());
  93.                                 //echo $prueba = date("Y-m-d", date());
  94.                                 $dias= new Prospecto();
  95.                                 $diasImp = $dias->dateDif($fechaCom,$fechaSis);
  96.                                 $horas = new Prospecto();
  97.                                 $horasImp = $horas->RestarHoras($horaCom,$horaSis);
  98.                                 ?>
  99.                                
  100.                                 <div style="border:1px solid #ffffff;   background-color: #edeff4; margin-top: 2px;" >
  101.                                 <li style="list-style: none;"> <label style="font-family: sans-serif; color: blue; font-size: 14px;"> <?php print_r($_SESSION['NOMBRE']);echo $ps;?></label> <label style="font-size: 13px;"> <?php echo $campo['comentario']; ?></label> </li>
  102.                                 <?php
  103.                                
  104.                                 if($diasImp==1 or $diasImp > 1){
  105.                                    
  106.                                 ?>
  107.                                 <li style="list-style: none;"> <label style="font-family: sans-serif; color: gray; font-size: 10px;" >hace: <?php echo $diasImp; ?> dia(s) &nbsp;</label> </li>
  108.                                 <?php    
  109.                                 }elseif($diasImp < 1){
  110.                                     $horasVer= substr($horasImp,0,2);
  111.                                     if($horasVer < 1){
  112.                                         $minutos = substr($horasImp,3,2);
  113.                                 ?>
  114.                                 <li style="list-style: none;"> <label style="font-family: sans-serif; color: gray; font-size: 10px;" >hace: <?php echo $minutos; ?> minutos &nbsp;</label> </li>
  115.                                 <?php
  116.                                     }elseif($horasVer == 1 or $horasVer > 1){
  117.                                 ?>
  118.                                 <li style="list-style: none;"> <label style="font-family: sans-serif; color: gray; font-size: 10px;" >hace: <?php echo $horasVer; ?> hora(s) &nbsp;</label> </li>
  119.                                 <?php        
  120.                                     }
  121.                                    
  122.                                 }
  123.                                 ?>
  124.                                 </div>
  125.                             <?php } ?>
  126.                             <div style="border:1px solid #000000;   background-color: #edeff4; margin-top: 2px;">
  127.                                 <option style="visibility: hidden;" id="id_pros" value="<?php echo $campo['id_pros']; ?>"></option>
  128.                                 <input type="text" id="nuevoComentario" placeholder="Escriba aqui un nuevo comentario" style="width: 100%;" onkeypress="validar(event)" value="" />
  129.                                 <li style="list-style: none; font-size: 11px; ">
  130.                                     <label>Recordatorio?</label>
  131.                                     <input type="checkbox" id="recordatorio" name="recordatorio" value='1' onchange="javascript:activar()"  />
  132.                                 </li>
  133.                                 <li style="list-style: none; font-size: 11px; "  >
  134.                                     &nbsp;
  135.                                     <label>Tipos: </label>
  136.                                     <select id="tipos" disabled="disabled"  >
  137.                                         <option value="1">Llamada</option>
  138.                                         <option value="2">Visita</option>
  139.                                         <option value="3">Confirmacion</option>
  140.                                     </select> &nbsp;
  141.                                     <label> Fecha</label>
  142.                                     <input type="date" name="fecha"  value="" disabled="disabled" id="fecha" />&nbsp;
  143.                                     <label>Hora</label>
  144.                                     <input type="time" name="hora" value=""  id="hora" disabled="false" /> &nbsp;
  145.                                     <input type="button" value="Guardar" id="guardarComen" disabled="disabled"  />
  146.                                 </li>
  147.                              </div>
  148.                         </div>
  149.                         </form>
  150.                     </div>
  151.                    
  152.                     <div style="float: left; width: 35%;">
  153.                       <li style="list-style: none;">
  154.                        <label style="font-family: sans-serif; font-size: 13px; color: blue; padding: 10px 0 0 10px;">Documentos</label> <label style="float: right; color: blue;" > <a href="#">Ver mas Documentos</a></label>
  155.                       </li>
  156.                        <div style="float: left; width: 100%; padding: 10px 0 0 10px;">
  157.                                 <div style="float: left; width: 100%; border:1px solid #000000;  background-color: #edeff4;">
  158.                                                 <li style="list-style: none;"> Cuadro 1</li>
  159.                                         </div>
  160.                                 <li style="list-style: none;">
  161.                                 <label style="font-family: sans-serif; font-size: 13px; color: blue; margin-top: 2px;">Recordatorios</label> <label style="float: right; color: blue;" > <a href="#">Ver mas Recordatorios</a></label>
  162.                                 </li>
  163.                                 <div style="float: left; width: 100%; border:1px solid #000000; margin-top: 2px; background-color: #edeff4;" >
  164.                          <?php
  165.                        
  166.                         $recordatorios= new Prospecto();
  167.                         $listaR = $recordatorios->cargarRecordatorios($idComen);
  168.                        
  169.                         foreach($listaR as $columna){
  170.                           ?>
  171.                         <option style="visibility: hidden;" id="id_prosp" value="<?php echo $campo['id_pros']; ?>"></option>
  172.                         <li style="list-style: none; font-family: sans-serif; font-size: 11px;">
  173.                         <?php
  174.                         echo $columna['nombre'].'-'.$columna['hora_recor'].': '.$columna['recordatorio'];
  175.                          ?>
  176.                          </li>                                
  177.                         <?php
  178.                          }
  179.                         ?>    
  180.                                 </div>                  
  181.                         </div>                        
  182.                        
  183.                     </div>
  184.                  
  185.                 </div>
  186.                  
  187.            </div>          
  188.  
  189.            
  190.                  </form>
  191.                   <?php } ?>
  192.        
  193.         </body>
  194.  

2
CSS / SASS / LESS / Posicion de un div debajo de otro de forma automatica
« en: Lunes 3 de Marzo de 2014, 22:02 »
Buenas tardes a todos quisiera saber si me pueden colaborar en como darle a los div un modo automatico para que aparezca de nuevo tal como los tengo debajo de los primeros ya que a traves de php cargo los datos y necesito que se me impriman n cantidad de veces gracias aqui dejo el codigo

Código: [Seleccionar]
@charset "UTF-8";

.foto{
list-style: none;

width: 6%;
height: 12%;

margin: 1.5% 3%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.ajustar{
list-style: none;

width: 6%;
height: 12%;


position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.circular {
width: 30px;
height: 30px;
border-radius: 15px;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;
-webkit-border-radius: 15px; -moz-border-radius: 15px;
}

.info{
list-style: none;

width: 18%;
height: 30%;

margin: 1.5% 10.5%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;

}

.diasR{
list-style: none;

width: 6%;
height: 14%;

margin: 8.5% 3%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.mapa{
list-style: none;

width: 22%;
height: 23%;

margin: 5% 30%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.referido{
list-style: none;

width: 3%;
height: 5%;

margin: 1.5% 30%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.Adias{
list-style: none;

width: 3%;
height: 5%;

position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}
.recordatorio{
list-style: none;

width: 3%;
height: 5%;

margin: 1.5% 37%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.Arecordatorio{
list-style: none;

width: 3%;
height: 5%;

position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}
.comentarios{
list-style: none;
overflow-y: scroll;
width: 49%;
height: 20%;

margin: 17% 3%;
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;

}
#comentariado{


width: 46%;
height: 8%;
margin: 0.5% 1%;
background-color: rgb(55,22,11);
border:3px solid #f4f4f4;
background:rgba(255,255,255,.5);
position: fixed;

-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
-webkit-box-shadow: 0 0 2px #aaa;
-moz-box-shadow: 0 0 2px #aaa;
box-shadow: 0 0 2px #aaa;
}

.cajaComunicacion{
  width:13%;
  height: 21%;


  margin:1% 55%;
  padding:10px 50px;
  border:3px solid #f4f4f4;
  background:rgba(255,255,255,.5);
  position: fixed;

  -webkit-border-radius:10px;
  -moz-border-radius:10px;
  border-radius:10px;
 
  -webkit-box-shadow: 0 0 2px #aaa;


  -moz-box-shadow: 0 0 2px #aaa;
  box-shadow: 0 0 2px #aaa;
}

.cajaR{
  width:13%;
  height: 21%;


  margin:14% 55%;
  padding:10px 50px;
  border:3px solid #f4f4f4;
  background:rgba(255,255,255,.5);
  position: fixed;

  -webkit-border-radius:10px;
  -moz-border-radius:10px;
  border-radius:10px;
 
  -webkit-box-shadow: 0 0 2px #aaa;


  -moz-box-shadow: 0 0 2px #aaa;
  box-shadow: 0 0 2px #aaa;
}


3
PHP / iteraccion foreach con div en php
« en: Lunes 3 de Marzo de 2014, 19:47 »
Buenos dias a todos, si me pueden ayudar le agradeceria en el alma

Estoy cargando un listado de clientes desde mysql el los carga bien pero necesito que repita el foreach creando nuevos div en imprimiendo los datos uno debajo del otro pero no lo hace lo que hace es imprimirlos uno encima de otro Muchas gracias por la ayuda que me puedan brindar

Código: PHP
  1. <?php
  2.         require_once('php/prospecto_modelo.php');
  3.         $prospecto1 = new Prospecto();
  4.         $listado = $prospecto1->listaProspecto();
  5. ?>
  6. <html>
  7.         <head>
  8.                 <title>Listado de Prospectos</title>
  9.                 <script language="javascript" type="text/javascript" src="jquery.js"> </script>
  10.                 <script type="text/javascript" language="javascript" src="funcionesJquery.js"></script>
  11.                 <link rel="stylesheet" type="text/css" href="estiloP.css" />
  12.                 <script language="javascript"> 
  13.                         $(document).ready(Inicio); //funcion inicial de JQuery
  14.                 </script>
  15.         </head>
  16.         <body>
  17.                 <div class="circular">
  18.                         <label><center>1</center></label>
  19.                 </div>
  20.  
  21.                         <?php foreach($listado as $fila){ ?>
  22.                         <div class="foto">
  23.                         <IMG SRC="<?php echo $fila['campo24'];  ?>" class="ajustar"/>
  24.                         </div>
  25.                         <div class="info">
  26.                         <table class="nombre" align="center">
  27.                                 <tr>
  28.                                         <td><b><?php echo $fila['nombres'] ?></b> </td>
  29.                                 </tr>
  30.                                 <tr>
  31.                                         <td><?php echo $fila['campo3'] ?> </td>
  32.                                 </tr>
  33.                 </table>
  34.                 <table>
  35.                                 <tr>
  36.                                         <td> <IMG SRC="images/tel.png"/></td>
  37.                                         <td> <?php echo $fila['campo5'] ?> </td>
  38.                                 </tr>
  39.                                 <tr>
  40.                                         <td><IMG SRC="images/cel.png"></td>
  41.                                         <td> <?php echo $fila['campo6'] ?> </td>
  42.                                 </tr>
  43.                                 <tr>
  44.                                         <td> <IMG SRC="images/dir.png"> </td>
  45.                                         <td> <?php echo $fila['campo4'] ?> </td>
  46.                                 </tr>
  47.                                 <tr>
  48.                                         <td> <IMG SRC="images/mail.png"> </td>
  49.                                         <td> <?php echo $fila['campo7'] ?> </td>
  50.                                 </tr>
  51.                 </table>       
  52.                         </div> 
  53.                         <div class="diasR">
  54.                                 <center><IMG SRC="images/torta.jpg" /></center>
  55.                                 <center><label>Quedan 5 dias</label></center>
  56.                         </div>
  57.  
  58.                         <div class="mapa">
  59.         <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 />
  60.                         </div>
  61.  
  62.                         <div class="referido">
  63.                                 <IMG SRC="images/referido.png" class="Adias" title="<?php echo "Referido"; ?>"/>
  64.                         </div>
  65.  
  66.                         <div class="recordatorio">
  67.                                 <IMG SRC="images/recordatorio.png" class="Arecordatorio" title="<?php echo "Referido"; ?>"/>
  68.                         </div>
  69.  
  70.                         <div class="comentarios">
  71.                                 <div class="comentariado" >
  72.                                         <?php echo $fila['comentario']; ?>
  73.                                 </div>
  74.                         </div>
  75.  
  76.                         <div class="cajaComunicacion">
  77.                 <label> <center>Zona comunicacion</center></label>
  78.                         </div>
  79.                         <div class="cajaR">
  80.                 <label> <center>Zona Recordatorio</center></label>
  81.                         </div>
  82.                        
  83.  
  84.                         <?php } ?>
  85.                         <hr size="1px" color="red" />
  86.         </body>
  87. </html>
  88.  
  89.  


Páginas: [1]