<?
			include("config.inc.php");
			include "class/member.class.php";
			$member=new member();
			$user_info=$member->member_auth();
			//if($user_info[user_level]=="Uactive") die("您不是缴费会员用户 请支付购买以后再登陆进行下载");
			$upoint=$user_info[point];
			//$ftpinfo=$member->getFtpInfo($user_info[user_id]);
			//print_r($ftpinfo);
			$quota = $member->getTodayQuote($user_info[user_id]);
			$fid=$_GET[id];
			$fdb = $PlusDB->prefix(attachment);
			$adb = $PlusDB->prefix(articles);
			$sql="select f.*,a.cid from $fdb f left join $adb a on (a.id=f.aid) where f.id=$fid";
			$row=$PlusDB->query_firstrow($sql);
			//if(!checkCateAccess($row[cid])) error("你无权限进入此栏目!");
			//trace($user_info);
//			if($user_info[user_level]=="Guest"){
//				include "modules/member/index.php";
//			}else{
?>
<HTML><HEAD><TITLE>影片下载</TITLE>
<LINK 
href="template/default/style.css" type=text/css rel=stylesheet>
<TITLE>影片下载</TITLE>
<meta name="robots" content="index,follow" >
<meta name="keywords" content="news, technology, headlines, xplus,hacker, hackers, linux, software, download, downloads, free, community, mp3, forum, forums, bulletin, board, boards, bbs, php, survey, poll, polls, kernel, comment, comments, portal, odp, open, source, opensource, FreeSoftware, gnu, gpl, license, Unix, *nix, mysql, sql, database, databases, web site, weblog, guru, module, modules, theme, themes, cms, content management" >
<meta name="description" content="MOVIE DOWNLOAD" >
<meta name="rating" content="general" >
<meta name="copyright" content="Copyright  2002-2003" >
<style type="text/css">
<!--
.style1 {
	color: #6633CC;
	font-weight: bold;
}
.style2 {
	color: #FF6600;
	font-weight: bold;
}
.style3 {
	color: #0066FF;
	font-weight: bold;
}
.style4 {
	color: #66CC00;
	font-weight: bold;
}
.style5 {
	color: #9933CC;
	font-weight: bold;
}
-->
</style>
</HEAD>
<BODY leftMargin=0 
background="template/sebb/images/sebaobei_bg.gif" 
topMargin=0>
<div align=right><input type=submit value=关闭 style=cursor:hand;height:22;font-size:10pt;line-height:120% onclick=javascript:window.close();></div>
<?
			if(!is_array($row)){
				$str= "无此影片的详细信息!";
			}else{
				if($row[point]>0 && !checkCateAccess($row[cid])) error("你无权限进入此栏目!");
				$c_code=$member->get_code($user_info[user_id]);
				$format = strtoupper(str_replace(".", "", strrchr($row[url], ".")));
				//echo "$row[length] 分钟<br>";
				$size =  "$row[size] M<br>";
				$hits =$row[hits];
				$point = $row[point];
				$points =  $upoint;
				$restquote=sprintf("%01.2f",(_QUOTA-$quota)/(1024*1024));
				$quote = $restquote;
				if($restquote < $row[size]){
					$quote2 =  "对不起，此文件超出的您今日剩余流量，请明天再进行下载或者浏览下载其他文件";	
				}else{
				if($user_info[user_level]=="Member"){	
					if($upoint>$row[point]){
						$quote2 ="<img src=images/down.gif border=0><a href=attach.php?id=$row[id]&code=$c_code onclick=\"return confirm('此项操作耗费你$row[point]个"._POINT.",确认继续操作?请不要重复单击,否则将重复扣点')\">点击下载</a>";
					}else{
						$quote2 =  "<br><font color=red>你的"._POINT."不足 $row[point],只剩余 $upoint ,请积攒够足够的"._POINT."进行下载!</font>";
					}
				}elseif($user_info[user_level]=="Admin" || $user_info[user_level]=="Gmember" || $user_info[user_level]=="Qmember" || $user_info[user_level]=="Ymember" || $user_info[user_level]=="Vip"){
					//是包月,包年,包季用户,按照过期日期算
					$ctime=date("Y-m-d");
					$etime = $user_info[etime];
					if($etime>=$ctime){
						$download = "<a href=attach.php?id=$row[id]&code=$c_code><img src=images/Download2.gif width=\"154\" height=\"51\" border=0></a>";
					}else{
						if($upoint>$row[point]){
							$download = "<a href=attach.php?id=$row[id]&code=$c_code><img src=images/Download2.gif width=\"154\" height=\"51\" border=0></a>";
						}else{
							$download = "<font color=red>你的会员资格已经过期,并且你的"._POINT."不足 $row[point],只剩余 $upoint ,请积攒够足够的"._POINT."进行下载!</font>";
						}
					}					
				}
			}
			}
//			}
?>
<table width="327" border="0" cellspacing="0" cellpadding="5" align=center>
        <tr>
          <td width="156"><strong>文件类型:</strong><span class="style4"><?=$format?></span> </td>
          <td width="151"><strong>影片大小:</strong><span class="style5"><?=$size?></span></td>
        </tr>
        <tr>
          <td colspan="2"><strong>下载次数:</strong><span class="style3"><?=$hits?></span></td>
        </tr>
        <tr>
          <td colspan="2"><p><strong>需要点数:</strong><?=$point?> &nbsp;剩余点数是 <span class="style2"><?=$points?></span> 
            </td>
        </tr>
        <tr>
          <td colspan="2"><strong>您今日剩余下载流量：</strong><span class="style1"><?=$quote?>M</span></td>
        </tr>
        <tr align="center">
          <td colspan="2"><?=$download?></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
        </tr>
      </table>
</p>
</td></tr></table>
</center>
</body>
</html>