<?php 
error_reporting(0);
if(!$userlogined==true){exit("<script type=\"text/javascript\">location.href='".cd_webpath."user/login.php?login_referer=".cd_webpath."user/".rewrite_url('space.php?do=assets')."';</script>");}
?>
  <div class="user"> 
   <div class="user_center"> 
<?php
include_once('source/space_menu.php');
?>
<?php if($view==""){?>
    <div class="user_main"> 
     <div class="uMain_content"> 
      <div class="main_nav"> 
       <ul> 
        <li class="message"> <a class="on" href="<?php echo rewrite_url('space.php?do=assets');?>">个人账户</a> </li> 
        <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">金币账单</a></li>
        <li class="me_topup"><a href="<?php echo rewrite_url('space.php?do=assets&view=topup'); ?>">金币充值</a></li>
        <li class="me_vip"><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>">升级VIP</a></li>
        <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">充值订单</a></li>
       </ul> 
      </div> 
      <div class="main"> 
       <div id="tooltip" class="refresh"> 
	   <a class="eda" href="<?php echo rewrite_url('space.php?do=assets&view=jifen'); ?>" title="查看积分规则"></a>
       </div> 
      </div> 
      <div class="minHeight500"> 
       <div id="modifyProfile" class="account"> 
        <div class="title">积分详情 </div> 
        <div> 
         <div class="available">可以使用的金币 <span><?php echo $CcTvAi_com_points?></span></div> 
         <div class="will">距离下级经验<span><?php echo getrankname($CcTvAi_com_rank,7); ?></span></div> 
         <div class="not">升级奖励金币<span><?php echo cd_upgradepoints?></span></div> 
        </div> 
        <div class="remark"> 
         <p><br /><b></b>您的目前等级：&nbsp;Lv<?php echo getrankname($CcTvAi_com_rank,1); ?>/<?php echo getrankname($CcTvAi_com_rank,2); ?>&nbsp;距离下一个等级还需&nbsp;<?php echo getrankname($CcTvAi_com_rank,7); ?>&nbsp;经验，下一个等级名称：<?php echo getxrankname($CcTvAi_com_rank,2);?><br /><b></b>您可以通过分享歌曲/视频/，每日签到，摇一摇等等...来获取成长经验值。</p> 
        </div> 
       </div> 
       <div class="member"> 
        <div class="member_left"> 
         <div class="title">用户信息&nbsp;&nbsp;</div> 
         <div class="rank"> 
          <div class="yellow"> <span>您目前的经验值：<?php echo $CcTvAi_com_rank; ?></span>
           <div class="rank_box"><p<?php if($CcTvAi_com_rank){ echo ' style="width:'.getrankname($CcTvAi_com_rank,6).';"';} ?>></p></div>
           <span class="share"><?php echo getrankname($CcTvAi_com_rank,8); ?></span>
          </div> 
		  <p>等级：Lv<?php echo getrankname($CcTvAi_com_rank,1); ?></p>
		  <p>头衔：<?php echo getrankname($CcTvAi_com_rank,2); ?></p>
		  <p>勋章：<img src="<?php echo getrankname($CcTvAi_com_rank,3); ?>"></p>
		  <p>距离下一个等级还需：<?php echo getrankname($CcTvAi_com_rank,7); ?>&nbsp;经验</p>
		  <p>下一个头衔名称：<?php echo getxrankname($CcTvAi_com_rank,2);?></p>
         </div> 
        </div> 
        <div class="member_right"> 
         <div class="title">VIP会员成长信息</div>
<?php if($CcTvAi_com_grade==1){ ?>
         <div class="rank"> 
          <div class="rank_box"> 
           <div class="vip"></div> 
           <ul> 
<?php if(getviprank($CcTvAi_com_viprank,0)==1){ ?>
            <li class="go1"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=1){ echo 'go1'; }else{ echo 'vip1'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==2){ ?>
            <li class="go2"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=2){ echo 'go2'; }else{ echo 'vip2'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==3){ ?>
            <li class="go3"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=3){ echo 'go3'; }else{ echo 'vip3'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==4){ ?>
            <li class="go4"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=4){ echo 'go4'; }else{ echo 'vip4'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==5){ ?>
            <li class="go5"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=5){ echo 'go5'; }else{ echo 'vip5'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==6){ ?>
            <li class="go6"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=6){ echo 'go6'; }else{ echo 'vip6'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==7){ ?>
            <li class="go7"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=7){ echo 'go7'; }else{ echo 'vip7'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==8){ ?>
            <li class="go8"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=8){ echo 'go8'; }else{ echo 'vip8'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==9){ ?>
            <li class="go9"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=9){ echo 'go9'; }else{ echo 'vip9'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==10){ ?>
            <li class="go10"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=10){ echo 'go10'; }else{ echo 'vip10'; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
           </ul> 
          </div> 
<?php
if($CcTvAi_com_vipgrade==1){
$cd_viptitle = 'VIP月付会员';
$cd_speed = '5';
}elseif($CcTvAi_com_vipgrade==2){
$cd_viptitle = 'VIP年付会员';
$cd_speed = '10';
}
?>
          <div class="text">
<?php
if($CcTvAi_com_grade==1){
$cd_vipenddate=strtotime($CcTvAi_com_vipenddate)-time();
echo "<p style='margin-top:6px;'><font color=red>您申请VIP会员的时间是：".$CcTvAi_com_vipindate."&nbsp;&nbsp;离您的有效期还有：<b>".sprintf("%01.0f",$cd_vipenddate/86400)."</b> 天</font></p>";
}
?>
           <p><span class="green">成长值：</span>您的总成长值为&nbsp;<b><?php echo $CcTvAi_com_viprank; ?></b>，预计<b><?php echo sprintf("%01.0f",(getviprank($CcTvAi_com_viprank,3)-$CcTvAi_com_viprank)/$cd_speed); ?></b>天后即可成为尊贵<b>VIP<?php echo getviprank($CcTvAi_com_viprank,0)+1; ?></b></p>
           <p><span class="green">成长速度：</span><b>年付会员&nbsp;&nbsp;&nbsp;10</b>&nbsp;点/天&nbsp;&nbsp;&nbsp;&nbsp;<b>月付会员&nbsp;&nbsp;&nbsp;5&nbsp;</b>点/天<br/>您是<b><?php echo $cd_viptitle; ?></b>，当前成长速度&nbsp;<?php echo '<b>'.$cd_speed.'</b>'; ?>&nbsp;点/天&nbsp;</p>
           <p style="margin-top:6px;"><span class="green">升级VIP：</span><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>"><span class="renew">升级</span></a></p>
          </div> 
         </div> 
<?php }else{ ?>
<?php if($CcTvAi_com_viprank>=1){ ?>
         <div class="rankno"> 
          <div class="rank_box"> 
           <div class="vip"></div> 
           <ul> 
<?php for($k=1;$k<=10;$k++){ ?>
<?php if(getviprank($CcTvAi_com_viprank,0)==$k){ ?>
            <li class="go<?php echo $k; ?>"><p style="width:<?php echo getviprank($CcTvAi_com_viprank,1); ?>;"></p><div class="share" style="top:38px;left:0%;"><?php echo $CcTvAi_com_viprank; ?></div></li>
<?php }else{ ?>
            <li class="<?php if(getviprank($CcTvAi_com_viprank,0)>=$k){ echo 'go'.$k; }else{ echo 'vip'.$k; }?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
<?php } ?>
           </ul> 
          </div> 
<?php
if($CcTvAi_com_vipgrade==1){
$cd_viptitle = 'VIP月付会员';
$cd_speed = '5';
}elseif($CcTvAi_com_vipgrade==2){
$cd_viptitle = 'VIP年付会员';
$cd_speed = '10';
}
?>
          <div class="text">
           <p><span class="green">成长值：</span>您的总成长值为&nbsp;<b><?php echo $CcTvAi_com_viprank; ?></b>，充值即可成为尊贵<b>VIP<?php echo getviprank($CcTvAi_com_viprank,0); ?></b></p>
           <p><span class="green">成长速度：</span><b>年付会员&nbsp;&nbsp;&nbsp;10</b>&nbsp;点/天&nbsp;&nbsp;&nbsp;&nbsp;<b>月付会员&nbsp;&nbsp;&nbsp;5&nbsp;</b>点/天<br/>您的VIP会员已过期，当前成长值正以&nbsp;<b>5</b>&nbsp;点/天的速度下降&nbsp;</p>
           <p style="margin-top:6px;"><span class="green">升级VIP：</span><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>"><span class="renew">升级</span></a></p>
          </div> 
         </div>
<?php }else{ ?>
         <div class="rankno"> 
          <div class="rank_box"> 
           <div class="vip"></div> 
           <ul> 
<?php for($k=1;$k<=10;$k++){ ?>
            <li class="vip<?php echo $k; ?>"><p style="width:0%;"></p><div class="share" style="top:38px;left:0%;display: none;">0</div></li>
<?php } ?>
           </ul> 
          </div> 
          <div class="text">
           <p><span class="green">成长值：</span>您的总成长值为&nbsp;<b>0</b>，充值即可成为尊贵<b>VIP1</b></p>
           <p><span class="green">成长速度：</span><b>年付会员&nbsp;&nbsp;&nbsp;10</b>&nbsp;点/天&nbsp;&nbsp;&nbsp;&nbsp;<b>月付会员&nbsp;&nbsp;&nbsp;5&nbsp;</b>点/天<br/>（您还不是VIP，没有成长速度）</p>
           <p style="margin-top:6px;"><span class="green">升级VIP：</span><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>"><span class="renew">升级</span></a></p>
          </div> 
         </div>
<?php } ?>
<?php } ?>
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
<?php }elseif($view=="scoreBill"){?>
    <div class="user_main"> 
     <div class="uMain_content"> 
      <div class="main_nav"> 
       <ul> 
        <li class="message"> <a href="<?php echo rewrite_url('space.php?do=assets');?>">个人账户</a> </li> 
        <li class="me_score"><a class="on" href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">金币账单</a></li>
        <li class="me_topup"><a href="<?php echo rewrite_url('space.php?do=assets&view=topup'); ?>">金币充值</a></li>
        <li class="me_vip"><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>">升级VIP</a></li>
        <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">充值订单</a></li>
       </ul> 
      </div> 
      <div class="main"> 
       <div id="tooltip" class="refresh"> 
       </div> 
      </div> 
      <div class="minHeight500"> 
       <div id="modifyProfile" class="score"> 
        <ul class="title">
         <li><a<?php if($cid == ""){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">全部明细</a></li>
         <li><a<?php if($cid == "1"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill&cid=1'); ?>">全部收入</a></li>
         <li><a<?php if($cid == "2"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill&cid=2'); ?>">全部支出</a></li>
        </ul> 
        <ul class="list"> 
         <li class="title"> 
          <div class="source">来源/用途</div> 
          <div class="revenue">收入</div> 
          <div class="expenditure">支出</div> 
          <div class="time">日期</div> 
          <div class="receive">金币状态</div> 
         </li> 
<?php
global $db;
$a=0;
if ($cid==1) {
	$sql="select * from " . tname('bill') . " where cd_type=1 and cd_uid='$CcTvAi_com_userid' and cd_points>=1 order by cd_addtime desc";
} elseif ($cid==2) {
	$sql="select * from " . tname('bill') . " where cd_type=0 and cd_uid='$CcTvAi_com_userid' and cd_points>=1 order by cd_addtime desc";
} elseif ($cid==3) {
	$sql="select * from " . tname('bill') . " where cd_type=1 and cd_state=3 and cd_uid='$CcTvAi_com_userid' and cd_points>=1 order by cd_addtime desc";
} else {
	$sql="select * from " . tname('bill') . " where cd_uid='$CcTvAi_com_userid' and cd_points>=1 order by cd_addtime desc";
}
$Arr=getuserpage($sql, 20); //sql,每页显示条数
$result=$db->query($Arr[2]);
$num=$db->num_rows($result);
if ($num) {
	while ($row=$db->fetch_array($result)) {
		$a=$a+1;
		echo '<li>';
		echo '<div class="source">';
		echo '<span class="icon_mini_' . $row['cd_icon'] . '"></span>';
		echo '<span class="te">' . $row['cd_title'] . '</span>';
		echo '</div>';
		echo '<div class="revenue">';
		if ($row['cd_type']==1) {
			echo '+' . $row['cd_points'];
		}
		echo '</div>';
		echo '<div class="expenditure">';
		if ($row['cd_type']==0) {
			echo '-' . $row['cd_points'];
		}
		echo '</div>';
		echo '<div class="time">' . date("Y-m-d", strtotime($row['cd_addtime'])) . '</div>';
		echo '<div class="receive">';
		if ($row['cd_type']==1) {
			if ($row['cd_state']==1) {
				echo '自动领取';
			} elseif ($row['cd_state']==2) {
				echo '已领取';
			} elseif ($row['cd_state']==3) {
				echo '已领取';
			} else {
				echo '自动领取';
			}
		} else {
			echo '已扣除';
		}
		echo '</div>';
		echo '</li>';
	}
} else {
	echo '<div class="nothing">还没有任何账单。</div>';
}
?>
        </ul> 
       </div> 
<?php if($num>0){?>
       <div class="page"><div class="pages"><?php echo $Arr[0]; ?><input type="text" maxlength="5" onkeydown="function c(event,val){e = event ? event :(window.event ? window.event : null);if(e.keyCode==13){val = parseInt(val);val=isNaN(val)||(val<=0)?1:val;window.location.href='<?php echo cd_webpath?>user/<?php echo "space.php?do=assets&view=scoreBill&cid=".SafeRequest("cid","get")."&pages="; ?>'+val;return false;}else{return true;}};if(!c(event,this.value))return false;" title="输入页码，按回车快速跳转"/></div></div>
<?php } ?>
        </div>
<?php }elseif($view=="topup"){?>
<style type="text/css">
.commons{color: #808080;}
.commons p{color: #808080; margin: 20px 20px; font-size: 12px;}
.pay{color: #000; margin: 10px 80px; font-size: 14px;border: 1px solid #CFCACA;border-radius: 4px;padding: 10px;}
.pay .t{float: left;}
.pays{color: #000; margin: 10px 20px; font-size: 12px;border: 1px solid #CFCACA;border-radius: 4px;padding: 10px;}
.renew{background: url("./static/space/images/integra_but.png") no-repeat scroll 0 -86px;_background: url("./static/space/images/integra_but.gif") no-repeat scroll 0 -86px;border: 0 none;width:78px;height:28px;padding-left:6px;color: #FFFFFF;cursor: pointer;line-height: 24px;display: inline;float: left;text-align: center;margin-left:1px;margin-top: -5px;}
</style>
  <div class="user_main"> 
   <div class="uMain_content"> 
    <div class="main_nav"> 
     <ul> 
      <li class="message"> <a href="<?php echo rewrite_url('space.php?do=assets');?>">个人账户</a> </li> 
      <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">金币账单</a></li>
      <li class="me_topup"><a class="on" href="<?php echo rewrite_url('space.php?do=assets&view=topup'); ?>">金币充值</a></li>
      <li class="me_vip"><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>">升级VIP</a></li>
      <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">充值订单</a></li>
     </ul> 
    </div> 
    <div class="main"> 
     <div id="tooltip" class="refresh"> 
     </div> 
    </div>   
      <div class="commons">
       <p>会员账号：<?php echo $CcTvAi_com_username?> (<?php echo $CcTvAi_com_nicheng?>)</p>
       <p>金币余额：<?php echo $CcTvAi_com_points;?>金币</p>
       <div class="pay">	
         <span class="t">在线网银金币直充：</span><span class="renew" id="topupRecharge">充值</span><br />
       </div>	<br />
       <div class="pay">	
         金币说明：<br /><br />
         → 本站唯一通用货币，它可以用于下载影音，虚拟物品，实物。支付。购买。等等操作<br /><br />
         金币充值比例：1元人民币=<?php echo cd_paycpoints;?>金币<br /><br />
       </div> 
       <br /><div class="pays">充值说明：支付成功后，自动到账。<span style="color: #CC0000;">超过10分钟未到账，请联系客服QQ: <?php echo cd_webqq?>。</span></div><br />
      </div> 
<?php }elseif($view=="vip"){?>
<style type="text/css">
.commons{color: #808080;}
.commons p{color: #808080; margin: 20px 20px; font-size: 12px;}
.pay{color: #000; margin: 10px 80px; font-size: 14px;border: 1px solid #CFCACA;border-radius: 4px;padding: 10px;}
.pay .t{float: left;}
.pays{color: #000; margin: 10px 20px; font-size: 12px;border: 1px solid #CFCACA;border-radius: 4px;padding: 10px;}
.renew{background: url("./static/space/images/integra_but.png") no-repeat scroll 0 -86px;_background: url("./static/space/images/integra_but.gif") no-repeat scroll 0 -86px;border: 0 none;width:78px;height:28px;padding-left:6px;color: #FFFFFF;cursor: pointer;line-height: 24px;display: inline;float: left;text-align: center;margin-left:1px;margin-top: -5px;}
</style>
  <div class="user_main"> 
   <div class="uMain_content"> 
    <div class="main_nav"> 
     <ul> 
      <li class="message"> <a href="<?php echo rewrite_url('space.php?do=assets');?>">个人账户</a> </li> 
      <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">金币账单</a></li>
      <li class="me_topup"><a href="<?php echo rewrite_url('space.php?do=assets&view=topup'); ?>">金币充值</a></li>
      <li class="me_vip"><a class="on" href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>">升级VIP</a></li>
      <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">充值订单</a></li>
     </ul> 
    </div> 
    <div class="main"> 
     <div id="tooltip" class="refresh"> 
     </div> 
    </div> 
      <div class="commons">
       <p>会员账号：<?php echo $CcTvAi_com_username?> (<?php echo $CcTvAi_com_nicheng?>)</p>
       <p>金币余额：<?php echo $CcTvAi_com_points;?>金币</p>
       <br /><p><span style="color: #CC0000;">升级VIP：方案一</span></p>
       <div class="pay">	
         <span class="t">在线网银直充：</span><span class="renew" id="recharge">充值</span><br />
       </div>	
       <br /><p><span style="color: #CC0000;">升级VIP：方案二</span></p>
       <div class="pay">	
         金币自助转VIP：<br /><br />
         → 如果您当前的条件满足VIP会员申请条件，您就可以直接申请成为VIP会员;<br /><br />
         开通VIP需支付：<?php echo cd_vippoints;?>金币/月　<?php echo cd_vipyearspointsa;?>金币/年<br /><br />
         VIP会员的有效期：<?php echo cd_viptime;?>天/月　<?php echo cd_vipyearstime;?>天/年<br /><br />
<?php if(cd_vipoff=="yes"){?>
<?php if($CcTvAi_com_grade == 1){?>
         <span class="button-main"><span><button type="button" id="vippoints" class="seh_b">续费月VIP</button> </span></span>
         <span class="button-main" style="margin-left:15px;"><span><button type="button" id="vipyearspoints" class="seh_b">续费年VIP</button> </span></span>
		 <br /><br />
		 <span style="color: #CC0000;"><?php
$cd_vipenddate=strtotime($CcTvAi_com_vipenddate)-time();
echo "离您的VIP会员有效期还有：<b>".sprintf("%01.0f",$cd_vipenddate/86400)."</b> 天";
?>，您可以重复续费累计天数。</span>
<?php }else{?>
         <span class="button-main"><span><button type="button" id="vippoints" class="seh_b">申请月VIP</button> </span></span>
         <span class="button-main" style="margin-left:15px;"><span><button type="button" id="vipyearspoints" class="seh_b">申请年VIP</button> </span></span>
		 <br /><br />
<?php }?>
		 
<?php }else{?>
         <span style="color: #CC0000;">暂停自助开通VIP！</span><br /><br />
<?php }?>
       </div> 
<?php
include "../plug/vip_code/conf.inc.php";
if(vip_code_off=="1"){
?>
       <br /><p><span style="color: #CC0000;">升级VIP：方案三</span></p>
       <div class="pay">
         <span class="t">输入激活码：</span>
		 <input type="text" style="width: 200px;margin-top: -1px;" class="input_normal input_focus" id="code" name="code">
		 <button style="border: 0px outset buttonface;background: #e12c21;color: #FFFFFF;text-decoration: none;padding-left: 5px;padding-right: 5px;margin-left: 10px;margin-top: -2px;height: 24px;text-align: center;line-height: 22px;border-radius: 3px;width: 70px;" onclick="vip_code();">升级VIP</button>
		 <br />
       </div>
<?php }?>
       <br /><div class="pays">
	   升级说明：支付成功后，自动开通VIP会员服务。<span style="color: #CC0000;">超过10分钟未升级VIP，请联系客服QQ: <?php echo cd_webqq?>。</span><br />
	   <div style="margin-top: 5px;color: #000;">激活码说明：通过参与网站活动，可获得VIP会员激活码、</div>
	   </div><br />
      </div> 
<?php }elseif($view=="pointsorder"){?>
  <div class="user_main"> 
   <div class="uMain_content"> 
    <div class="main_nav"> 
     <ul> 
      <li class="message"> <a href="<?php echo rewrite_url('space.php?do=assets');?>">个人账户</a> </li> 
      <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">金币账单</a></li>
      <li class="me_topup"><a href="<?php echo rewrite_url('space.php?do=assets&view=topup'); ?>">金币充值</a></li>
      <li class="me_vip"><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>">升级VIP</a></li>
      <li class="me_score"><a class="on" href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">充值订单</a></li>
     </ul> 
    </div> 
    <div class="main"> 
     <div id="tooltip" class="refresh"> 
     </div> 
    </div>  
<?php if($cid){?>
<style type="text/css">
.commons{color: #666;}
.commons p{color: #666; margin: 20px 20px; font-size: 18px;}
.pay{overflow: hidden;color: #000; margin: 10px 0px; font-size: 14px;border: 1px solid #CFCACA;border-radius: 1px;padding: 10px;}
</style>
      <div class="minHeight500"> 
       <div class="score"> 
        <ul class="title">
         <li><a href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">全部订单</a></li>
		 <li><a class="current">查看订单详情</a></li>
        </ul> 
      <div class="commons">
<?php
global $db;
$sql="select * from " . tname('pay') . " where cd_uid='$CcTvAi_com_userid' and cd_id='$cid'";
if($row=$db->getrow($sql)) {
	$type=$row['cd_type'];
	$row['cd_type']=str_replace('支付宝免签约','支付宝',$row['cd_type']);
	$row['cd_type']=str_replace('支付宝即时到账','支付宝',$row['cd_type']);
	$row['cd_type']=str_replace('支付宝担保交易','支付宝',$row['cd_type']);
	$row['cd_type']=str_replace('支付宝双向接口','支付宝',$row['cd_type']);
	?>
       <div class="pay">	
	   产品名称：<?php echo $row['cd_name']?><br /><br />
	   订单号：<?php echo $row['cd_key']?><br /><br />
	   购买数量：<span style="color: #37a232;font-weight: bold;"><?php echo $row['cd_mub']?></span><br /><br />
	   应付款金额：<span style="color: #f37800;font-weight: bold;"><?php echo $row['cd_rmb']?>.00元</span><br /><br />
	   付款方式：<?php echo $row['cd_type']?><br /><br />
	   交易状态：<span style="color: #F30031;font-weight: bold;"><?php echo $row['cd_state']?></span><br /><br />
	   订单时间：<?php echo $row['cd_addtime']?><br /><br />
	   <?php 
	   if(cd_xalipaya=="3"){
		   if($type=="支付宝免签约"){
			   if($row['cd_state']=="等待付款"){
			   echo '<span class="button-main"><span><input type="submit" value="付款" onclick="window.open(\''.cd_webpath.'user/do.php?p=account&a=topupfreealipay&id='.$row['cd_id'].'\')" class="btn btn-success"/></span></span><span class="button-main" style="margin-left: 15px;"><span><input type="submit" name="did" value="撤销订单" id="delpay" did="'.$row['cd_id'].'" class="btn btn-success"/></span></span>';
			   }
		   }
	   }
	   ?>
       </div>
<?php }else{?>
	<p><br /><br />很抱歉，您查看的订单不存在！</p>
<?php } ?>
       </div>
       </div> 
        </div>
<?php }else{?>
      <div class="minHeight500"> 
       <div id="modifyProfile" class="score"> 
        <ul class="title">
         <li><a class="current" href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">全部订单</a></li>
        </ul> 
        <ul class="list"> 
         <li class="title"> 
          <div class="pay">产品名称</div> 
          <div class="revenue">数量</div> 
          <div class="expenditure">付款</div> 
		  <div class="overdue">付款方式</div>
          <div class="time">订单时间</div> 
          <div class="receive">交易状态</div> 
		  <div class="receive">订单详情</div>
         </li>
<?php
global $db;
$sql="select * from " . tname('pay') . " where cd_uname='$CcTvAi_com_username' order by cd_addtime desc";
$Arr=getuserpage($sql, 20); //sql,每页显示条数
$result=$db->query($Arr[2]);
$num=$db->num_rows($result);
if ($num) {
	while ($row=$db->fetch_array($result)) {
		$row['cd_type']=str_replace('支付宝免签约','支付宝',$row['cd_type']);
		$row['cd_type']=str_replace('支付宝即时到账','支付宝',$row['cd_type']);
		$row['cd_type']=str_replace('支付宝担保交易','支付宝',$row['cd_type']);
		$row['cd_type']=str_replace('支付宝双向接口','支付宝',$row['cd_type']);
		$row['cd_state']=str_replace('等待付款','<span style="color: #F30031;font-weight: bold;">等待付款</span>',$row['cd_state']);
		$row['cd_state']=str_replace('等待发货','<span style="color: #F30031;font-weight: bold;">等待发货</span>',$row['cd_state']);
echo '		 <li>
		 <div class="pay"><span class="icon_mini_pointsorder"></span><span class="te">'.$row['cd_name'].'</span></div>
		 <div class="revenue">'.$row['cd_mub'].'</div>
		 <div class="expenditure">'.$row['cd_rmb'].'.00元</div>
		 <div class="overdue">'.$row['cd_type'].'</div>
		 <div class="time" title="'.$row['cd_addtime'].'">' . date("Y-m-d", strtotime($row['cd_addtime'])) . '</div>
		 <div class="receive">'.$row['cd_state'].'</div>
		 <div class="receive"><a href="'.rewrite_url('space.php?do=assets&view=pointsorder&cid='.$row['cd_id'].'').'">订单详情</a></div>
		 </li> ';
	}
} else {
	echo '<div class="nothing">还没有任何账单。</div>';
}
?>		        
		 </ul> 
       </div> 
<?php if($num>0){?>
       <div class="page"><div class="pages"><?php echo $Arr[0]; ?><input type="text" maxlength="5" onkeydown="function c(event,val){e = event ? event :(window.event ? window.event : null);if(e.keyCode==13){val = parseInt(val);val=isNaN(val)||(val<=0)?1:val;window.location.href='<?php echo cd_webpath?>user/space.php?do=assets&view=pointsorder&pages='+val;return false;}else{return true;}};if(!c(event,this.value))return false;" title="输入页码，按回车快速跳转"/></div></div>
<?php } ?>
        </div>
<?php } ?>
<?php }elseif($view=="jifen"){?>
    <div class="user_main"> 
     <div class="uMain_content"> 
      <div class="main_nav"> 
       <ul> 
        <li class="message"> <a class="on" href="<?php echo rewrite_url('space.php?do=assets');?>">个人账户</a> </li> 
        <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=scoreBill'); ?>">金币账单</a></li>
        <li class="me_topup"><a href="<?php echo rewrite_url('space.php?do=assets&view=topup'); ?>">金币充值</a></li>
        <li class="me_vip"><a href="<?php echo rewrite_url('space.php?do=assets&view=vip'); ?>">升级VIP</a></li>
        <li class="me_score"><a href="<?php echo rewrite_url('space.php?do=assets&view=pointsorder'); ?>">充值订单</a></li>
       </ul> 
      </div> 
      <div class="main"> 
       <div id="tooltip" class="refresh"> 
	   <a class="eda" href="<?php echo rewrite_url('space.php?do=assets&view=jifen'); ?>" title="查看积分规则"></a>
       </div> 
      </div> 
      <div class="minHeight500"> 
       <div id="modifyProfile" class="score"> 
        <ul class="title">
         <li><a style="width: 750px;text-decoration: none;">进行以下事件动作，会得到积分奖励。不过，在一个周期内，您最多得到的奖励次数有限制</a></li>
        </ul> 
        <ul class="list"> 
         <li class="title"> 
          <div class="source" style="width: 340px;"><span style="float: left;">　动作名称</span></div> 
          <div class="revenue">周期范围</div> 
          <div class="expenditure" style="width: 150px;">周期内最多奖励次数</div> 
          <div class="time">金币</div> 
          <div class="receive">经验</div> 
         </li> 
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">1、会员中心签到</span></div>
		 <div class="revenue">每天</div>
		 <div class="expenditure" style="width: 150px;">1</div>
		 <div class="time">随机</div>
		 <div class="receive">+0</div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">2、摇摇乐</span></div>
		 <div class="revenue">每天</div>
		 <div class="expenditure" style="width: 150px;">1</div>
		 <div class="time">随机</div>
		 <div class="receive">+0</div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">3、每天登录</span></div>
		 <div class="revenue">每天</div>
		 <div class="expenditure" style="width: 150px;">1</div>
		 <div class="time">+<?php echo cd_userloginpoints?></div>
		 <div class="receive">+<?php echo cd_userloginrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">4、分享音乐/视频</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">+<?php echo cd_userupmusicpoints?></div>
		 <div class="receive">+<?php echo cd_userupmusicrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">5、用户等级提升</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">+<?php echo cd_upgradepoints?></div>
		 <div class="receive">+0</div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">6、通过美女认证奖励金币</span></div>
		 <div class="revenue">一次性</div>
		 <div class="expenditure" style="width: 150px;">1</div>
		 <div class="time">+<?php echo cd_usermmpoints?></div>
		 <div class="receive">+0</div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">7、上传照片</span></div>
		 <div class="revenue">每天</div>
		 <div class="expenditure" style="width: 150px;"><?php echo cd_useruppicceiling?></div>
		 <div class="time">+<?php echo cd_useruppicpoints?></div>
		 <div class="receive">+<?php echo cd_useruppicrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">8、发表说说</span></div>
		 <div class="revenue">每天</div>
		 <div class="expenditure" style="width: 150px;"><?php echo cd_usersaidceiling?></div>
		 <div class="time">+<?php echo cd_usersaidpoints?></div>
		 <div class="receive">+<?php echo cd_usersaidrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">9、访问空间</span></div>
		 <div class="revenue">每天</div>
		 <div class="expenditure" style="width: 150px;"><?php echo cd_userwebceiling?></div>
		 <div class="time">+<?php echo cd_userwebpoints?></div>
		 <div class="receive">+<?php echo cd_userwebrank?></div>
		 </li>
        </ul> 
       </div> 
       <div id="modifyProfile" class="score"> 
        <ul class="title">
         <li><a style="width: 750px;text-decoration: none;">以下事件动作，会受到积分惩罚。</a></li>
        </ul> 
        <ul class="list"> 
         <li class="title"> 
          <div class="source" style="width: 340px;"><span style="float: left;">　动作名称</span></div> 
          <div class="revenue">周期范围</div> 
          <div class="expenditure" style="width: 150px;">周期内最多惩罚次数</div> 
          <div class="time">金币</div> 
          <div class="receive">经验</div> 
         </li> 
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">1、音乐/视频被删除</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">-<?php echo cd_userdeletemusicpoints?></div>
		 <div class="receive">-<?php echo cd_userdeletemusicrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">2、照片被删除</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">-<?php echo cd_userdeletepicpoints?></div>
		 <div class="receive">-<?php echo cd_userdeletepicrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">3、说说被删除</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">-<?php echo cd_userdeletesaidpoints?></div>
		 <div class="receive">-<?php echo cd_userdeletesaidrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">4、评论被删除</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">-<?php echo cd_userdeletecommentspoints?></div>
		 <div class="receive">-<?php echo cd_userdeletecommentsrank?></div>
		 </li>
		 <li>
		 <div class="source" style="width: 340px;"><span class="te">5、留言被删除</span></div>
		 <div class="revenue">不限周期</div>
		 <div class="expenditure" style="width: 150px;">不限次数</div>
		 <div class="time">-<?php echo cd_userdeletemessagepoints?></div>
		 <div class="receive">-<?php echo cd_userdeletemessagerank?></div>
		 </li>
        </ul> 
       </div> 
        </div>
<?php }?>
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.min.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/core.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/card.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/dialog.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.plugins.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/common.js"></script> 
  <script type="text/javascript">listenMsg.start();nav.init();nav.userMenu();nav.helpNoticeInit();</script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/account.js"></script>
  <?php if(vip_code_off=="1"){?><script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/vip_code.js"></script><?php }?>
  <script type="text/javascript">
account.doAccountInit(); 
account.doAccountInita(); 
account.vipRecharge(); 
account.pointsRecharge(); 
account.payRecharge(); 
</script>
<?php include_once('source/space_footer.php');?> 
  </body>
</html>