<?php 
include '../comm/config.php';
include '../comm/conn.php';
include '../comm/checkpostandget.php';
include 'check.php';
$id=$_GET["id"];

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die('数据库链接出错: ' . mysql_error());
	exit;
}
else
{
	mysql_query("set names gbk");	
	
	$sql="select * from msg where Id=".$id."";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	//$num = mysql_num_rows($rs);	
	//echo $sql;
	while ($row = mysql_fetch_array($rs))
	{
		$title=$row[title];
		$content=$row[content];
		$addtime=$row[addtime];
	}
	$sql="update msg set see=1 where Id=".$id."";
	$rs = mysql_query($sql);

	mysql_query("set names gbk");
	$sql="select * from user where ddusername='".$username."'";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	while ($row = mysql_fetch_array($rs))
	{
		$loginnum=$row[loginnum];
		$wjs=$row[wjs];
		$yjs=$row[yjs];
		$sctx=$row[lasttixian];
		$txstate=$row[txstate];
		$dengji=$row[dengji];
		$pid=$row[Id];
	}
	$sql="select id from msg where ddusername='".$username."' and see=0";
	$rs2 = mysql_query($sql);
	$num = mysql_num_rows($rs2);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>短消息管理 - <?php echo $usercenter;?> - <?php echo $webtitle;?></title>
<link href="../images/style1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
.STYLE2 {
	color: #555555;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
.STYLE3 {color: #FF3300}
-->
</style>
</head>

<body topmargin="0" leftmargin="0">
<?php
include("../comm/header.php");
?>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2">
          <table cellspacing="0" width="100%" height="278" style="border:1px  solid #DCEAF7;">
            <tr>
              <td height="30" align="left" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;&nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" /> 短消息管理</strong></td>
              <td align="right" bgcolor="E9F2FB"><img src="../images/liucheng.gif" width="14" height="14" /><a href="msglist.php" class="link5"> 返回短消息管理</a>&nbsp;</td>
            </tr>
            <tr>
              <td height="246" colspan="2" valign="top"><table width="700" height="219" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="64" align="center" class="bigtext"><strong><?php echo $title;?></strong></td>
                </tr>
                <tr>
                  <td height="125" align="left" valign="top" class="bigtext"><?php echo $content;?></td>
                </tr>
          <tr>
            <td height="58" bgcolor="f2faff" class="bigtext STYLE9">&nbsp;&nbsp;复制链接给你的亲朋好友，只要他注册后通过<?php echo $webtitle;?>上淘宝购物，您将获得返现额<?php echo round($tgbl,2)*100 ?>%的佣金。链接为：<br>
			  <script language=javascript>
    // 自动 COPY 代码开始
    function MM_findObj(n, d) { //v4.0
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
    if(!x && document.getElementById) x=document.getElementById(n); return x;
    }
    function JM_cc(ob){
    var obj=MM_findObj(ob); if (obj) {
    obj.select();js=obj.createTextRange();js.execCommand("Copy");}
    alert("复制成功！可以把地址复制给您认识的淘宝买家了！");
    }
    
    // 自动 COPY 代码结束
    document.write('&nbsp;&nbsp;<input name="page_url" value="<?php echo $url;?>/reg.php?pid=<?php echo $pid;?>" size="60"> <input type="button" name="Button" class="button1" style=color:#0000ff value="马上参加推广计划！" onClick=JM_cc("page_url")>');
    </script></td>
            </tr>
                <tr>
                  <td height="22" align="right" valign="top" class="bigtext">发送时间：<?php echo $addtime;?></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
<?php
include("../comm/footer.php");
?>
</body>
</html>
<?php mysql_close($link);?>