<?php
require_once("../../include/label.php");
if(isset($_COOKIE["s_id"])){
	$S_UID=$_COOKIE["s_id"];
}
else{
	$S_UID="";
}
if(isset($_COOKIE["s_name"])){
	$S_Name=$_COOKIE["s_name"];
}
else{
	$S_Name="";
}
$sql= "select s_id from s_users where S_Name='".$S_Name."' and S_id=$S_UID";
$s_id= $db->Getone($sql);
if(!$s_id){
exit('非法操作！');
}
//成功返回
if (isset($_POST['filelist']))
{
    $chshcms=explode(date('Ymd'),$_POST['filelist']);
    $name=substr($chshcms[1],1,-9);
    $url=S_SitePath."upload/url/".date('Ymd').$chshcms[1];  
    echo '<script>window.opener.document.form3.S_Vdata.value="'.$url.'";</script>';
    echo '<script>window.opener.document.form3.S_Name.value="'.$name.'";window.close();</script>';
exit();
}
?>
<html>
<head>
<title>舞曲在线上传系统</title>
<link href="css.css" type="text/css" rel="stylesheet" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript">
function check_reply(oUpload, oForm)
{
	if (document.getElementById('subpath').value==''){
        alert("对不起，请选择舞曲类型再操作！");
        return false;
	}

	if(!oUpload.isready ())
	{
		alert("您还没有选择需要上传的文件。");
		return false;
	}
	oUpload.setpath (oForm.subpath.value); // 设置上传文件的路径
	if(oUpload.uploadfile()=="") // 上传所选择的文件
		return false;
}
</script>
<form method="post" action="up.php" onSubmit="return check_reply(uploadid,this);">
	<div class="web"><input name="title" type="hidden" value="选择舞曲进行上传">
	<div class="xinxi">
<blockquote>
<span style="DISPLAY: none">
<input name="subpath" type="hidden" value="url">
<object id="uploadid" classid="clsid:18B9E4BF-F21F-46B9-AD50-5CA62145426A" codebase="xuploadfiles.cab">
<param name="Action" value="xu_normal.php">
<param name="Bind" value="filelist">
</object>
</span>
上传文件： 
<script language="javascript" src="xuploadfiles.js"></script>
<input name="filelist" type="text" size="30" wrap="off" readonly="readonly" id="filelist" style="OVERFLOW-X: hidden" value="在线上传">
<input onClick="uploadid.selectfile();" type="button" value="浏览..." />
<input type="submit" name="ok" value="确定上传" />
</blockquote>
</div>
</body>
</html>