es que tengo un sistema de registro re usuarios con fechas de vencimiento y quiero que un botón que indica si esta inactivo o activo cuando este vencido esa cuenta quiero que el icón desaparezca al esta la cuenta vencida
. este es el código que muestra todos los usuarios en lista y con todas las funciones.
Código PHP:
Ver original
<?php // Mostrar el listado de mis usuarios $u = new usuarios(); $listado = $u->listado(); $cuantos = $u->cuantos(); $de = $cuantos + $_SESSION['creditos_altas']; $creditosRenovaciones = $_SESSION["creditos_renovaciones"]; $p = $_SESSION["posicion"]; if( $cuantos < $de || $_SESSION["posicion"] == ADMIN) { echo "<a href='?mod=usuarios&nuevo'> [Nuevo] </a>"; if( $_SESSION["posicion"] != ADMIN ) echo "| {$cuantos} de {$de} créditos"; } ?> <script type="text/javascript"> $.tipo = function( id ) { var t = $('#tipo_'+id).val(); if( t == 0 ) { $('#altas_'+id).hide(); $('#renovaciones_'+id).hide(); $('#boton_'+id).hide(); }else if( t == 1 ) { $('#altas_'+id).show(); $.reestablecer('#renovaciones_'+id); $('#boton_'+id).show(); }else if( t == 2 ) { $('#renovaciones_'+id).show(); $.reestablecer('#altas_'+id); $('#boton_'+id).show(); } } $.reestablecer = function( id ) { $(id+" option:selected").text(0) ; $(id).hide(); } $.SumarCreditos = function( este, id,fv ) { $.get('modulos/usuarios/vista_sumar_creditos.php',{id_usuario:id,p:<?php echo $p?>,creditosRenovaciones:<?php echo $creditosRenovaciones?>,fv:fv},function(data){ $(este).parent().html(data); }); } </script> <?php if( $listado ){ ?> <table cellpadding="5" cellspacing="0" width="700" class="listado"> <thead> <tr> <th width="100"> USUARIOS: </th> <th> Contraseña </th> <th width="70"> Inicio: </th> <th> Vencimiento: </th> <th> Renovar: </th> <th> Activo: </th> <th> Editar: </th> <th> Eliminar: </th> </tr> </thead> <tbody> <tr> <th> <?php echo $row["usuario"];?><br /> <span><?php echo $row["nombre"];?></span> </th> <th> <?php echo $row["contrasena"];?><br /> </th> <td> <?php echo $row["fecha_inicio"];?> </td> <td> <?php echo $row["fecha_vencimiento"];?> </td> <td> <a href="#" onclick="$.SumarCreditos(this,'<?php echo $id?>','<?php echo $row['fecha_vencimiento']?>');"> Sumar </a> </td> <td> <a href="includes/proceso_activar.php?id=<?php echo $row["id_usuario"]?>&s=<?php echo $row["status"] ?>"> <img src="images/<?php echo $row["status"] == 0 ? 'no' : 'si'?>.png" width="20" height="20" alt="Inactivo"> </a> </td> <td> <a href="?mod=usuarios&editar&id=<?php echo $row["id_usuario"]?>"> <img src="images/editar.png" width="20" height="20" alt="Editar"> </a> </td> <td> <a href="?mod=usuarios&eliminar&id=<?php echo $row["id_usuario"]?>" onclick="return confirm('Realmente desea eliminar al usuario: <?php echo $row["usuario"]?>?');"> <img src="images/eliminar.png" width="20" height="20" alt="Eliminar"> </a> </td> </tr> <?php }?> </tbody> </table> <?php }else{?><br /><br /> <div class="msj_info"> No hay usuarios creados. </div> <?php }?>