<!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>
<title>修改附件</title>
<?php include(DEDEMEMBER."/templets/head_inc.htm"); ?>
<script type="text/javascript" language='javascript' src='js/main.js'></script>
<script type="text/javascript" language="javascript">
<!--
function checkSubmit()
{
	if(document.form1.title.value=='')
	{
		alert('标题不能为空！');
		document.form1.title.focus();
		return false;
	}
	if(document.form1.vdcode.value=='')
	{
		document.form1.vdcode.focus();
		alert('验证码不能为空！');
		return false;
	}
}
-->
</script>
</head>
<body>
<?php include(DEDEMEMBER."/templets/head.htm"); ?>
<div class="wrapper lineT">
  <div class="mainBox">
    <div class="main">
      <?php include(DEDEMEMBER."/templets/menu.php"); ?>
      <div class="dedeMain">
        <div class="location">附件管理</div>
        <form class="mTB10 mL10 mR10" name="form1" action="uploads_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
          <input type="hidden" name="aid" value="<?php echo $aid; ?>" />
          <input type="hidden" name="mediatype" value="<?php echo $arow['mediatype']; ?>" />
          <input type="hidden" name="oldurl" value="<?php echo $arow['url']; ?>" />
          <input type="hidden" name="dopost" value="save" />
          <table cellspacing="1" class="submit">
            <thead>
              <tr>
                <th colspan="2" >修改附件</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td width="15%" align="right" valign="top">允许的类型：</td>
                <td><?php

     	if($arow['mediatype']==1){
     		echo $cfg_imgtype;
     	}
     	else if($arow['mediatype']==2){
     		echo "swf";
     	}
     	else if($arow['mediatype']==3){
     		echo $cfg_mediatype;
     	}
     	else{
     		echo $cfg_mb_addontype;
     	}
     	?></td>
              </tr>
              <tr>
                <td align="right" valign="top">注释标题：</td>
                <td><input name="title" type="text" id="title" size="30" class="text" value="<?php echo $arow['title']?>" /></td>
              </tr>
              <?php
     if($arow['mediatype']==1){
     ?>
              <tr>
                <td align="right" valign="top">更换图片：</td>
                <td><input name="addonfile" type="file" id="addonfile" style="width:300px" <?php if($arow['mediatype']==1) echo " onChange=\"SeePicNew('divpicview',this);\" "; ?> /></td>
              </tr>
              <tr>
                <td align="right" valign="top">预览区：</td>
                <td><?php
             	$furl = $arow['url'];
             	$w = 150;
             	if($furl!="" && file_exists($cfg_basedir.$furl))
             	{
             		$info = "";
             		$datas = GetImageSize($cfg_basedir.$furl,$info);
             		if($datas[0]>500)
             		{
             			$w = 500;
             		}
             		else
             		{
             			$w = $datas[0];
             		}
             	}
             	else
             	{
             		$furl = "images/pview.gif";
             	}
             	$furl = $furl."?".time();
             	?>
                  <div id='divpicview' class='divpre'></div>
                  <a href="<?php echo $furl?>" target="_blank"><img src="<?php echo $furl; ?>" id="picview" width="<?php echo $w?>" border="0" /></a></td>
              </tr>
              <?php
     }else{
      ?>
              <tr>
                <td align="right" valign="top">更换附件：</td>
                <td><input name="addonfile" type="file" id="addonfile" style="width:300px" /></td>
              </tr>
              <?php
     }
     ?>
            </tbody>
            <tfoot>
              <tr>
                <td height="45">&nbsp;</td>
                <td height="45"><button class="button2" type="submit" >提交</button></td>
              </tr>
            </tfoot>
          </table>
        </form>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>
</body>
</html>
