<?php
	include "conn/conn.php";
?>
<script src="js/chk.js" language="javascript"></script>
<script language="javascript" src="js/checkbox.js"></script>
<link rel="stylesheet" href="css/style.css" />
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<link rel="stylesheet" href="css/style.css" />
<center>
<table width="500" border="0" cellspacing="0" cellpadding="0" class="right_table">
			<tr>
			  <td width="50" height="25" align="center" valign="middle">操作</td>
				<td width="150" align="center" valign="middle">歌曲名称</td>
				<td width="150" align="center" valign="middle">主唱</td>
				<td width="50" align="center" valign="middle">在线试听</td>
				<td width="50" align="center" valign="middle">下载</td>
				<td width="50" align="center" valign="middle">介绍</td> 
			</tr>
 <form name="form1" method="post" action="realplay.php">			


<?php

	$sql = "select id,style,name,actor,remark,address from tb_video order by id desc ";//查询语句
	$num = 1;										//每页显示的记录数
	if(isset($_GET['n_page'])){						//判断当前页码
		$c_page = $_GET[n_page];					//将$n_page赋给变量$c_apge
	}else{
		$c_page = 1;								//初始化变量$c_page
	}

	$l_rst = $conn -> PageExecute($sql,$num,$c_page);	//执行pageExecute函数
	$rst = $conn->execute($sql);
	
	$record=count($rst->GetRows());					//统计总的记录数
if($l_rst->EOF){
	
?>
<tr><td colspan="6" align="center">没有数据</td></tr>
<?php 
}else{
		while(!$l_rst->EOF){
?>
			<tr onmouseover="this.style.backgroundColor='#deebef'" onmouseout="this.style.backgroundColor=''">
			  <td height="25" align="center" valign="middle" ><input type="checkbox" name="checkbox[]" value="<?php echo $l_rst->fields[0]; ?>">			    </td>

				<td align="center" valign="middle"><?php echo $l_rst->fields[2]; ?></td>
				<td align="center" valign="middle"><?php echo $l_rst->fields[3]; ?></td>
				<td align="center" valign="middle">


			<a href="#" onclick="javascript:Wopen=open('listens.php?id=<?php echo $l_rst->fields[5]; ?>','','height=720,width=1004,scrollbars=no');">
				<img src="images/首页_24.jpg" width="28" height="23" border="0" alt="在线播放"></a>
<td align="center" valign="middle">
					<a href="download.php?id=<?php echo $l_rst->fields[5] ?>&action=video"><img src=images/首页_26.jpg width=28 height=23 border=0 alt=下载/></a></td>

				<td align="center" valign="middle"><a href="#" onclick="javascript:Wopen=open('v_intro.php?id=<?php echo $l_rst->fields[0]; ?>','','height=720,width=1004,scrollbars=no');"><img src="images/首页_28.jpg" width="28" height="23" border="0" alt="介绍"></a></td>
			</tr>
	
<?php			
			$l_rst->movenext();
		}
?>		
<tr onmouseover="this.style.backgroundColor='#deebef'" onmouseout="this.style.backgroundColor=''">
			  <td height="25" colspan="6" align="center" valign="middle" >
<input name="button" type=button class="buttoncss" onClick="checkAll(form1,status)" value="全选">
<input type=button value="反选" class="buttoncss" onClick="switchAll(form1,status)">
<input type=button value="不选" class="buttoncss" onClick="uncheckAll(form1,status)"></td>
	  </tr>	
<tr><td height="25" colspan="7">

    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="90">&nbsp;总计<?php echo $record; ?>条记录</td>
       <td width="153">


<font color='#999999'>当前是第<?php echo $l_rst -> absolutePage(); ?>页/一共是<?php echo $l_rst -> LastPageNo(); ?>页</font></td>
<td width="257">
<?php


		if(!$l_rst -> AtfirstPage()){					//如果当前页不是首页
?>



<!--  输出向上翻页超链接  -->
		<a href ="<?php echo "?lmbs=$_GET[lmbs]&n_page=1";?>"> 首页 </a>
		<a href ="<?php echo "?lmbs=$_GET[lmbs]&n_page=".($l_rst -> absolutePage() - 1); ?>"> 上一页 </a>
<!--  ----------------------------  -->
<?php
		}
		if(!$l_rst -> AtlastPage()){					//如果当前页不是尾页
?>
<!--  输出向下翻页超链接  -->
		<a href = "<?php echo "?lmbs=$_GET[lmbs]&n_page=".($l_rst -> absolutePage() + 1); ?>"> 下一页 </a>
		<a href ="<?php echo "?lmbs=$_GET[lmbs]&n_page=1".($l_rst -> LastPageNo());?>"> 尾页 </a>	
<!--  -----------------------------  -->

<?php
		}

?></td>
      </tr>
    </table></td>
</tr>


<tr onmouseover="this.style.backgroundColor='#deebef'" onmouseout="this.style.backgroundColor=''">
  <td height="25" align="center" valign="middle" ><!--播放方式循环：是
          <input type="radio" name="radiobutton" value="true" />
否
<input name="radiobutton" type="radio" value="false" checked="checked" />--></td>
			  <td colspan="5" align="center" valign="middle"><input type="submit" name="Submit3" value="添加到播放列表" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit2" value="循环播放" />
			  &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="连续播放">
			  <a href="music_list.php" target="_blank" class="STYLE1"> 查看播放列表</a></td>
	  </tr>
 </form>
<?php }?>
  </table>
<?php 
if($_SESSION[names]==true){

?>
<table width="500" border="0" cellspacing="0" cellpadding="0" class="right_table">
			<tr>
				<td height="30" colspan="4" align="center" valign="middle" background="images/new_file_left.jpg"><div style="font-size:15px; color:#ffffff;"><a href="insert_internet_music.php" target="_blank"><?php echo $_SESSION[names];?>收藏的网络音乐</a></div></td>
			</tr>
			<tr>
	
				<td width="150" align="center" valign="middle">歌曲名称</td>
				<td width="200" align="center" valign="middle">歌手</td>
				<td width="150" align="center" valign="middle">在线试听</td>
			</tr>
<?php

	$sqls = "select * from tb_internet_video where tb_music_user='".$_SESSION[names]."'";//查询语句
	$nums = 3;										//每页显示的记录数
	if(isset($_GET['n_pages'])){						//判断当前页码
		$c_pages = $_GET[n_pages];					//将$n_page赋给变量$c_apge
	}else{
		$c_pages = 1;								//初始化变量$c_page
	}
	$l_rsts = $conn -> PageExecute($sqls,$nums,$c_pages);	//执行pageExecute函数
	$rsts = $conn->execute($sqls);
	
	$records=count($rsts->GetRows());					//统计总的记录数
if($l_rsts->EOF){
	
?>
<tr><td colspan="4" align="center">没有数据</td></tr>
<?php 
}else{
		while(!$l_rsts->EOF){
?>
			<tr onmouseover="this.style.backgroundColor='#deebef'" onmouseout="this.style.backgroundColor=''">
			 				<td align="center" valign="middle"><?php echo $l_rsts->fields[1]; ?></td>
				<td align="center" valign="middle"><?php echo $l_rsts->fields[2]; ?></td>
				<td align="center" valign="middle">
		
			<img src="images/首页_24.jpg" alt="在线播放" width="28" height="23" border="0" onclick="MM_openBrWindow('<?php echo $l_rsts->fields[3]; ?>','','width=1004,height=720')"></tr>
		
	
<?php			
			$l_rsts->movenext();
		}

?>	

<tr><td height="25" colspan="5">

    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="91">&nbsp;总计<?php echo $records; ?>条记录</td>
       <td width="178">


<font color='#999999'>当前是第<?php echo $l_rsts -> absolutePage(); ?>页/一共是<?php echo $l_rsts -> LastPageNo(); ?>页</font></td>
<td width="231">
<?php


		if(!$l_rsts -> AtfirstPage()){					//如果当前页不是首页
?>



<!--  输出向上翻页超链接  -->
		<a href ="<?php echo "?lmbs=$_GET[lmbs]&n_pages=1";?>"> 首页 </a>
		<a href ="<?php echo "?lmbs=$_GET[lmbs]&n_pages=".($l_rsts -> absolutePage() - 1); ?>"> 上一页 </a>
<!--  ----------------------------  -->
<?php
		}
		if(!$l_rsts -> AtlastPage()){					//如果当前页不是尾页
?>
<!--  输出向下翻页超链接  -->
		<a href = "<?php echo "?lmbs=$_GET[lmbs]&n_pages=".($l_rsts -> absolutePage() + 1); ?>"> 下一页 </a>
		<a href ="<?php echo "?lmbs=$_GET[lmbs]&n_pages=".($l_rsts -> LastPageNo());?>"> 尾页 </a>	
<!--  -----------------------------  -->

<?php
		}

?></td>
      </tr>
    </table></td>
</tr>
<?php }?>
  </table>
<?php

}

?>
</center>

