Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/10/2009, 15:09
Avatar de towel
towel
 
Fecha de Ingreso: marzo-2009
Mensajes: 101
Antigüedad: 15 años, 2 meses
Puntos: 0
variable indefinida con checkbox

hola chicos espero que esten bien neceisto otra vez algo de ayuda he hecho
un correo en mi pagina y utilizo los checkbox estilo hotmail ahora eso esta bien el elimina los mensaje bien, ahora los mensajes los muestro con td oculto cuando el
mensaje esta havierto y lo deseo eliminar no me sirve me manda una variable indefinida me podrian ayudar aqui les dejo el codigo
codigo php
Código:
<?php
include('../funciones/error.php');
include('../funciones/funciones.php');
include('../funciones/class_conexion.php');
include('../funciones/paginator.php');
include('../funciones/paginator_html.php');
$BD = new class_conexion();
valida_session();
/*foreach ($_POST as $c => $v){
echo $c." = ".$v."<br>";
}*/
$page = 1;
$idusuarioS = $_SESSION['idusuarioS'];

$pag = "SELECT id_mail,id_usuario,id_usuarioS
		FROM usuarios_mensajes_mail
		WHERE id_usuario = '".$idusuarioS."'";
		$rpag = $BD->ejecutar_sql($pag);
        $nreg = $BD->num_rows($rpag);
		//echo "pag = ".$pag."<br>";
if($nreg > 0)
{
	$Registros = 15;
	$funcion = "mail_mail_ver";
	$a = & new Paginator_ajax($page, $nreg, $funcion);
	$a->set_Limit($Registros);//numero de registros por pagina
	$a->set_Links(3);
	
	//=Punto de partida de la Paginacion
	$limit1 = $a->getRange1(); 
	//=Numero de items que se despliegan en pantalla
	$limit2 = $a->getRange2();

		
$sql = "SELECT id_mail,id_usuario,id_usuarioS, mensaje_mail, fhingreso, newslastter, revizado_mail,
        (SELECT nombre_usuario FROM usuarios WHERE usuarios_mensajes_mail.id_usuarioS = usuarios.id_usuario ) AS nom_usuario
		FROM usuarios_mensajes_mail
		WHERE id_usuario = '".$idusuarioS."'
		ORDER BY fhingreso DESC 
		LIMIT ".$limit2." OFFSET ".$limit1."";
	    //echo "sql = ".$sql."<br>";
		$result = $BD->ejecutar_sql($sql);

?>
<html>
<head>
<title></title>
<link rel='stylesheet' href='./../funciones/translucido/css/lightbox.css' type='text/css' media='screen'/>
<script src='./../funciones/translucido/js/prototype.js' type='text/javascript'></script>
<script src='./../funciones/translucido/js/scriptaculous.js?load=effects' type='text/javascript'></script>
<script src='./../funciones/translucido/js/lightbox.js' type='text/javascript'></script> 
<!-- funcioones y estilos -->
<link href="./../estilo/estilo.css" rel="stylesheet" type="text/css">
<script src="./../funciones/funciones.js" language="javascript1.2"></script>
<script src="./../funciones/funciones_mail.js" language="javascript1.2"></script>
<script src="./../funciones/funciones_mail2.js" language="javascript1.2"></script>
<script src="./../funciones/funciones_perfil.js" language="javascript1.2"></script>
<script src="./../funciones/ajax.js"      language="javascript1.2"></script>
</head>
<body  topmargin="0" leftmargin="0">
<form action="<? $PHP_SELF;?>" method="post" id="usuario_mail_ver">

<?php
echo "<table width='650' height='0' align='center' border='0' cellpadding='0' cellspacing='0' >"; 
	   echo "	<tr>";
	      echo "<td class='cursor' valign='bottom' align='right' width='650'  height='20' background='../images/barralatestnewsxxx.png' >";
?>
		   <img src='./../images/DELETEMAIL.jpg' alt='DELETE' onClick="usuario_eliminar_mail('usuario_mail_ver', 'check_mailadmin');">&nbsp;&nbsp;&nbsp;</td>
<?php
		echo "	</tr>";
		echo "	<tr>";
	      echo "<td class='home2' align='center' width='650'  height='5' ></td>";
		echo "	</tr>";	
		echo "<tr>";
		 echo "<td id='tdmensajes1'></td>";
		echo "</td>";
		echo "<tr>";
		 echo "<td id='tdmensajes2'></td>";
		echo "</td>";		 
echo "</table>";		
/*if($nreg > $Registros)
  {
	echo "<table width='650'><tr><td  align='center'>";
	$a->barra_navega();
	echo "</td></tr></table>";
	}*/
	echo "<table id='menu'  width='650' height='0' align='center' border='0' cellpadding='0' cellspacing='4' bgcolor='#E3E6EF'>"; 
	   echo "	<tr>";
	      echo "<td class='home2' align='center' width='46'  height='10' >
		  <input type='checkbox' id='reset1' onclick=\"select_checkboxadmin('usuario_mail_ver', 'check_mailadmin', this);\"></td>";
		  echo "<td class='home2' align='center' width='222' height='10' >Subject</td>";
		  echo "<td class='home2' align='center' width='366' height='10' >Date</td>";
		   //echo "<td class='home5' align='center' width='530' >Mensaje</td>";
		echo "	</tr>";
		$i = 1;
		$id = 0;
	while($fila = $BD->fetch_array($result))
	{
		$id_mail	                  = $fila["id_mail"];
		$id_usuario                   = $fila["id_usuario"];
		$id_usuarioS                  = $fila["id_usuarioS"];
		$mensaje_mail	              = utf8_decode($fila["mensaje_mail"]);
		$fhingreso			          = $fila["fhingreso"];
		$newslastter                  = $fila["newslastter"];
		$revizado_mail                = $fila["revizado_mail"];
		$nom_usuario                  = $fila["nom_usuario"];
        $mensaje_mail = trim($mensaje_mail);
	    $quitar = array("%");
	    $mensaje_mail = str_replace($quitar, "'", $mensaje_mail);
		$fecha = fecha_mensaje($fhingreso);
        
		echo "<tr>";
		  if($revizado_mail == "NO")
		        {		  
				   echo "<td width='650' height='30' colspan='3' style='background-color:#8674A5;'>";
						echo "<table  width='650' cellpadding='0' cellspacing='0' border='0'>";
						   echo "<tr>";
								echo "<input type='hidden' id='id_mailadmin".$id."'  value='".$id_mail."'>";
								echo "<input type='hidden' id='id_usuarioadmin".$id."' value='".$id_usuario."'>";
							  echo "<td class='home2' align='center' width='46' height='0'  >
										<input type='checkbox' id='check_mailadmin".$id."'></td>"; 
							  echo "<td class='home2' align='center' width='252' height='0' >
							   <a href='#' onClick='usuario_mensaje_ver($i,$id_mail,$id_usuario,$id_usuarioS);' class='home2'>
								".$nom_usuario."
							   </a>	
							  </td>";
							  echo "<td class='home2' align='center' width='336' height='0'  >
							   <a href='#' onClick='usuario_mensaje_ver($i,$id_mail,$id_usuario,$id_usuarioS);' class='home2'>
								".$fecha."
							   </a>
							  </td>"; 
							 /* echo "<td class='cursor' align='center' width='46' height='0'>
							       <img src='./../images/xcircular.png' onClick='usuario_eliminar_mensaje_admin($id_mail,$id_usuario);' alt='DELETE'></td>";*/
							echo "</tr>"; 
						echo "</table>";
						echo "<tr>"; 
                                echo "<td class='td_oculto' colspan='3' id='tdmail2".$i."' align='center' width='20'></td>";
				           echo "<tr>";
					  echo "</td>";
				 }
			   else
				 { 
				   echo "<td width='650' height='30' colspan='3' style='background-color:#C7CDE7;'>";
						echo "<table  width='650' cellpadding='0' cellspacing='0' border='0'>";
						   echo "<tr>";
							  echo "<input type='hidden' id='id_mailadmin".$id."'  value='".$id_mail."'>";
								echo "<input type='hidden' id='id_usuarioadmin".$id."' value='".$id_usuario."'>";
							  echo "<td class='home2' align='center' width='46' height='0'  >
										<input type='checkbox' id='check_mailadmin".$id."'></td>";	
							  echo "<td class='home2' align='center' width='252' height='0'  >
							   <a href='#' onClick='usuario_mensaje_ver($i,$id_mail,$id_usuario,$id_usuarioS);' class='home2'>
								".$nom_usuario."
							   </a>	
							  </td>";
							  echo "<td class='home2' align='center' width='336' height='20'  >
							   <a href='#' onClick='usuario_mensaje_ver($i,$id_mail,$id_usuario,$id_usuarioS);' class='home2'>
								".$fecha."
							   </a>
							  </td>"; 
							  /*echo "<td class='cursor' align='center' width='46' height='0'>
							       <img src='./../images/xcircular.png' onClick='usuario_eliminar_mensaje_admin($id_mail,$id_usuario);' alt='DELETE'></td>";*/
							echo "</tr>";
							echo "<tr>"; 
                                echo "<td class='td_oculto' colspan='3' id='tdmail2".$i."' align='center' width='20'></td>";
				           echo "<tr>"; 
						echo "</table>";
					  echo "</td>";
				  }	     	  
		echo "</tr>";
	    $i++;
		$id++;
	}
   echo "</table>";
}
else
{
echo "<table width='650' height='0' align='center' border='0' cellpadding='0' cellspacing='0' >"; 
	   echo "	<tr>";
	      echo "<td class='home2' align='center' width='650'  height='20' background='../images/barralatestnewsxxx.png' ></td>";
		echo "	</tr>";
		echo "	<tr>";
	      echo "<td class='home2' align='center' width='650'  height='5' ></td>";
		echo "	</tr>";
echo "</table>";
echo "<table width='650' height='0' align='center' border='0' cellpadding='0' cellspacing='2' bgcolor='#E3E6EF'>"; 
	   echo "	<tr>";
	      /*echo "<td class='home2' align='center' width='22'  height='30' >
		  <input type='checkbox' id='reset1' onclick=\"select_checkbox('usuario_mail', 'check_mail', this);\"></td>";*/
		  echo "<td class='home2' align='center' width='198' height='30' >Subject</td>";
		  echo "<td class='home2' align='center' width='100' height='30' >Date</td>";
		   //echo "<td class='home5' align='center' width='530' >Mensaje</td>";
		echo "	</tr>";
		echo "	<tr>";
	      echo "<td class='home2' align='center' colspan='3' width='650'  height='30' >No Entries<td>";
		echo "</tr>";
echo "</table>";		
}
?>
</form>

</body>
</html>