<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>更改文件</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<style>
.coolbg2 {
border: 1px solid #000000;
background-color: #F2F5E9;
height:18px
}
</style>
<script language='javascript'>
function CheckSubmit()
{
	if(document.form1.title.value==""){
		alert("請設定媒體標題！");
		document.form1.title.focus();
		return false;
	}
}
</script>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
<table width="99%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
<tr> 
<td height="19" background='images/tbg.gif'>
<table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr> 
<td width="2%" align="center" valign="middle"><img src="images/item_tt2.gif" width="7" height="15"></td>
<td width="44%"><strong>更改媒體：</strong></td>
<td width="54%" align="right">[<a href='media_main.php'><u>附件/媒體數據管理</u></a>]</td>
</tr>
</table></td>
</tr>
<tr> 
<td height="19" bgcolor="#ffffff">
<img src="images/help.gif" border="0">
提示：圖片類型僅支持jpg、png、gif、wbmp格式，flash為.swf格式，視音頻和附件為限定擴展名的類型(可在系統參數中修改)。
</td>
</tr>
<tr> 
<td height="69" align="center" valign="top" bgcolor="#FFFFFF">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form enctype="multipart/form-data" name='form1' action="media_edit.php" method="POST" onSubmit="return CheckSubmit();">
<input type="hidden" name="dopost" value="save">
<input type="hidden" name="aid" value="<?php echo $aid?>"> 
<tr> 
<td width="15%" height="30" align="left" bgcolor="#FFFFFF"class='bline'>媒體類型：</td>
<td width="85%" height="25" align="left" bgcolor="#FFFFFF"class='bline'>
	<input type="radio" name="mediatype" class="np" value="1"<?php if($myrow['mediatype']==1) echo " checked"; ?>>
圖片 
<input type="radio" name="mediatype" class="np" value="2"<?php if($myrow['mediatype']==2) echo " checked"; ?>>
FLASH 
<input type="radio" name="mediatype" class="np" value="3"<?php if($myrow['mediatype']==3) echo " checked"; ?>>
視頻/音頻 
<input type="radio" name="mediatype" class="np" value="4"<?php if($myrow['mediatype']==4) echo " checked"; ?>>
附件/其它
</td>
</tr>
<tr> 
<td height="30" align="center" bgcolor="#FFFFFF"class='bline'>說明標題：</td>
<td height="25" align="left" bgcolor="#FFFFFF"class='bline'>
	<input name="title" type="text" id="title" size="30" value="<?php echo $myrow['title']?>">
</td>
</tr>
<tr> 
<td height="30" align="center" bgcolor="#FFFFFF"class='bline'>參數說明：</td>
<td height="30" colspan='2' align="left" bgcolor="#FFFFFF"class='bline'>圖片不需要指定「寬」、「高」，其它附加參數僅方便多媒體文件管理，沒其它含義</td>
</tr>
<tr> 
<td height="30" align="center" bgcolor="#FFFFFF" class='bline'>附加參數：</td>
<td height="25" align="left" bgcolor="#FFFFFF" class='bline'>
	寬： 
<input name="mediawidth" type="text" id="mediawidth" size="5" value="<?php echo $myrow['width']?>">
(像素)　高： 
<input name="mediaheight" type="text" id="mediaheight" size="5" value="<?php echo $myrow['height']?>">
(像素)　播放時間： 
<input name="playtime" type="text" id="playtime" size="5" value="<?php echo $myrow['playtime']?>">
(分鐘)
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#FFFFFF"class='bline'>原文件：</td>
<td align="left" bgcolor="#FFFFFF"class='bline'>
<input name="filename" type="text" id="filename" style='width:350px' value="<?php echo $myrow['url']?>" >
<a href='<?php echo $myrow['url']?>' target='_blank'>[查看]</a>
</td>
</tr>
<?php
if($myrow['mediatype']==1)
{
 	$fullfilename = $cfg_basedir.$myrow['url'];
 	if(file_exists($fullfilename)){
 		$info = "";
 		$sizes = getimagesize($fullfilename,$info);
 		if(is_array($sizes)){
 			if($sizes[0]>200) $w=200;
 			else $w = $sizes[0];
?>
<tr>
<td height="30" align="center" bgcolor="#FFFFFF"class='bline'>預覽：</td>
<td align="left" bgcolor="#FFFFFF"class='bline'>
<a href='<?php echo $myrow['url']?>' target='_blank'><img src='<?php echo $myrow['url']."?q=".time()?>' width='<?php echo $w?>' border='0' id='picview'></a>
</td>
</tr>
<?php } } } ?>
<tr> 
<td height="25" align="center" bgcolor="#FFFFFF"class='bline'>
	更改文件：
</td>
<td align="left" bgcolor="#FFFFFF"class='bline'>
<input name="upfile" type="file" id="upfile" style='width:300px'  size='30' >
</td>
</tr>
<tr> 
<td height="62" colspan="2" bgcolor="#FFFFFF"class='bline'>
<table width="60%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td align="center" height='48'>
<input class="np" name="imageField" type="image" src="images/button_save.gif" width="60" height="22" border="0"> 
</td>
</tr>
</table>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>