<?php
session_start();
header("Content-Type:text/html;charset=utf-8");
$user=$_SESSION['name'];
require_once("global/connect.php");
$sql=mysql_query("select max(id) from gonggao");
while($row=mysql_fetch_array($sql)){
$id=$row[0];
}
//echo $id;
$sql=mysql_query("select * from gonggao where id='$id'");
while($row=mysql_fetch_array($sql)){
$title=strip_tags($row['title']);
$content=strip_tags($row['content']);
$date=strip_tags($row['date']);
//$send=strip_tags($row['send']);
}
$ida=array();
$sql=mysql_query("select id from message where state like '%$user%'");
while($row=mysql_fetch_array($sql)){
$ida[]=$row[0];
}
$ids=array();
$sql=mysql_query("select id from message where receive like '%$user%'");
while($row=mysql_fetch_array($sql)){
$ids[]=$row[0];
}
$num=count($ids);
foreach($ids as $a){
if(in_array($a,$ida))
$num--;
}
echo $title.','.$content.','.$date.'|'.$num;
?>
