<%@page trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<!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=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<title>上传</title>
<!-- 当前页面 -->
<link type="text/css" href="${config.statie}ui/admin/images/admin.css" rel="stylesheet">
<style type="text/css">
.thumbs{margin:0 auto;overflow:hidden;text-align:center;}
.thumbs li{float:left;padding:4px 8px;width:150px;cursor:pointer;}
.thumbs li i{display:block;width:148px;height:88px;border:1px solid #F6F6F6;overflow:hidden;}
.thumbs li i.unknown{background:url(${config.statie}images/unknown.png) no-repeat center center;}
.thumbs li img{max-width:148px;}
.thumbs li span{display:block;width:100%;height:30px;line-height:30px;background:#F6F6F6;text-align:center;}
.pages{line-height:35px;text-align:center;}
</style>
</head>
<body>
<div id="wrapper">
  <div class="push">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left"><span class="orange">友情提示：</span>点击文件名称即可完成选取操作。</td>
        <td align="right"><a href="javascript:void(0);" class="button green tiny" onclick="reflesh();"><i></i>刷新</a></td>
      </tr>
    </table>
  </div>
  <div class="push">
    <ul class="thumbs clearfix">
      <gen:if test="${not empty pager.results}">
        <c:forEach items="${pager.results}" var="map">
          <li id="${map.id}" url="${map.url}" length="${map.fileLength}" class="choose" title="${map.name}">
            <gen:if test="${map.isImage == 1}"><i><img src="${map.url}" /></i><gen:else /><i class="unknown"></i></gen:if>
            <span>${map.name}</span></li>
        </c:forEach>
      <gen:else />
        <li><i class="unknown"></i><span>暂无数据</span></li>
      </gen:if>
    </ul>
    <div class="pages">${pager.pageBar}</div>
  </div>
  <div class="area">
    <h2><i>查询</i></h2>
    <div class="area-content">
      <form name="search" id="search" method="POST" action="?">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
          <tr>
            <td width="30%" align="right">条件：</td>
            <td><select name="find">
                <option value="${search.find}" <gen:if test="${empty param.find || param.find==search.find}">selected</gen:if>>不限</option>
                <c:forEach items="${search.option}" var="map">
                	<option value="${map.key}" <gen:if test="${param.find==map.key}">selected</gen:if>>${map.value}</option>
                </c:forEach>
              </select>
              &nbsp;&nbsp;
              <label><input name="userId" type="checkbox" id="userId" value="${loginAdmin.id}" <gen:if test="${not empty param.userId}">checked</gen:if>/>
              仅显示我上传的文件</label></td>
          </tr>
          <tr class="border-top">
            <td align="right">关键字： </td>
            <td><input type="text" name="keyword" class="text small" title="关键字" value="${param.keyword}" size="65"/></td>
          </tr>
          <tr class="border-top">
            <td align="right">上传时间： </td>
            <td><input id="startDate" name="startDate" type="text" class="text small" size="20" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}'});" value="${param.startDate}" />
              <label for="startDate" generated="true" class="ico-tips date-picker"></label>
              &nbsp;~&nbsp;
              <input id="endDate" name="endDate" type="text" class="text small" size="20" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}',maxDate:'%y-%M-%d'});" value="${param.endDate}" />
              <label for="endDate" generated="true" class="ico-tips date-picker"></label></td>
          </tr>
          <tr class="border-top">
            <td align="right">查询结果：</td>
            <td><select name="orderBy">
                <option value="time" <gen:if test="${empty param.orderBy || param.orderBy=='time'}">selected</gen:if>>按上传时间</option>
                <option value="fileLength" <gen:if test="${param.orderBy=='fileLength'}">selected</gen:if>>按文件大小</option>
              </select>&nbsp;
              <select name="order">
              	<option value="desc" <gen:if test="${param.order=='desc'}">selected</gen:if>>降序排列</option>
              	<option value="asc" <gen:if test="${param.order=='asc'}">selected</gen:if>>升序排列</option>
              </select></td>
          </tr>
          <tr class="border-top">
            <th colspan="2" class="push txt-c"><input name="configName" type="hidden" id="configName" value="${param.configName}" />
              <input name="psnUrl" type="hidden" id="psnUrl" value="${param.psnUrl}" />
              <input name="fileExte" type="hidden" id="fileExte" value="${param.fileExte}" />
<input name="submit" class="button blue small" type="submit" value="确 定" />
              &nbsp;&nbsp;&nbsp;&nbsp;
              <input name="reset" class="button gray small" type="reset" value="取 消" />
              </td>
          </tr>
        </table>
      </form>
    </div>
  </div>
</div>
<!-- 必备插件 -->
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.form.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.grapes.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.timers.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.tablecolor.js"></script>
<!-- 日期插件 -->
<script type="text/javascript" src="${config.statie}js/datePicker/WdatePicker.js"></script>
<!-- 弹窗插件 -->
<script type="text/javascript" src="${config.statie}js/dialog/jquery.dialog.js?self=true"></script>
<script type="text/javascript" src="${config.statie}js/dialog/jquery.dialog.plugins.js"></script>
<!-- UI界面必备 -->
<script type="text/javascript" src="${config.statie}ui/js/jspgen.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ready.js"></script>
<!-- 当前页面 -->

<script type="text/javascript">
// document.domain = "jspgen.com";

// 调用
$(document).ready(function(){
	// 变量
	var $choose = $('.thumbs li.choose');
	
	// 选择(批量)
	$choose.bind('click', function () {
		var $tr = $(this).closest('li');
		$tr.each(function(){
			$dialogApi.callback({to:'${param.to}', id:$(this).attr('id'), url:$(this).attr('url'), length:$(this).attr('length')});
		});
		$dialogApi.close();
	});
});
</script>
</body>
</html>