<?
require"ygl.php";
if(!isset($ses_user_id)||!isset($ses_user_psd)){errorview("对不起，你没有登陆！！");exit;}
$user_login_id=$ses_user_id;
$user_login_psd=$ses_user_psd;
if(!ynjoinclass($user_login_id)){errorview("对不起，你没有加入该班！！");exit;}
readclass();
gotNewMessage($username);
$ynhead1="1";
$ynhead2="1";
$ynhead3="1";
$title="发消息";
include"header.php";
?>
<script language=JavaScript1.2>
var x =0
var y=0
drag = 0
move = 0
window.document.onmousemove = mouseMove
window.document.onmousedown = mouseDown
window.document.onmouseup = mouseUp
function Show(divid) {
divid.filters.revealTrans.apply();
divid.style.visibility = "visible";
divid.filters.revealTrans.play();
}
function Hide(divid) {
divid.filters.revealTrans.apply();
divid.style.visibility = "hidden";
divid.filters.revealTrans.play();
}
function mouseUp() {
move = 0;
}
function mouseDown() {
if (drag) {
clickleft = window.event.x - parseInt(dragObj.style.left);
clicktop = window.event.y - parseInt(dragObj.style.top);
dragObj.style.zIndex += 1;
move = 1;
}
}
function mouseMove() {
if (move) {
dragObj.style.left = window.event.x - clickleft;
dragObj.style.top = window.event.y - clicktop;
}
}
function mouseStop() {
window.event.returnValue = false;
}
</script>
<table width=100 height5><tr><td></td></tr></table>
<table width="750" border="1" cellspacing="0" cellpadding="2" align="center" bordercolorlight="#B5E1F7" bordercolordark="#FFFFFF">
<tr align="center" bgcolor="#B5E1F7">
  <td width="130">ID</td>
  <td width="130">姓名</td>
  <td width="264">E-mail</td>
  <td width="115">OICQ</td>
  <td width="79">
   <p>发送短消息</p>
  </td>
 </tr>
<?
$lines=file("user/list");
$size=count($lines);
$ii=1; $j=$size;
while($j>0){$j=$j-$perpage;}
if ($page==""){$page=$ii;}
$pages=$page-1;
$pages=$page*$perpage-$perpage;
for($i=$pages; $i<$pages+$perpage; $i++)
    {
    $linea=$lines[$i];
    $linea=ereg_replace("\n","", $linea);
    if ($linea != "")
        {
        $lines1a=file("user/list");
        while(list($tmpkey, $line1a) = each($lines1a))
              {
              $line1=ereg_replace("\n","", $line1);
              list($c_u_id,$c_add_date,$vi_count)=split("\t",$linea);
              }
         read_user_zl($c_u_id);
         if(empty($usermail))$usermail="无";
         if(empty($useroicq))$useroicq="无";
         print" <tr align=center>
  <td width=130>$user_id</td>
  <td width=130>$username</td>
  <td width=264>$usermail</td>
  <td width=115>$useroicq</td>
  <td width=79><a href=sendmsg.php?vsend=1&target=$user_id onClick=\"Show(messanger);\"Show(lastdiv);>发送消息</a></td>
 </tr>";
         }
     }
 print"<tr><td colspan=5><div align=center>";
 $j=$size;
while ($j>0) {
 if ($page != $ii) {print "<a href=sendmsg.php?page=$ii>";};
 print "[$ii]";
 if ($page != $ii) {print "</a>";};
 $j=$j-$perpage;
 $ii++;
}
 print"</div></td></tr></table>";
?>
<div align="center">
<div id="messanger" style="FILTER: revealTrans(transition=23,duration=0.5) blendTrans(duration=0.5); POSITION: absolute; z-index:1; background-color: #FFFFFF; border: 1px none #500000; top:82px;left:200;width:400px; visibility: <? if ($vsend==1) echo "visible"; else echo "hidden";?>">
<table width=100% border=0 cellspacing=0 cellpadding=1 bgcolor=333333>
<tr><td>
  <table width=100% bgcolor=#B5E1F7 border=0 cellspacing=0 cellpadding=2 onMouseOver="dragObj=messanger; drag=1;move=0" style="WIDTH: 100%; CURSOR: move" onMouseOut="drag=0">
<tr><td><font color=FFFFFF>发送短消息</font></td><td align=right><span style="CURSOR:hand" onClick="Hide(messanger);">关闭</span></td></td>
</tr></table><table width=100% bgcolor=FFFFFF border=0 cellspacing=0 cellpadding=2>
<tr><td><table width=100% border=0 cellspacing=0 cellpadding=0>
<tr><td align=center>
<br>
<hr noshade size=1>
<table width=100% border=0 cellspacing=0 cellpadding=0>
  <tr bgcolor=#ffffff>
    <td>请填写信息</td>
  </tr><form action=messanger.php method=POST>
  <tr bgcolor=#ffffff>
    <td>

      接受用户：
      <input <? if (isset($target)) echo "value='$target'"; ?> style="background-color:#FEFEFF; color:#9999FF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut ="this.style.backgroundColor =''" type=text size=30 name="ruser"><br>
      题&nbsp; &nbsp;&nbsp;目：
      <input style="background-color:#FEFEFF; color:#9999FF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut ="this.style.backgroundColor =''" type=text size=30 name="title">
      <br>
      信息内容：<br>
      <textarea style="background-color:#FEFEFF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#f3f3f3'" onMouseOut = "this.style.backgroundColor = ''" name="content" cols=50 rows=3></textarea>
      <br>
    </td>
  </tr>
<tr bgcolor=#ffffff>
<td><input style="color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'" type=submit value="提 交">
<input type=hidden name=menu value=write>
<input type=hidden name=step value=2>
</td>
  </tr></form>
</table></td></tr></table></td></tr></table></td></tr></table></div>