前台index.php

来源:互联网 发布:模拟经营 手游 知乎 编辑:程序博客网 时间:2024/05/07 16:12

<?php
session_start();
require_once("config/global.inc.php");
require_once("config/infofunction.php");
if (! session_is_registered('u_id')) session_register('u_id');//用户id
if (! session_is_registered('u_user')) session_register('u_user');//用户名
if (! session_is_registered('u_type')) session_register('u_type');//用户类型
if (! session_is_registered('u_jf')) session_register('u_jf');//用户积分
if (! session_is_registered('u_xy')) session_register('u_xy');//用户信誉
if (! session_is_registered('u_intime')) session_register('u_intime');//用户注册时间
if (! session_is_registered('u_lasttime')) session_register('u_lasttime');//用户最后登陆时间
if (! session_is_registered('u_failure')) session_register('u_failure');//用户最后登陆时间


//修改信誉值
    $sqll="select cup_cuid from ".__DBF."jy,".__DBF."userpj where ".__DBF."jy.cjy_id=".__DBF."userpj.cup_cjyid group by cup_cuid";
 $resultl=@mysql_db_query($conf_db,$sqll,$db);
 while($rstl=@mysql_fetch_array($resultl))
 {
  $sqll0="select sum(cup_pjnum) as sumxy from ".__DBF."userpj where cup_cuid=".$rstl[cup_cuid];
  $resultl0=@mysql_db_query($conf_db,$sqll0,$db);
  $rstl0=@mysql_fetch_array($resultl0);
  $sqll1="update ".__DBF."user set cu_xy=cu_xy+$rstl0[sumxy] where cu_id=".$rstl[cup_cuid];
  if(! @mysql_db_query($conf_db,$sqll1,$db))
      msgbox("信誉值修改出错!");
  $sqll2="update ".__DBF."userpj set cup_pjnum=0 where cup_cuid=".$rstl[cup_cuid];
  if(! @mysql_db_query($conf_db,$sqll2,$db))
      msgbox("初始化评价出错!");
 }
//信誉修改完成
//自动处理竟拍程序
/*$date=date("Y-m-d H:i:s");
$sql="select * from ".__DBF."goods where cg_sptype!=0 and cg_type=0 and cg_yxtime<'$date' order by cg_yxtime limit 1";
$result=@mysql_db_query($conf_db,$sql,$db);
$rs_num=@mysql_num_rows($result);
if($rs_num>=1)
{
while($rst=@mysql_fetch_array($result))
{
  $sql1="select * from ".__DBF."user,".__DBF."pm where ".__DBF."pm.cp_sid=$rst[cg_id] and ".__DBF."user.cu_id=".__DBF."pm.cp_gwuid order by cp_money desc limit 1";
  $result1=@mysql_db_query($conf_db,$sql1,$db);
  if($rst1=@mysql_fetch_array($result1))
    {
     $sql4="select ".__DBF."user.cu_id,".__DBF."user.cu_user from ".__DBF."user,".__DBF."pm where ".__DBF."pm.cp_sid=$rst[cg_id] and ".__DBF."user.cu_id=".__DBF."pm.cp_uid order by cp_money desc limit 1";
  $result4=@mysql_db_query($conf_db,$sql4,$db);
  $rst4=@mysql_fetch_array($result4);
  $sql2="insert into ".__DBF."jy set cjy_buyid=$rst1[cu_id],cjy_buyuser='$rst1[cu_user]',cjy_cgid='".$rst[cg_id]."',cjy_spnum=1,cjy_intime='$date',cjy_flag=2,cjy_saleid=$rst4[cu_id],cjy_saleuser='".rawurldecode($rst4[cu_user])."'";
  if($result2=@mysql_db_query($conf_db,$sql2,$db))
    {
    $sql3="update ".__DBF."goods set cg_type=1 where cg_id=".$rst[cg_id];
    $result3=@mysql_db_query($conf_db,$sql3,$db);
    }
 
    }
}//while
}//if */

//在不点击任何商品情况下自动将日或月浏览量清零
$datetime=date("Y-m-d H:i:s");
$month=date("m");
$day=date("d");
$sql="select * from ".__DBF."lastupdatetime";
$result=mysql_db_query($conf_db,$sql,$db);
$rst=mysql_fetch_array($result);
$aa=explode(" ",$rst[cl_lasttime]);
//echo $aa[0]."<br>";echo $aa[1]."<br>";
$bb=explode("-",$aa[0]);
//echo $bb[1]."月<br>";echo $bb[2]."日<br>";
if($day != $bb[2])
   {  //将求购表和出售表所有记录的日点击量清零,并将当前日期写入数据库
  $sql1="update ".__DBF."goods,".__DBF."buygoods,".__DBF."lastupdatetime set ".__DBF."goods.cg_dayshow=0,".__DBF."buygoods.cbg_dayshow=0,".__DBF."lastupdatetime.cl_lasttime='".$datetime."'";
  $result1=mysql_db_query($conf_db,$sql1,$db);

   }
if($month != $bb[1])
   {  //将求购表和出售表所有记录的月点击量清零,并将当前日期写入数据库
     $sql1="update ".__DBF."goods,".__DBF."buygoods,".__DBF."lastupdatetime set ".__DBF."goods.cg_monthshow=0,".__DBF."buygoods.cbg_monthshow=0,".__DBF."lastupdatetime.cl_lasttime='".$datetime."'";
  $result1=mysql_db_query($conf_db,$sql1,$db);
   }


//登陆程序
if($_GET[action]=='unlogin')
{
session_unregister('u_id');//用户id
session_unregister('u_user');//用户名
session_unregister('u_type');//用户类型
session_unregister('u_jf');//用户积分
session_unregister('u_xy');//用户信誉
session_unregister('u_intime');//用户注册时间
session_unregister('u_lasttime');//用户最后登陆时间
}
if($_GET[action]=='login')
{
 if($_SESSION[u_failure]!=3)//登陆错误次数
 {
 $date_lasttime=date("Y-m-d H:i:s");
 $sql="select * from ".__DBF."user where cu_user='".addslashes($_POST[dluser])."' AND cu_code='".md5($_POST[dlcode])."'";
 $result=mysql_db_query($conf_db,$sql,$db);
 if($rst=mysql_fetch_array($result))
 {
  $_SESSION[u_id]=$rst[cu_id];
  $_SESSION[u_user]=$rst[cu_user];
  $_SESSION[u_type]=$rst[cu_type];
  $_SESSION[u_jf]=$rst[cu_jf];
  $_SESSION[u_xy]=$rst[cu_xy];
  $_SESSION[u_intime]=$rst[cu_intime];
  $_SESSION[u_lasttime]=$rst[cu_lasttime];
  $time1=substr("$_SESSION[u_lasttime]",8,2);
  $time2=substr("$date_lasttime",8,2);
  if($time2>$time1)
  {
  $sql1="update ".__DBF."user set cu_lasttime='$date_lasttime',cu_jf=cu_jf+1 where cu_id=".$_SESSION[u_id];
  $result1=@mysql_db_query($conf_db,$sql1,$db);
  $_SESSION[u_jf]=$_SESSION[u_jf]+1;
  }
  else
  $sql1="update ".__DBF."user set cu_lasttime='$date_lasttime' where cu_id=".$_SESSION[u_id];
  $result1=@mysql_db_query($conf_db,$sql1,$db);
  echo '<script language="javascript"> location="dlcg.php";</script>';
  exit(0);
 }else{
     $_SESSION[u_failure]+=1;
  echo '<script language="javascript"> location="dlsb.php";</script>';
  exit(0);
 }
 }else echo '<script language="javascript"> alert("您已经登陆了三次,请稍后在试!");location="index.php";</script>';
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?php echo __TITLE;?></title>
<LINK
href="img/style.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
BODY {
 MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
.style1 {
 color: #FF0000;
 font-size: 14px;
}
</STYLE>
<script language="javascript">
<!--
function a(uid)
  {
 if(uid=="-1")
    {
     alert("登陆后才可以发布信息!!!!");
  return false;
    }
  }
//-->
</script>
</head>

<body  background="img/dt11.gif">
<div align=center>
<?php include "top1.php"; ?></div>
<?php echo $mtgs[0][0];?>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
<tr>
<td><div align="center">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="774" height="80">
    <param name="movie" value="images/flash01.swf">
    <param name="quality" value="high">
    <embed src="images/flash01.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="774" height="80"></embed>
  </object>
</div></td>
</tr>
</table>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
  <tr>
    <td bgcolor="#FFFFFF"><marquee width="772" loop="-1" scrolldelay="200"><span class="style1">公告:<?php
  $sql77="select gg_id,gg_title from ".__DBF."gonggao";
  $result77=@mysql_db_query($conf_db,$sql77,$db);
  while ($rst77=@mysql_fetch_array($result77))
    {
   $tmpttt.="<a href=gg_text.php?id=$rst77[gg_id] target=_blank>$rst77[gg_title]</a>&nbsp;&nbsp;";
 }
 echo $tmpttt;
?>
</span>
    </marquee></td>
  </tr>
</table>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
  <tr>
    <td width="176"  background=img/7.gif  height="201"><TABLE id=AutoNumber36 style="BORDER-COLLAPSE: collapse"
            borderColor=#111111 height=392 cellSpacing=0 cellPadding=0
            width="100%" border=0>
              <STYLE type=text/css>.style1 {
 COLOR: #ff0000
}
.ui_engl {font-family: arial,helvetica;font-size:11px;}
</STYLE>

              <TBODY>
              <TR>
                <TD width="100%" height=38>
    <IMG height=38
                  src="img/denglu.gif" width=180 border=0></TD></TR>
              <TR>
                <TD width="100%"
                height=77 vAlign=top bgcolor="FFF5E5">
                  <DIV align=center>
                  <CENTER>
                  <?php
//登陆程序
if(empty($_SESSION[u_id]))
{
?><FORM name=form action="index.php?action=login" method="post">
                  <TABLE id=AutoNumber37 style="BORDER-COLLAPSE: collapse"
                  borderColor=#111111 cellSpacing=6 cellPadding=0 width="98%"
                  border=0>
                    <TBODY>
                    <TR>
                      <TD width="35%"><B><SPAN><FONT
                        color=#000000>用户名:</FONT></SPAN></B></TD>
                      <TD width="72%"><INPUT id=Name2 size=11
                    name=dluser></TD></TR>
                    <TR>
                      <TD width="35%"><B><FONT color=#000000><SPAN>密&nbsp;
                        码:</SPAN></FONT></B></TD>
                      <TD width="72%"><INPUT id=Name1 type=password size=11
                        name=dlcode></TD></TR>
                    <TR>
                      <TD><FONT color=#000000><B>保&nbsp; 存:</B></FONT></TD>
                      <TD><SELECT class=select id=CookieDate name=CookieDate>
                          <OPTION value=0 selected>不保存</OPTION> <OPTION
                          value=1>保存一天</OPTION> <OPTION value=2>保存一月</OPTION>
                          <OPTION value=3>保存一年</OPTION></SELECT></TD></TR>
                    <TR>
                      <TD width="35%"><a href="reg_loback.php">找回密码</a></TD>
                      <TD width="72%"><INPUT type=image height=19 width=40
                        src="img/ind_dl.gif" border=0
                        name=imageField> <A
                        href="reg_register.php"><IMG
                        height=19 alt="" src="img/ind_zc.gif"
                        width=40
                  border=0></A></TD></TR>
                    </TBODY></TABLE>
                  </FORM><?php
}else {
//登陆后所显示的内容
$sql_a="select * from ".__DBF."user where cu_id=$_SESSION[u_id]";
$result_a=@mysql_db_query($conf_db,$sql_a,$db);
$rst_a=@mysql_fetch_array($result_a);
?><TABLE id=AutoNumber37 style="BORDER-COLLAPSE: collapse"
                  borderColor=#111111 cellSpacing=6 cellPadding=0 width="98%"
                  border=0>
                    <TBODY>
                    <TR>
                      <TD colspan="2"><div align="center"><B><SPAN><font color="#000000">欢迎您——<?php echo "<a href=grxx.php?cu_id=".$_SESSION[u_id]." target=_blank>".cutstr($rst_a[cu_user],"16","zh")."</a>"; ?> </font></SPAN></B></div></TD>
                      </TR>
                    <TR>
                      <TD width="32%"><div align="right"><B><FONT color=#000000>积 分:</FONT></B></div></TD>
                      <TD width="68%"><div align="left"><strong><?php echo $rst_a[cu_jf]; ?>&nbsp;点</strong></div></TD>
                    </TR>
                    <TR>
                      <TD><div align="right"><FONT color=#000000><strong>信 誉:</strong></FONT></div></TD>
                      <TD><div align="left"><?php $xyimg=djset($rst_a[cu_xy],"images/zhuan.gif","images/heart.gif","images/pheart.gif");echo $xyimg; ?></div></TD>
                    </TR>
                    <TR>
                      <TD colspan="2"><div align="center"><a href="index.php?action=unlogin">退出登陆</a></div></TD>
                      </TR>
                    <TR align="center" valign="middle">
                      <TD colspan="2"><a href="zxjm-dp.php?csp_cuid=<?php echo $_SESSION[u_id];?>" target="_blank"><img src="img/jrdp.jpg" width="89" height="20" border="0"></a></TD>
                      </TR>
        </TBODY></TABLE><?php
}
?>
<?php
//信誉值排行榜
$num=6;
$sql="select cu_user,cu_id from ".__DBF."user order by cu_xy desc limit 0,$num";
$xynum=newuser('grxx.php',$sql,$num);
?></CENTER></DIV></TD></TR><tr><td><div align="center">
   <table border="0" width="100%" id="table4" cellspacing="0" cellpadding="0" height="163">
    <tr>
     <td height="38">
     <IMG height=38
                  src="img/gg.gif" width=180 border=0></td>
    </tr>
    <tr>
     <td height="125"><DIV align=center>
                    <table width="175" border="0" cellspacing="2" cellpadding="0">
                      <tr>
                        <td width="15"><div align="center">#</div></td>
                        <td width="160"><?php echo $xynum[0][0];?></td>
                      </tr>
                      <tr>
                        <td><div align="center">#</div></td>
                        <td><?php echo $xynum[1][0];?></td>
                      </tr>
                      <tr>
                        <td><div align="center">#</div></td>
                        <td><?php echo $xynum[2][0];?></td>
                      </tr>
                      <tr>
                        <td><div align="center">#</div></td>
                        <td><?php echo $xynum[3][0];?></td>
                      </tr>
                      <tr>
                        <td><div align="center">#</div></td>
                        <td><?php echo $xynum[4][0];?></td>
                      </tr>
                      <tr>
                        <td height="19"><div align="center">#</div></td>
                        <td><?php echo $xynum[5][0];?></td>
                      </tr>
                    </table>
                  </DIV></td>
    </tr>
   </table></div></td></tr>
              <TR>
                <TD vAlign=top width="100%" height=12><IMG height=38
                  src="img/9.gif" width=180 border=0></TD></TR>
              <TR>
     <?php
//最新出售
$date=date("Y-m-d H:i:s");
$num=10;
$sql="select cg_name,cg_intime,cg_id,cg_texttype from ".__DBF."goods where cg_yxtime>'$date' and cg_type!=1 and cg_type!=2 order by cg_intime desc limit 0,$num";
$newgs=sell_goods('cg-goods.php',$sql,10);
?> 
                <TD width="100%" height=189>
    <div align="center">
     <table border="0" width="96%" id="table2" cellpadding="2">
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td width="104"><span lang="zh-cn"><?php echo $newgs[0][0];?></span></td>
          <td width="33"><?php echo $newgs[0][1];?></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[1][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[1][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[2][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[2][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[3][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[3][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[4][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[4][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[5][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[5][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[6][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[6][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[7][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[7][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[8][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[8][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td><span lang="zh-cn"><?php echo $newgs[9][0];?></span></td>
          <td><span lang="zh-cn"><?php echo $newgs[9][1];?></span></td>
      </tr>
      <tr>
       <td width="16" align="center">
       <img border="0" src="img/55553e.gif" width="7" height="9"></td>
       <td>
         <p align="right"></td>
          <td><span lang="zh-cn"><a href="show-showxy1.php?act=goods&more=shownum">更多</a></span></td>
      </tr>
     </table>
    </div>
    </TR></TBODY></TABLE></td>
    <td width="600" valign="top" bgcolor="#FFFFFF"><div align =center ><TABLE id=AutoNumber51 style="BORDER-COLLAPSE: collapse"
            borderColor=#111111 cellSpacing=0 cellPadding=0 width="573"
border=0>
              <TBODY>
              <TR>
                <TD width="287">
    <img src="img/no1.gif" width="425" height="38" border="0" usemap="#Map2"></TD>
                <TD width="286">
    <img border="0" src="img/xxtj.gif" width="150" height="38"></TD>
              </TR>
              <TR>
                <TD width="287">
<?php
//最新推荐商品图文信息
$num=16;
$u=0;
$imgnum=recommend('cg-goods.php',$num);
$sql="select * from ".__DBF."selfinfo,".__DBF."goods where ".__DBF."goods.cg_id=".__DBF."selfinfo.cs_spid AND ".__DBF."selfinfo.cs_tjpcol<>0";
$result=@mysql_db_query($conf_db,$sql,$db);
while($rst=@mysql_fetch_array($result))
{
    $pictype=explode(".",$rst[cg_pic]);
 if($pictype[count($pictype)-1]=='swf')
    $tjpic[$u][0]='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="120" height="80">
     <param name="movie" value='.$conf_fimgpath.$rst[cg_cuid]."/".$rst[cg_pic].'>
     <param name="quality" value="high">
     <embed src='.$conf_fimgpath.$rst[cg_cuid]."/".$rst[cg_pic].' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
     </object>';
 else
 $tjpic[$u][0]='<a href="cg-goods.php?cg_id='.$rst[cg_id].'"><image src="'.$conf_fimgpath.$rst[cg_cuid]."/".$rst[cg_pic].'" width="120" height="80" border=1 style="border-color:#000000;"></a>';
 $tjpic[$u][1]=$rst[cs_tjpcol];
 if(! empty($rst[cs_link]))
 $tjname[$u][2]='<a href="'.$rst[cs_link].'">'.cutstr($rst[cg_name],30,".").'</a>';
 else
 $tjname[$u][2]='<a href="cg-goods.php?cg_id='.$rst[cg_id].'">'.cutstr($rst[cg_name],30,".").'</a>';
 $daytime=explode(" ",$rst[cg_intime]);
 $tjday[$u][3]=$daytime[0];
 $u++;
}
?> 
    <table border="0" width="425" id="table1" height="258" cellspacing="0" cellpadding="0" style="border-left: 1px solid #D8D8D8; border-right: 1px solid #D8D8D8; border-top-width: 1px; border-bottom: 1px solid #D8D8D8">
     <tr>
      <td height="129" width="139"><DIV align=center>
                        <TABLE
                        style="border-width:1px; "
                        width="66%">
                          <TBODY>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>
        <?php
        $k=false;
        $i=0;
        for($j=0;$j<$u;$j++)
        {
         if($tjpic[$j][1]==1)
         {
          echo $tjpic[$j][0];
          $k=true;
          $l=$j;
         }
        }
        if($k==false)
            echo $imgnum[$i][2];
        ?></DIV></TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
       <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td valign="top">
         <p align="center"><FONT color=#000000><IMG height=14 src="img/6546465.gif" width=14 border=0></FONT>
        <?php
        if($k==true)
        echo $tjname[$l][2];
        else
        echo $imgnum[$i][0];
        ?>
                              </td>
       </tr>
       </table>
       </TD>
       </TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>时间:<?php
         if($k==true)
         echo $tjday[$l][3];
         else
         {
         echo $imgnum[$i][1];
         $i+=1;
         }
         ?></DIV></TD></TR></TBODY></TABLE></DIV></td>
      <td height="129" width="142"><DIV align=center>
                        <TABLE
                        style="border-width:1px; "
                        width="66%">
                          <TBODY>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>
        <?php
        $k=false;
        for($j=0;$j<$u;$j++)
        {
         if($tjpic[$j][1]==2)
         {
          echo $tjpic[$j][0];
          $k=true;
          $l=$j;
         }
        }
        if($k==false)
         echo $imgnum[$i][2];
        ?></DIV></TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                           <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td valign="top">
         <p align="center"><FONT color=#000000><IMG height=14 src="img/6546465.gif" width=14 border=0></FONT>
        <?php
        if($k==true)
        echo $tjname[$l][2];
        else
        echo $imgnum[$i][0];
        ?>
                              </td>
       </tr>
       </table>
       </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>时间:<?php
         if($k==true)
         echo $tjday[$l][3];
         else
         {
         echo $imgnum[$i][1];
         $i++;
         }
         ?></DIV></TD></TR></TBODY></TABLE></DIV></td>
      <td height="129" width="142"><DIV align=center>
                        <TABLE
                        style="border-width:1px; "
                        width="66%">
                          <TBODY>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>
         <?php
        $k=false;
        for($j=0;$j<$u;$j++)
        {
         if($tjpic[$j][1]==3)
         {
          echo $tjpic[$j][0];
          $k=true;
          $l=$j;
         }
        }
        if($k==false)
         echo $imgnum[$i][2];?></DIV></TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                           <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td valign="top">
         <p align="center"><FONT color=#000000><IMG height=14 src="img/6546465.gif" width=14 border=0></FONT>
        <?php
        if($k==true)
        echo $tjname[$l][2];
        else
        echo $imgnum[$i][0];
        ?>
                              </td>
       </tr>
       </table>        </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>时间:<?php
         if($k==true)
         echo $tjday[$l][3];
         else
         {
         echo $imgnum[$i][1];
         $i++;
         }
         ?></DIV></TD></TR></TBODY></TABLE></DIV></td>
     </tr>
     <tr>
      <td height="129" width="139"><DIV align=center>
                        <TABLE
                        style="border-width:1px; "
                        width="66%">
                          <TBODY>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>
        <?php
        $k=false;
        for($j=0;$j<$u;$j++)
        {
         if($tjpic[$j][1]==4)
         {
          echo $tjpic[$j][0];
          $k=true;
          $l=$j;
         }
        }
        if($k==false)
        echo $imgnum[$i][2];?></DIV></TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                           <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td valign="top">
         <p align="center"><FONT color=#000000><IMG height=14 src="img/6546465.gif" width=14 border=0></FONT>
        <?php
        if($k==true)
        echo $tjname[$l][2];
        else
        echo $imgnum[$i][0];
        ?>
                              </td>
       </tr>
       </table>        </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>时间:<?php
         if($k==true)
         echo $tjday[$l][3];
         else
         {
         echo $imgnum[$i][1];
         $i++;
         }
         ?></DIV></TD></TR></TBODY></TABLE></DIV></td>
      <td height="129" width="142"><DIV align=center>
                        <TABLE
                        style="border-width:1px; "
                        width="66%">
                          <TBODY>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>
        <?php
        $k=false;
        for($j=0;$j<$u;$j++)
        {
         if($tjpic[$j][1]==5)
         {
          echo $tjpic[$j][0];
          $k=true;
          $l=$j;
         }
        }
        if($k==false)
        echo $imgnum[$i][2];?></DIV></TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                           <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td valign="top">
         <p align="center"><FONT color=#000000><IMG height=14 src="img/6546465.gif" width=14 border=0></FONT>
        <?php
        if($k==true)
        echo $tjname[$l][2];
        else
        echo $imgnum[$i][0];
        ?>
                              </td>
       </tr>
       </table>        </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>时间:<?php
         if($k==true)
         echo $tjday[$l][3];
         else
         {
         echo $imgnum[$i][1];
         $i++;
         }
         ?></DIV></TD></TR></TBODY></TABLE></DIV></td>
      <td height="129" width="142"><DIV align=center>
                        <TABLE
                        style="border-width:1px; "
                        width="66%">
                          <TBODY>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>
        <?php
        $k=false;
        for($j=0;$j<$u;$j++)
        {
         if($tjpic[$j][1]==6)
         {
          echo $tjpic[$j][0];
          $k=true;
          $l=$j;
         }
        }
        if($k==false)
        echo $imgnum[$i][2];?></DIV></TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                           <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td valign="top">
         <p align="center"><FONT color=#000000><IMG height=14 src="img/6546465.gif" width=14 border=0></FONT>
        <?php
        if($k==true)
        echo $tjname[$l][2];
        else
        echo $imgnum[$i][0];
        ?>
                              </td>
       </tr>
       </table>        </TD></TR>
                          <TR>
                            <TD
                            style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none"
                            bgColor=#ffffff>
                              <DIV align=center>时间:<?php
         if($k==true)
         echo $tjday[$l][3];
         else
         {
         echo $imgnum[$i][1];
         $i++;
         }
         ?></DIV></TD></TR></TBODY></TABLE></DIV></td>
     </tr>
    </table></TD>
                <TD width="286" style="border-right: 1px solid #D8D8D8; border-bottom: 1px solid #D8D8D8">
    <div align="center">
     <table border="0" width="98%" id="table5" height="250">
      <tr>
       <td height="23"><span lang="zh-cn">总物品数:<font color="#FF0000"><?php $sql="select count(*) as goodsnum from ".__DBF."goods";
                    $gdnum=countnum($sql,'goodsnum');
                    echo $gdnum;
                   ?></font>
       </span></td>
      </tr>
      <tr>
       <td height="24">总会员数:<font color="#FF0000"><?php $sql="select count(*) as usernum from ".__DBF."user";
                    $usnum=countnum($sql,'usernum');
                    echo $usnum;
                   ?></font>
                            </td>
      </tr>
      <tr>
       <td height="24">总店铺数:<font color="#FF0000"><?php $sql="select count(*) as shopnum from ".__DBF."shopinfo";
                    $spnum=countnum($sql,'shopnum');
                    echo $spnum;
                   ?></font>
       </td>
      </tr>
      <tr>
       <td height="24">总钻石店铺数:<font color="#FF0000"><?php $sql="select count(*) as cslshopnum from ".__DBF."user where cu_type=2";
                    $cslspnum=countnum($sql,'cslshopnum');
                    echo $cslspnum;
                   ?></font>
       </td>
      </tr>
      <tr>
       <td height="24">总求购信息数:<font color="#FF0000"><?php $sql="select count(*) as buygoodsnum from ".__DBF."buygoods";
                    $bynum=countnum($sql,'buygoodsnum');
                    echo $bynum;
                   ?></font>
       </td>
      </tr>
      <tr>
       <td height="24">本日发布信息数:<font color="#FF0000"><?php $date=date("Y-m-d");
                                                                                $sql="select count(*) as daynum1 from ".__DBF."buygoods where cbg_intime like '%$date%'";
                    $dynum1=countnum($sql,'daynum1');
                    $sql="select count(*) as daynum2 from ".__DBF."goods where cg_intime like '%$date%'";
                    $dynum2=countnum($sql,'daynum2');
                    echo $dynum1+$dynum2;
                   ?></font>
       </td>
      </tr>
      <tr>
       <td height="24">本月发布信息数:<font color="#FF0000"><?php $date=date("Y-m");
                                                                                $sql="select count(*) as mtnum1 from ".__DBF."buygoods where cbg_intime like '%$date%'";
                    $mtnum1=countnum($sql,'mtnum1');
                    $sql="select count(*) as mtnum2 from ".__DBF."goods where cg_intime like '%$date%'";
                    $mtnum2=countnum($sql,'mtnum2');
                    echo $mtnum1+$mtnum2;
                   ?></font>
       </td>
      </tr>
      <tr>
       <td height="24">总信息数:<font color="#FF0000"><?php $sql="select count(*) as addnum1 from ".__DBF."goods";
                    $addnum1=countnum($sql,'addnum1');
                    $sql="select count(*) as addnum2 from ".__DBF."buygoods";
                    $addnum2=countnum($sql,'addnum2');
                    echo $addnum1+$addnum2;
                   ?></font></td>
      </tr>
      <tr>
       <td height="24">物品浏览次数:<font color="#FF0000"><?php $sql="select sum(cg_shownum) as addshopnum from ".__DBF."goods";
                    $addshopnum=countnum($sql,'addshopnum');
                    echo $addshopnum;
                   ?></font></td>
      </tr>
      <tr>
       <td height="13"></td>
      </tr>
     </table>
    </div>
    </TD>
              </TR></TBODY></TABLE>
        <table width="573" height="128" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="293" height="38"><IMG height=38 src="img/10.gif"
                  width=293 useMap=#indexMap3 border=0></td>
            <td width="280"><img src="img/hotsale.gif" width="287" height="38" border="0" usemap="#indexMap4"></td>
          </tr>
          <tr>
            <TD width="50%">
                  <TABLE id=AutoNumber39 style="BORDER-COLLAPSE: collapse"
                  borderColor=#111111 height=137 cellSpacing=0 cellPadding=0
                  width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD height=113>
<?php
//最新求购信息
$num=10;
$sql="select cbg_name,cbg_intime,cbg_id,cbg_texttype from ".__DBF."buygoods where cbg_yxtime>'$date' order by cbg_intime desc limit 0,$num";
$newtb=recent_to_buy('cbg-tobuy.php',$sql,10);
?>                       
      <TABLE id=AutoNumber55 style="BORDER-COLLAPSE: collapse"
                        borderColor=#111111 cellSpacing=0 cellPadding=0
                        width="100%" border=0>
                          <TBODY>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%" background=img/bbb.gif
                            height=24>
                              <?php echo $newtb[0][0];?> </TD>
                            <TD width="22%" background=img/bbb.gif><?php echo $newtb[0][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>
         <?php echo $newtb[1][0];?>
                            </TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[1][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>
         <?php echo $newtb[2][0];?>
                             </TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[2][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>
         <?php echo $newtb[3][0];?>
                             </TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[3][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>
         <?php echo $newtb[4][0];?>
                             </TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[4][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>
         <?php echo $newtb[5][0];?>
                             </TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[5][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>
         <?php echo $newtb[6][0];?>
                             </TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[6][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>                              <?php echo $newtb[7][0];?></TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[7][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>                              <?php echo $newtb[8][0];?></TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[8][1];?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="72%"
                            height=24 background=img/bbb.gif>                              <?php echo $newtb[9][0];?></TD>
                            <TD width="22%"
                            height=24 background=img/bbb.gif><?php echo $newtb[9][1];?></TD>
            </TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
            <TD vAlign=top width="50%">
<TABLE id=AutoNumber40 style="BORDER-COLLAPSE: collapse"
                  borderColor=#111111 cellSpacing=0 cellPadding=0 width="100%"
                  border=0>
                    <TBODY>
                    <TR>
                      <TD height=113>
<?php
$t=0;
$sql="select * from ".__DBF."selfinfo,".__DBF."goods where ".__DBF."goods.cg_id=".__DBF."selfinfo.cs_spid AND ".__DBF."selfinfo.cs_tjxcol<>0";
$result=@mysql_db_query($conf_db,$sql,$db);
while($rst=@mysql_fetch_array($result))
{
 if(! empty($rst[cs_link]))
 $tjspxx[$t][0]='<a href="'.$rst[cs_link].'">'.$rst[cg_name].'</a>';
 else
 $tjspxx[$t][0]='<a href="cg-goods.php?cg_id='.$rst[cg_id].'">'.$rst[cg_name].'</a>';
 $tjspxx[$t][1]=$rst[cs_tjxcol];
 $daytime=explode(" ",$rst[cg_intime]);
 $tjspxx[$t][3]=$daytime[0];
 $t++;
}
?>      
                        <TABLE id=AutoNumber55 style="BORDER-COLLAPSE: collapse"
                        borderColor=#111111 cellSpacing=0 cellPadding=0
                        width="100%" border=0>
                          <TBODY>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%" background=img/bbb.gif
                            height=24>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==1)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%" background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==2)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif><?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==3)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==4)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==5)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==6)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==7)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==8)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==9)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR>
                          <TR>
                            <TD width="6%" background=img/14.gif
                            height=24>
                             </TD>
                            <TD width="71%"
                            height=24 background=img/bbb.gif>
                              <?php
        $d=false;
        for($a=0;$a<$t;$a++)
        {
         if($tjspxx[$a][1]==10)
         {
          echo $tjspxx[$a][0];
          $d=true;
          $b=$a;
         }
        }
        if($d==false)
         echo $imgnum[$i][0];?></TD>
                            <TD width="23%"
                            height=24 background=img/bbb.gif>
       <?php
         if($d==true)
         echo $tjspxx[$b][3];
         else
         {
       echo $imgnum[$i][1];
       $i++;
       }
       ?></TD>
                          </TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
          </tr>
        </table>
    </div></td>
  </tr>
</table>
<table width="776" border="0" bgcolor="#FFCC00" align="center" cellpadding="0" cellspacing="0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
  <tr>
    <td height="100"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="774" height="120">
      <param name="movie" value="images/flash02.swf">
      <param name="quality" value="high">
      <embed src="images/flash02.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="774" height="120"></embed>
    </object></td>
  </tr>
</table>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
  <tr>
    <td width="185" background=img/7.gif height="174"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="177" height="77">
      <param name="movie" value="images/goldad.swf">
      <param name="quality" value="high">
      <embed src="images/goldad.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="177" height="77"></embed>
    </object>
      <br>
      <br>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="177" height="77">
        <param name="movie" value="images/goldad.swf">
        <param name="quality" value="high">
        <embed src="images/goldad.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="177" height="77"></embed>
      </object>
      <br>
      <br>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="177" height="77">
        <param name="movie" value="images/goldad.swf">
        <param name="quality" value="high">
        <embed src="images/goldad.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="177" height="77"></embed>
      </object></td>
    <td width="589" valign="top" bgcolor="#FFFFFF"><table border="0" width="578" id="table7" cellspacing="0" cellpadding="0" height="270">
    <tr>
     <td height="38" width="581" colspan="3">
     <img src="img/fl1.gif" width="578" height="38" border="0" usemap="#indexMap2"></td>
    </tr>
     <?php
      $sql7="select * from ".__DBF."sptype where cs_upid=0 AND cs_topid=0 order by cs_id asc limit 0,10";
      $result7=@mysql_db_query($conf_db,$sql7,$db);
      while($rst7=@mysql_fetch_array($result7))
      {
     ?>
     <tr>
       <td valign="top">
     <div align="left">
      <table width="98%" border="0" align="center" id="table8">
     <?php
      $sql7="select * from ".__DBF."sptype where cs_upid=0 AND cs_topid=0 order by cs_id asc limit 0,10";
      $result7=@mysql_db_query($conf_db,$sql7,$db);
      while($rst7=@mysql_fetch_array($result7))
      {
     ?>
       <tr>
        <td height="28"><strong><a href="syxxf2.php?action=xxfl&xxid=<?php echo $rst7[cs_id];?>" target="_blank"><?php echo $rst7[cs_text]."→";?></a></strong></td>
       <td><?php
        $sql8="select * from ".__DBF."sptype where cs_upid=$rst7[cs_id] AND cs_topid=0";
                                $result8=@mysql_db_query($conf_db,$sql8,$db);
        while($rst8=@mysql_fetch_array($result8))
        {
                                  ?>          
                                     <a href="syxxf2.php?action=fl&xxid=<?php echo $rst7[cs_id];?>&xxxid=<?php echo $rst8[cs_id];?>&xxname=<?php echo rawurlencode($rst8[cs_text]);?>" target="_blank"><?php echo $rst8[cs_text];?></a>&nbsp;
       <?php
        }
       ?>
       </td></tr>
                      <?php
         }
        ?>      
          </table>
        </div>       </td>
     </tr>
     <?php
         }
     ?>
 </table></td>
  </tr>
</table>
<?php
//最新推荐店铺信息
$num=6;
$sql="select * from ".__DBF."user,".__DBF."shopinfo where ".__DBF."user.cu_id=".__DBF."shopinfo.csp_cuid order by ".__DBF."user.cu_xy desc limit 0,$num";
$showshop=showshop("zxjm-dp.php",$sql);
//最新推荐的店铺
$t=0;
$sql="select * from ".__DBF."selfinfo,".__DBF."shopinfo where ".__DBF."shopinfo.csp_cuid=".__DBF."selfinfo.cs_cuid AND ".__DBF."selfinfo.cs_tjdpcol<>0";
$result=@mysql_db_query($conf_db,$sql,$db);
while($rst=@mysql_fetch_array($result))
{
 if(! empty($rst[cs_link]))
 $tjdpxx[$t][0]='<a href="'.$rst[cs_link].'">'.$rst[csp_name].'</a>';
 else
 $tjdpxx[$t][0]='<a href="zxjm-dp.php?csp_cuid='.$rst[csp_cuid].'">'.$rst[csp_name].'</a>';
 $tjdpxx[$t][1]=$rst[cs_tjdpcol];
 $daytime=explode(" ",$rst[csp_intime]);
 $tjdpxx[$t][3]=$daytime[0];
 $t++;
}
?>
<table width="776" height="209" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
  <tr>
    <td width="186" background=img/7.gif height="41"><img src="img/tj_dp.gif" width="180" height="38"></td>
    <td width="215"><img src="img/dp_2s1.gif" width="215" height="38"></td>
    <td width="215"><img src="img/dp_2s.gif" width="215" height="38"></td>
    <td width="160" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="center"><img src="img/tongji.gif" width="152" height="200" border="0" usemap="#indexMap1"></div></td>
  </tr>
  <tr>
    <td height="168" valign="middle" background=img/7.gif><table width="95%" border="0" align="center">
      <tr>
        <td width="11%">*</td>
        <td width="62%">
  <?php
  $d=false;
  $i=0;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==1)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
  echo $showshop[$i][0];?>
  </td>
        <td width="27%">
  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
    else
   {echo $showshop[$i][1];
   $i+=1;
   }
   ?>
   </td>
      </tr>
      <tr>
        <td>*</td>
        <td>  <?php
  $d=false;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==2)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
  echo $showshop[$i][0];?>
       </td>
        <td>  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
    else
   {echo $showshop[$i][1];
   $i+=1;
   }
   ?>
      </td>
      </tr>
      <tr>
        <td>*</td>
        <td>  <?php
  $d=false;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==3)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
  echo $showshop[$i][0];?>
        </td>
        <td>  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
   else
   {echo $showshop[$i][1];
   $i+=1;
   };
   ?>
      </td>
      </tr>
      <tr>
        <td>*</td>
        <td>  <?php
  $d=false;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==4)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
   echo $showshop[$i][0];
   ?>
        </td>
        <td>  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
    else
   {echo $showshop[$i][1];
   $i+=1;
   }
   ?>
      </td>
      </tr>
      <tr>
        <td>*</td>
        <td>  <?php
  $d=false;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==5)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
  echo $showshop[$i][0];?>
        </td>
        <td>  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
    else
   {echo $showshop[$i][1];
   $i+=1;
   }
   ?>
      </td>
      </tr>
      <tr>
        <td>*</td>
        <td>  <?php
  $d=false;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==6)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
  echo $showshop[$i][0];?>
        </td>
        <td>  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
    else
   {echo $showshop[$i][1];
   $i+=1;}
   ?>
      </td>
      </tr>
      <tr>
        <td>*</td>
        <td>  <?php
  $d=false;
  for($a=0;$a<$t;$a++)
  {
   if($tjdpxx[$a][1]==7)
   {
    echo $tjdpxx[$a][0];
    $d=true;
    $b=$a;
   }
  }
  if($d==false)
  echo $showshop[$i][0];?>
        </td>
        <td>  <?php
    if($d==true)
    echo $tjdpxx[$b][3];
    else
   {echo $showshop[$i][1];
   $i+=1;}
   ?>
     </td>
      </tr>
    </table></td>
<?php
//最新加盟的店铺
$num=6;
$sql="select csp_name,csp_cuid,csp_intime from ".__DBF."shopinfo order by csp_intime desc limit 0,$num";
$spnum=newshop('zxjm-dp.php',$sql,$num);
?>
    <td valign="middle" bgcolor="#FFFFFF"  style="border-right: 1px solid #C0C0C0"><div align="center">
     <table border="0" width="96%" id="table3">
                      <tr>
                        <td width="10" align="center">*</td>
                        <td width="129"><?php echo $spnum[0][0];?> </td>
                        <td width="47"><?php echo $spnum[0][1];?></td>
                      </tr>
                      <tr>
                        <td width="10" align="center">*</td>
                        <td><?php echo $spnum[1][0];?></td>
                        <td><?php echo $spnum[1][1];?></td>
                      </tr>
                      <tr>
                        <td width="10" align="center">*</td>
                        <td><?php echo $spnum[2][0];?></td>
                        <td><?php echo $spnum[2][1];?></td>
                      </tr>
                      <tr>
                        <td width="10" align="center">*</td>
                        <td><?php echo $spnum[3][0];?></td>
                        <td><?php echo $spnum[3][1];?></td>
                      </tr>
                      <tr>
                        <td width="10" align="center">*</td>
                        <td><?php echo $spnum[4][0];?></td>
                        <td><?php echo $spnum[4][1];?></td>
                      </tr>
                      <tr>
                        <td width="10" align="center">*</td>
                        <td><?php echo $spnum[5][0];?></td>
                        <td><?php echo $spnum[5][1];?></td>
                      </tr>
                      <tr>
                        <td width="10" align="center">*</td>
                        <td> </td>
                        <td><span lang="zh-cn"><a href="zxjm-dpgd.php">更多...</a></span></td>
                      </tr>
                    </table>
    </div></td>
    <td valign="middle" bgcolor="#FFFFFF"  style="border-right: 1px solid #C0C0C0">
 <?php
//最新加盟会员
$num=6;
$sql="select cu_user,cu_id,cu_intime from ".__DBF."user order by cu_intime desc limit 0,$num";
$usnum=newuser('grxx.php',$sql,$num);
?>
 <div align="center">
     <table border="0" width="96%" id="table3">
      <tr>
       <td width="11" align="center">*</td>
       <td width="118"><?php echo $usnum[0][0];?></td>
          <td width="51"><?php echo $usnum[0][1];?></td>
      </tr>
      <tr>
       <td width="11" align="center">*</td>
       <td><?php echo $usnum[1][0];?></td>
          <td><?php echo $usnum[1][1];?></td>
      </tr>
      <tr>
       <td width="11" align="center">*</td>
       <td><?php echo $usnum[2][0];?></td>
          <td><?php echo $usnum[2][1];?></td>
      </tr>
      <tr>
       <td width="11" align="center">*</td>
       <td><?php echo $usnum[3][0];?></td>
          <td><?php echo $usnum[3][1];?></td>
      </tr>
      <tr>
       <td width="11" align="center">*</td>
       <td><?php echo $usnum[4][0];?></td>
          <td><?php echo $usnum[4][1];?></td>
      </tr>
      <tr>
       <td width="11" align="center">*</td>
       <td><?php echo $usnum[5][0];?></td>
          <td><?php echo $usnum[5][1];?></td>
      </tr>
      <tr>
       <td width="11" align="center">*</td>
       <td> </td>
          <td><span lang="zh-cn"><a href="zxjm-hygd.php" target="_blank">更多...</a></span></td>
      </tr>
     </table>

<?php
//本日热门求购信息
$num=6;
$date=date("Y-m-d H:i:s");
$sql="select cbg_name,cbg_intime,cbg_id from ".__DBF."buygoods where cbg_yxtime>'$date' order by cbg_dayshow desc limit 0,$num";
$toptb=recent_to_buy('cbg-tobuy.php',$sql,$num);
?>                        
    </div></td>
  </tr>
</table>
<div align="center">
 <table border="0" width="776" id="table6" cellspacing="0" cellpadding="0" height="96" bgcolor="#FFFFFF" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0">
  <tr>
   <td>
   <p align="center">   
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="774" height="100">
                <param name="movie" value="images/ad2.swf">
                <param name="quality" value="high">
                <embed src="images/ad2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="774" height="100"></embed>
        </object>
    </td>
  </tr>
 </table>
</div>
<DIV align=center><script src="xia.js" language="javascript"></script></DIV>
<map name="indexMap1" id="indexMap1">
  <area shape="rect" coords="2,2,149,48" href="show-showxy.php?act=tobuy&actt=bmon&more=shownum" target="_blank">
  <area shape="rect" coords="3,52,149,98" href="show-showxy.php?act=tobuy&actt=bday&more=shownum" target="_blank">
  <area shape="rect" coords="4,103,150,149" href="show-showxy2.php?act=goods&actt=bmon" target="_blank">
  <area shape="rect" coords="4,155,149,199" href="show-showxy2.php?act=goods&actt=bday" target="_blank">
</map>
<map name="indexMap2" id="indexMap2">
  <area shape="rect" coords="536,19,576,36" href="syxxfl.php">
</map>
<map name="indexMap3" id="indexMap3">
  <area shape="rect" coords="246,19,286,35" href="show-showxy.php?act=tobuy&more=shownum">
</map>
<map name="indexMap4" id="indexMap4">
  <area shape="rect" coords="247,20,285,36" href="tjxxgd.php">
</map>
</body>
</html>