<!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">
var fname = '<?php echo $f; ?>';
var mediatype = '<?php echo $mediatype; ?>';
var keyword = '<?php echo $keyword; ?>';

function addNew()
{
	location = "uploads_add.php?f="+fname+"&mediatype="+mediatype+"&keyword="+keyword;
}

function selOK(surl)
{
	window.opener.document.<?php echo $f; ?>.value=surl;
	if(document.all) window.opener=true;
	window.close();
}

</script>
</head>
<body>
<div class="bgGreen mTB10">
  <div class="fLeft">
    <form name='forms' method='post' action='uploads_select.php'>
      <input type="hidden" name="f" value="<?php echo $f; ?>" />
      <input type="hidden" name="mediatype" value="<?php echo $mediatype; ?>" />
      <input type="hidden" name="keyword" value="<?php echo $keyword; ?>" />
      <input name="keyword" type="text" id="keyword" class="text" value="<?php echo $keyword?>" />
      <select name='mediatype'>
        <option value='0'>文件类型</option>
        <option value='1'<?php if($mediatype==1) echo " selected='1' "; ?>>图片</option>
        <option value='2'<?php if($mediatype==2) echo " selected='1' "; ?>>FLASH</option>
        <option value='3'<?php if($mediatype==3) echo " selected='1' "; ?>>视频/音频</option>
        <option value='4'<?php if($mediatype==4) echo " selected='1' "; ?>>其它附件</option>
      </select>
      <button class="button2 mL10" type="submit">搜索</button>
    </form>
  </div>
  <div class="fRight">
    <button class="buttonGary5 mR10" type="button" onclick="addNew();">上传新文件</button>
  </div>
  <div class="clear"></div>
</div>
<form name="form1" class="mTB10">
  <table cellspacing="1" class="list">
    <thead>
      <tr>
        <th align="left" width="1%"><input name="checkedClick" type="checkbox" value="" id="checkedClick"></th>
        <th >文件标题</th>
        <th width="5%">大小 </th>
        <th width="5%">类型 </th>
        <th width="10%">上传时间 </th>
      </tr>
    </thead>
    <tbody>
    
    {dede:datalist}
    <tr>
      <td><input type='checkbox' name='aids' id='aids<?php echo $fields['aid']?>' value="<?php echo $fields['url']; ?>" onclick="selOK('<?php echo $fields['url']; ?>');" /></td>
      <td><?php
			$color = '';
			if($filename==$fields['url']) $color=" style='color:red' ";
			?>
        <a href="#" onclick="selOK('<?php echo $fields['url']; ?>');" <?php echo $color; ?>> <?php echo GetImageView($fields['url'],$fields['mediatype']); ?> <?php echo $fields['title']; ?> </a> </td>
      <td align="center"><?php echo GetFileSize($fields['filesize']); ?></td>
      <td align="center"><?php echo MediaType($fields['mediatype'],$fields['url']); ?></td>
      <td align="center"><?php echo MyDate("Y-m-d",$fields['uptime']); ?></td>
    </tr>
    {/dede:datalist}
    </tbody>
    
    <tfoot>
      <tr>
        <td colspan="6"><div>
            <div class="fLeft">
              <button class="buttonGary5" type="button" onclick="addNew();">上传新文件</button>
            </div>
            <div class="pages fRight">{dede:pagelist listsize=5/}</div>
          </div></td>
      </tr>
    </tfoot>
  </table>
</form>
</body>
</html>
