<?php
require_once("../../include/conn.php");
require_once("../../include/function.php");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
header("Cache-Control: no-cache, must-revalidate"); 
header("Pragma: no-cache");
$id = SafeRequest("id","get");
if(!eregi($_SERVER['SERVER_NAME'],$_SERVER['HTTP_REFERER'])){exit();}
function charset($Table){
    return iconv("gb2312", "utf-8", $Table);
}
	global $db;
if($id=="play"){
	$sql="select * from s_video where S_IsHide=0 order by s_playtime desc";
}else{
	$sql="select * from s_video where S_Reco>0 and S_IsHide=0 and s_classid=".$id." order by s_addtime desc";
}
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	if($num==0) echo charset("<li class=song_col>&nbsp;ÔÝÎÞÄÚÈÝ£¡</li>");
	$nums=20;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
	$showstr=$showstr."<li><input name='did' type='checkbox' value=".$row["S_ID"]."> <a title=".charset($row["S_Name"])." href=".LinkUrl("s_video",$row["s_ClassID"],1,$row["S_ID"])." target=_self>".charset($row["S_Name"])."</a> <em><font color=red>".charset(datetime($row["S_Playtime"]))."</font></em></li>";
	}
	echo $showstr;
?>