<%@ Page CodeBehind="searchfile.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.searchfile" %>
<%@ Register Src="~/usertop_out.ascx" TagPrefix="uc1" TagName="usertop_out" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <!-- Plugin styles -->
    <link rel="stylesheet" href="css/bundle.css" type="text/css">
    <!-- App styles -->
    <link rel="stylesheet" href="css/app.min.css" type="text/css">
	
</head>
<body>

<div>

    <!-- begin::header -->
    <uc1:usertop_out runat="server" id="usertop_out" />
    <!-- end::header -->

    <!-- begin::main content -->
    <main class="main-content">

        <div >

           <div class="card">
			    <div class="card-body">
							<div class="row">&nbsp;&nbsp;&nbsp;&nbsp;<img src="pics/files.gif" width="16" height="16" align="absMiddle">&nbsp;&nbsp;&nbsp;&nbsp;<h5><b>查找文件或目录</b></h5>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1);"><img src="pics/link_back.gif" border="0" align="absMiddle"></a></div>
					<form id="form" name="form" action="<%if (Request["action"]!=null) Response.Write(Request["action"].ToString());%>.aspx" method="post" onSubmit="return save_onclick()">
<div class="form-group row">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label">搜索文件夹</label>
                                            <div class="col-sm">
                                               <asp:Label ID="pathstr" runat="server"></asp:Label>
                              <input id="path" type="hidden" size="4" name="path" runat="server">
                              <input id="toFind" type="hidden" size="2" value="1" name="toFind">
                                            </div>
                                        </div>
<div class="form-group row">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label">文件名或目录名</label>
                                            <div class="col-sm">
                                                <input type="text" class="form-control" id="txtname" name="txtname" runat="server">
                                            </div>
                                        </div>
<div class="form-group row">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label">指定修改时间</label>
                                            <div class="col">
                                                <input type="text" id="txttime1" name="daterangepicker" class="form-control" placeholder="不选为不限" onfocus="new Calendar().show(this);" runat="server">
                                            </div>
                                            <span>-
                                            </span>
                                            <div class="col">
                                                <input type="text" id="txttime2" name="daterangepicker" class="form-control" placeholder="不选为不限" onfocus="new Calendar().show(this);" runat="server">
                                            </div>
    </div>

  <div class="form-group row" id="show1" runat="server">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label">文件大小</label>
                                            <div class="col">
                                                <input type="text" id="txtsize1" class="form-control" placeholder="不填为不限" runat="server">
                                            </div>
                                            <span>KB－
                                            </span>
                                            <div class="col">
                                                <input type="text" id="txtsize2" class="form-control" placeholder="不填为不限" runat="server">
                                            </div>
                                            <span>KB
                                            </span>
                                        </div>
 <div class="form-group row" id="show2" runat="server">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label">文件类型</label>
                                            <div class="col-sm">
                                                <input type="text" class="form-control" id="txttype" name="txttype" placeholder="输入扩展名，用半角,分隔，不填为不限" runat="server">
                                            </div>
                                        </div>
 <div class="form-group row">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label">注释</label>
                                            <div class="col-sm">
                                                <input type="text" class="form-control" id="txtnote" name="txtnote" placeholder="不填为不限" runat="server">
                                            </div>
                                        </div>
 <div class="form-group row">
                                            <label for="inputEmail3" class="col-sm-2 col-form-label"></label>
                                            <div class="col-sm">
                                                 <div class="custom-control custom-checkbox mr-3">
												&nbsp;<input type="checkbox" class="custom-control-input" id="zi" value="1" checked name="zi" runat="server">
												<label class="custom-control-label" for="zi">搜索子目录</label>
											</div>
                                            </div>
                                        </div>           
   <div align="center" class="row justify-content-center">
                        <input class="btn btn-primary" id="Button3" type="submit" value=" 搜 索 " name="Button3">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input class="btn btn-light" onclick="javascript: history.go(-1);" type="button" value="返回前页" name="Submit">
       </div>
                   </form>
			    </div>
			    </div>

    </main>
    <!-- end::main content -->
</body>
</html>			
<!-- Plugin scripts -->
			   <script type="text/javascript" src="js/calendar.js"></script>
<script src="js/bundle.js"></script>
<!-- App scripts -->
<script src="js/app.min.js"></script>
<script src="js/function.js"></script>
		<script type="text/javascript" src="js/calendar.js"></script>
		<script>
            var CalendarWebControl = new atCalendarControl();
        </script>
<SCRIPT>
    function checkDate(theDate) {
        var reg = /^\d{4}-((0{0,1}[1-9]{1})|(1[0-2]{1}))-((0{0,1}[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))$/;
        var result = true;
        if (!reg.test(theDate))
            result = false;
        else {
            var arr_hd = theDate.split("-");
            var dateTmp;
            dateTmp = new Date(arr_hd[0], parseFloat(arr_hd[1]) - 1, parseFloat(arr_hd[2]));
            if (dateTmp.getFullYear() != parseFloat(arr_hd[0])
                || dateTmp.getMonth() != parseFloat(arr_hd[1]) - 1
                || dateTmp.getDate() != parseFloat(arr_hd[2])) {
                result = false
            }
        }
        return result;
    }
    function save_onclick() {
        var strTemp = document.form.txtsize1.value;
        if ((strTemp.length > 0) && (isNaN(strTemp))) {
            alert("文件大小请输入数字！");
            document.form.txtsize1.focus();
            return false;
        }
        var strTemp = document.form.txtsize2.value;
        if ((strTemp.length > 0) && (isNaN(strTemp))) {
            alert("文件大小请输入数字！");
            document.form.txtsize2.focus();
            return false;
        }
        if ((document.getElementById("txttime1").value != "") && (!checkDate(document.getElementById("txttime1").value))) {
            alert('请输入正确的日期！');
            document.form.txttime1.focus();
            return false;
        }
        if ((document.getElementById("txttime2").value != "") && (!checkDate(document.getElementById("txttime2").value))) {
            alert('请输入正确的日期！');
            document.form.txttime2.focus();
            return false;
        }
        return true;
    }
</SCRIPT>