<?session_start();
require("conectar.php");
$id=$_SESSION['usuario_id'];
$d=date("d")-1;
$aller=date("Y-m-$d");
 $sql="SELECT * FROM chat as ch INNER JOIN usuchat as u ON ch.emisor=u.id_usu OR ch.destino=u.id_usu WHERE ch.fecha>='$aller' and '$id' IN(ch.emisor,ch.destino) and u.alias!='$_SESSION[usuario_login]' group by u.alias";
$re=mysql_query($sql);
while($li=mysql_fetch_array($re)){
         if($li["status"]==1){$bk="#3ADF00";}
         if($li["status"]==2){$bk="#DF0101";}	 
     ?>
	     <div class="contacto" onclick="javascript:new conversa('<?echo $li["id_usu"]?>','<?echo $li["alias"]?>');"><div style="position:absolute;margin-top:0px;right:5px;width:10px;height:10px;background:<?echo $bk?>;-moz-border-radius: 5px;-webkit-border-radius: 15px;border-radius: 5px;-khtml-border-radius: 5px;"></div><?echo $li["alias"]?></div>
	 <?/*
	     $des=$li["id_usu"];
	     $hoy=date("Y-m-d");
         $sql="SELECT * FROM chat WHERE destino='$id' AND emisor='$des' AND status='' AND notificacion='' AND fecha='$hoy' order by fecha, hora ";
		 $con=mysql_query($sql);
		 while($ls=mysql_fetch_array($con)){
	 ?>	 
	  <script>
		if(!document.getElementById("n<?echo $li["id_chat"]?>")){
	new notification("<?echo $li["alias"]?>","<?echo $ls["mensaje"]?>","<?echo $ls["id_chat"]?>" ,"<?echo $des?>");
		 }
         </script>
	 <?
	    }
		
		
		*/
}
	    