<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查询照片</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
    <div class="container">
        <h1>根据姓名和时间查找照片</h1>

        <form action="{{ url_for('search') }}" method="POST">
            <div class="form-group">
                <label for="name">姓名：</label>
                <input type="text" id="name" name="name" placeholder="请输入用户名" required>
            </div>
            <div class="form-group">
                <label for="date">日期：</label>
                <input type="text" id="date" name="date" placeholder="请输入日期 (YYYY-MM-DD)" required>
            </div>
            <button type="submit" class="btn">查询照片</button>
        </form>

        {% if photos %}
            <h2>查询结果：</h2>
            <div class="photo-gallery">
                {% for photo in photos %}
                    <div class="photo-item">
                        <img src="{{ url_for('static', filename='uploads/users/' + photo.user.username + '/photo.jpg') }}" alt="用户照片">
                    </div>
                {% endfor %}
            </div>
        {% endif %}
    </div>
</body>
</html>
