Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/09/2011, 14:48
mixzplit
 
Fecha de Ingreso: enero-2011
Ubicación: Maracaibo
Mensajes: 179
Antigüedad: 14 años, 2 meses
Puntos: 2
Mostrar y Ocultar Contenido

Hola compañeros, el titulo del tema quizas no diga mucho, repecto a lo que quiero hacer, tengo el siguiente problema:

En un formulario ingresos "X" datos los cuales se guardan en una base de datos y en otro archivo genero una especie de DataGrid con tablas.

En el campo donde me muestra la descripcion del requerimiento que ingresé le valide que me mostrara cierta cantidad de caracteres y me mostrara [...] al final ya que hay descripciones demasiado largas debido a que es un campo BLOB en la base de datos.

Lo que quisiera es que en los puntos [...] al darle click me expandiera y me mostrara el resto de la descripcion, no se si me explique bien y espero haber posteado en el foro correcto, aqui les dejo el codigo que tengo:

Código PHP:
<?php
session_start
();
if(!isset(
$_SESSION['us_id'])){
header("Location: ../index.php"); 
} else { 
$usuario=$_SESSION['us_id'];
$admin=$_SESSION['us_tipo'];

$emp=$_GET["q"];

include_once(
"conexion.php");
include(
'./Scripts/funcion.php');
    
$conexion = new ControlBD();
    
$conexion->conectar();
    
$conexion->seleccionarBD();
    
$query="SELECT req_id, em_nombre,su_nombre, us_unidad, us_cargo, us_nombre, us_apellido, us_email, us_telefono, mo_nombre, tra_maestro, req_date, req_descripcion, req_valicacion, us_tipo, req_imagen, req_archivo FROM cgrequerimientos 
           INNER JOIN cgempresa on req_idempresa=em_id 
           INNER JOIN cgusuarios on req_usuario=us_id 
           INNER JOIN cgmodulo on req_idmodulo=mo_id 
           INNER JOIN cgtransacciones on req_idtrans=tra_tipo
           INNER JOIN cgsucursal ON req_idsucursal=su_id
            WHERE req_valicacion=0 and req_estado='Activo' AND em_id = '$emp'
            ORDER BY req_id,req_date"
;
$result=$conexion->ejecutarQuery($query);
?>
<form>
<a href="javascript:imprSelec('seleccion')" >Imprimir Requerimientos</a> 
<div class="centrado">
<DIV ID="seleccion">
<table class="tablas">
    <tr>
        <th>Empresa</th>
        <th>Sucursal</th>
        <th>Ticket</th>
        <!--<th>Departamento</th>
        <th>Cargo del Solicitante</th> -->
        <th>Nombre</th>
        <th>Email</th>
        <th>Telefono</th>
        <th>Modulo</th>
        <th>Transaccion</th>
        <th>Fecha</th>
        <th>Descripcion</th>
        <th>Imagen</th>
        <th>Documentacion</th>
        <th colspan="4">Acciones</th>
    </tr>
<? while($array=mysql_fetch_array($result)){ $id=$array['req_id'];?>
    <tr>
        <td><?=$array['em_nombre']; ?></td>
        <td><?=$array['su_nombre']; ?></td>
        <td><strong><?=$array['req_id']; ?></strong></td>
        <!--<td><?=$array['us_unidad']; ?></td>
        <td><?=$array['us_cargo']; ?></td>-->
        <td><?=$array['us_nombre']." ".$array['us_apellido']; ?></td>
        <td><?=$array['us_email']; ?></td>
        <td><?=$array['us_telefono']; ?></td>
        <td><?=$array['mo_nombre']; ?></td>
        <td><?=$array['tra_maestro']; ?></td>
        <td><?=cambiar_fecha($array['req_date']); ?></td>
        <td style=" text-align:justify; font-family:Tahoma, Geneva, sans-serif; font-size:12px;">
        <? if(strlen($array['req_descripcion']) <= 120){
             echo 
$array['req_descripcion'];
         }else{
              echo 
$descri=substr($array['req_descripcion'], 0120)." [...]";
         } 
?>
         </td>
        
        <td><a href="<?=$array['req_imagen']; ?>" rel="lightbox" title="imagen"><img src="<?=$array['req_imagen']; ?>" alt="imagen" width="72" height="64" /></a></td>
        
        <? $archivo=$array['req_archivo']; if(substr($archivo,-3) == 'doc'){ ?>  
        <td class="center"><a href="<?=$array['req_archivo']; ?>" title="Documentacion"><img src="images/word.png" alt="Word" width="50" height="50"  /></a></td>
        <? } if(substr($archivo,-4) == 'docx'){ ?>  
        <td class="center"><a href="<?=$array['req_archivo']; ?>" title="Documentacion"><img src="images/word.png" alt="Word" width="50" height="50"  /></a></td>
        <? } elseif(substr($archivo,-3) == 'xls'){ ?>  
        <td class="center"><a href="<?=$array['req_archivo']; ?>" title="Documentacion"><img src="images/excel.png" alt="Excel" width="50" height="50"  /></a></td>
        <? } elseif(substr($archivo,-4) == 'xlsx'){ ?>  
        <td class="center"><a href="<?=$array['req_archivo']; ?>" title="Documentacion"><img src="images/excel.png" alt="Excel" width="50" height="50"  /></a></td>
        <? } elseif(substr($archivo,-3) == 'pdf'){ ?>  
        <td class="center"><a href="<?=$array['req_archivo']; ?>" title="Documentacion"><img src="images/pdf.png" alt="Excel" width="50" height="50"  /></a></td>
        <? } else {?>
        <td class="center">No Tiene</td>
        <? ?>
        
        <td><a href="Javascript:Borrar('<?=$id;?>','Borrar_disp.php' ,'800','300')" title="Anular"><img src="./imagenes/eliminar.png" alt="Eliminar" border=0 ></a></td>
        <td><a href="javascript:Actualizar('<?=$id;?>','modificareq.php' ,'850','370')" title="Modificar"><img src="./imagenes/actualizar.png" alt="Modificar" border=0></a></td>
<? if($array['req_valicacion']==0){ ?>
        <td><a href="javascript:Validar('<?=$id;?>','activar.php' ,'800','300')" title="Validar"><img src="./imagenes/aceptar.png" alt="Agregar" border=0 ></a></td><? ?>
   
    <td><a href="javascript:Correo('<?=$id;?>','correo.php' ,'800','300')" title="Correo"><img src="./imagenes/mail.png" alt="Agregar" border=0 ></a></td>
   
    </tr>
<? ?>
</table>
</DIV>
</div>
</form>
</body>
<? }?>
Bueno espero puedan ayudarme, Saludos