<?php 
include '../comm/conn.php';
include '../comm/config.php';
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die('数据库链接出错: ' . mysql_error());
}
else
{
	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);
}	
?>
          </table></td>
        <td width="388" rowspan="2" valign="top"><table cellspacing="0" width="388" height="30" style="border:1px  solid #DCEAF7;">
          <tr>
            <td height="30" colspan="2" bgcolor="E9F2FB">&nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" /> <span >最新返现记录&nbsp;&nbsp;<a href="/user/register.php" target=_blank"><?php      
		$sy = gmdate("Y", time()+8*60*60); 
		$sm = gmdate("m", time()+8*60*60);
		$sd = gmdate("d", time()+8*60*60);
		if($sd>20)
		{
			$sm=$sm;
		}
		if($sm>12)
		{
			$sy=$sy+1;
			$sm="01";
		}
		echo $sy."年".$sm."月20日"
		?>佣金已结算</a></span></td>
          </tr>
          <tr>
            <td width="388" height="30" colspan="2" valign="top"><?php 
				$sql="select * from tbjy where jystate='1' ";
				$rs1 = mysql_query($sql);
				//echo $sql;

	?>
<marquee style="color:#414141;font-size:12px;line-height:17px;" direction="up" height="30" scrollamount="1" scrolldelay="100" onMouseOver="this.scrollDelay=500" onMouseOut="this.scrollDelay=1" width="388">              <table width="388" height="30" border="0" cellspacing="0" cellpadding="0">
    <?php
	while ($row1 = mysql_fetch_array($rs1)){
	 $st1="<font color=#0066CC>未结算</font>";
	 if($row1[jystate]==1)
	 	{ $st1= "<font color=#009900>已结算</font>";}
		echo "<tr><td height=30 width=388 align=left>订单编号&nbsp;<font color=red>".$row1[tbcode]."</font>&nbsp;".$row1[tbname]."&nbsp;&nbsp;".$st1."</td></tr>";
	}
	?>
            </table></td></marquee> 
          </tr>
          
        </table>
<?php mysql_close($link);?>
