
  <div class="cen1">
    <div class="cen1L">
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="662" height="217">
      <param name="movie" value="<?php echo THEME_PATH; ?>/images/bcastr3.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="menu" value="false" />
      <param name="swfversion" value="8.0.35.0" />
      <param name="FlashVars" value="<?php echo $this->a_flashadsvar; ?>" />
      <!-- 此 param 标签提示使用 Flash Player 6.0 r65 和更高版本的用户下载最新版本的 Flash Player。如果您不想让用户看到该提示，请将其删除。 -->
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- 下一个对象标签用于非 IE 浏览器。所以使用 IECC 将其从 IE 隐藏。 -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="<?php echo THEME_PATH; ?>/images/bcastr3.swf" width="662" height="217">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="menu" value="false" />
        <param name="swfversion" value="8.0.35.0" />
        <param name="FlashVars" value="<?php echo $this->a_flashadsvar; ?>" />
        <param name="expressinstall" value="<?php echo THEME_PATH; ?>/Scripts/expressInstall.swf" />
        <!-- 浏览器将以下替代内容显示给使用 Flash Player 6.0 和更低版本的用户。 -->
        <div>
          <h4>此页面上的内容需要较新版本的 Adobe Flash Player。</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="获取 Adobe Flash Player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <script type="text/javascript">
    <!--
    swfobject.registerObject("FlashID");
    //-->
    </script>
    </div>
    <div id="loginbox">
      <div class="cen1R">

      <?php
        if(!$GLOBALS['Auth']->isLogged()) {
      ?>

      <form id="formLogin" name="formLogin" action="index.php" method="POST">
      <div class="cen1R1"></div>
	  <div class="cen1R2">
	    <div class="cen1R2-1"><label for="passport">用户名：</label></div>
	    <div class="cen1R2-2"><input id="passport"  type="text" name="username" class="bd1 input" />
	    </div>
	  </div>
	  <div class="cen1R2">
	    <div class="cen1R2-1"><label for="password">密　码：</label></div>
	    <div class="cen1R2-2"><input id="password" type="password" name="rpassword" class="bd1 input" />
	    </div>
	  </div>
	  <div class="cen1R2">
	    <div class="cen1R2-1"><label for="validcode">验证码：</label></div>
	    <div class="cen1R2-2"><table cellspacing="0" cellpadding="0" border="0"><tr><td><input id="validcode" type="text" name="validcode" class="bd2 input" maxlength="4" /></td><td><img src="include/authimg.php" /></td></tr></table>
	    </div>
	  </div>
      <div class="cen1R4">
        <div class="cen1R4-1"><input type="image" src="<?php echo THEME_PATH; ?>/images/dr-03.gif" /></div>
        <div class="cen1R4-1"><a href="signup.php" target="_blank"><img src="<?php echo THEME_PATH; ?>/images/dr-05.gif" /></a></div>
        <div class="forgotpwd"><a href="index.php?md=Affiliate_PZone_Views_ForgotPasswd" target="_blank">忘记密码？</a></div>
      </div>
      <input type="hidden" value="yes" name="commited"/>
      <input type="hidden" value="Affiliate_PZone_Views_Login" name="md"/>
      <input type="hidden" value="login" name="action"/>
      <input type="hidden" value="yes" name="checkvcode" />
      <input type="hidden" value="default1" name="accountid"/>
      </form>
      <?php
        }else {
      ?>
      <div class="cen1R1"></div>
	  <div class="cen1R2">
	    <div class="cen1R2-1"><strong>当前用户：</strong><?php echo $GLOBALS['Auth']->userName; ?><a href="affiliates/index.php?md=Affiliate_Affiliates_Views_AffiliateProfile" target="_blank">修改资料</a></div>
	  </div>
	  <div class="cen1R2">
	    <div class="cen1R2-1"><a href="affiliates/index.php" target="_blank">进入控制面板</a> | <a href="affiliates/logout.php" target="_self">安全退出</a></div>
	  </div>
      <?php
        }
      ?>
    </div>
    </div>
  </div>

  <div class="cen3">
    <div class="cenL">
      <div class="cenL1">
        <div class="cenL1a"><img src="<?php echo THEME_PATH; ?>/images/tp-04.gif" /></div>
		<div class="cenL1b"><strong>加入流程</strong></div>
      </div>
      <div class="cenL2">
        <div class="cenL2a"><a href="signup.php" target="_blank"><img src="<?php echo THEME_PATH; ?>/images/tp-05.gif" border="0" /></a></div>
		<div class="cenL2b"><img src="<?php echo THEME_PATH; ?>/images/tp-09.gif" /></div>
		<div class="cenL2a"><a href="javascript:;"><img src="<?php echo THEME_PATH; ?>/images/tp-06.gif" border="0" /></a></div>
		<div class="cenL2b"><img src="<?php echo THEME_PATH; ?>/images/tp-09.gif" /></div>
		<div class="cenL2a"><a href="javascript:;"><img src="<?php echo THEME_PATH; ?>/images/tp-07.gif" border="0" /></a></div>
		<div class="cenL2b"><img src="<?php echo THEME_PATH; ?>/images/tp-09.gif" /></div>
		<div class="cenL2a"><a href="javascript:;"><img src="<?php echo THEME_PATH; ?>/images/tp-08.gif" border="0" /></a></div>
      </div>
    </div>
	<div class="cenR"><a href="signup.php" target="_blank"><br /><img src="<?php echo THEME_PATH; ?>/images/starthere.png" border="0" /></a></div>
  </div>

  <div class="cen4">
    <div id="tab1">
	  <div class="al_bg1">
	    <div class="cen4La"></div>
		<ul id="topstabs" class="idTabs">
		<li><a href="#bytotal">分红排行榜</a></li>
		<li><a href="#bymonth">月财富榜</a></li>
		</ul>
      </div>
	  <div id="tab1_c">
        <div id="bytotal" class="content">
            <?php
                //获取总业绩排行榜
                $rs = $this->a_core->getTopByTotal(10);
                if(!$rs) {
                    echo '无可用数据';
                }else {
                    $data = array();
                    foreach($rs as $key=>$row) {
                        $data[] = sprintf('%d、%s　%.2f',$key+1,$row['name'],$row['total']).'元';
                    }
                    echo join('<br />',$data);
                }
            ?>
        </div>
        <div id="bymonth" class="content">
            <?php
                //获取月度业绩排行榜
                $rs = $this->a_core->getTopByMonth(10);
                if(!$rs) {
                    echo '无可用数据';
                }else {
                    $data = array();
                    foreach($rs as $key=>$row) {
                        $data[] = sprintf('%d、%s　%.2f',$key+1,$row['name'],$row['total']).'元';
                    }
                    echo join('<br />',$data);
                }
            ?>
        </div>
      </div>
    </div>
    <div class="cen4M">
      <div class="cen4Ma">
        <div class="cen4Ma1"><img src="<?php echo THEME_PATH; ?>/images/tp-11.gif" /></div>
        <div class="cen4Ma2"><strong><a href="index.php?md=Affiliate_PZone_Views_Post&cateid=pzonefaq" target="_blank">常见问题</a></strong></div>
      </div>
      <div class="cen4Mb">
        <?php
        //获取某个分类的文章列表
        $params = array(
            'paged'=>true,  //是否分页
            'pageid'=>1,    //当前页码
            'limit'=>10,    //每页显示条数
            'cateid'=>'pzonefaq'    //分类ID
        );
        $posts = $this->a_core->getPosts($params);
        if($posts) {
            $s_template = '<a href="index.php?md=Affiliate_PZone_Views_Post&cateid=%s" target="_self">[%s]</a><a href="index.php?md=Affiliate_PZone_Views_Post&id=%s" target="_self" title="%s">%s</a>&nbsp;<span class="font2">%s</span><br />';
            foreach($posts['articles'] as $row) {
                echo sprintf($s_template,$row['cateid'],$row['catename'],$row['ID'],$row['title'],$row['title'],$row['postime']);
            }
        }else {
            echo '无可用数据';
        }
        ?>
      </div>
    </div>
    <div class="cen4R">
      <div class="cen4Ma">
        <div class="cen4Ma1"><img src="<?php echo THEME_PATH; ?>/images/tp-11.gif" /></div>
        <div class="cen4Ma2"><strong>联系我们</strong></div>
      </div>
      <div class="cen4R1">
        <div class="cen4R1a">
          <p class="font3">客服热线：400-8888-XXX</p>
          <p>电子信箱：name@yourdomain.com</p>
          <p>在线客服：QQ(xxxxxxxx)</p>
          <p class="font3">修改此区域内容请到模板目录下修改mainpage.tpl.php</p>
        </div>
      </div>
    </div>
  </div>

  <div class="cen5">
    <div class="cen5-1"><strong>合作伙伴</strong></div>
    <div class="cen5-2">
      <?php
        //获取并显示友情链接
        $links = $this->a_core->getFriendLinks();
        if(!$links) {
            echo '暂无链接，欢迎联系交换友情链接。';
        }else {
            //LOGO链接
            if(is_array($links['logo']))
            foreach($links['logo'] as $row) {
                echo sprintf('<div class="cen5-2a"><a title="%s" href="%s" target="_blank"><img src="%s" width="100" height="40" /></a></div>',$row['sitetitle'],$row['siteurl'],$row['logourl']);
            }
        }
      ?>
    </div>
    <div class="clear"></div>
	<div class="cen5-3 lj3">
    <?php
        //文字链接
        if(is_array($links['word'])) {
            foreach($links['word'] as $row) {
                $tmp[] =  sprintf('<a title="%s" href="%s" target="_blank">%s</a>',$row['sitetitle'],$row['siteurl'],$row['sitetitle']);
            }
            echo join('&nbsp;&nbsp;|&nbsp;&nbsp;',$tmp);
        }
    ?>
    </div>
  </div>
