2026-10-01 12:11:43 +08:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* 高级搜索(v11,从 MovieLog search.php 迁入)。
|
|
|
|
|
*
|
|
|
|
|
* 与观影列表页顶部那个「一个关键词搜所有字段」的搜索栏不同:这里是**组合条件**——
|
|
|
|
|
* 片名 / 影院 / 观影人 / 日期范围 可以任意叠加,且观影人、影院是从下拉里点名选。
|
|
|
|
|
* 一个条件都不给时不查询,页面提示「先设置条件」(否则条件全空 = 全表,看着像卡了)。
|
|
|
|
|
*/
|
|
|
|
|
?>
|
|
|
|
|
<div class="page-head">
|
|
|
|
|
<h1>高级搜索</h1>
|
|
|
|
|
<span class="sub">组合多个条件精确查找</span>
|
|
|
|
|
<div class="actions">
|
2026-10-01 17:42:15 +08:00
|
|
|
<a class="btn btn-ghost" href="<?= e(url('movies')) ?>">返回观影</a>
|
2026-10-01 19:35:48 +08:00
|
|
|
<?php $setCurrent = 'search'; $setCanWrite = \App\Auth::canWrite(); require __DIR__ . '/_settings_menu.php'; ?>
|
2026-10-01 12:11:43 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form method="get" action="index.php" class="card card-pad adv-form">
|
|
|
|
|
<input type="hidden" name="r" value="movies/search">
|
|
|
|
|
<div class="form-grid">
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="title">片名</label>
|
|
|
|
|
<input class="input" id="title" name="title" value="<?= e($p['title']) ?>" placeholder="输入片名的一部分即可">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="cinema_id">影院</label>
|
|
|
|
|
<select class="select" id="cinema_id" name="cinema_id">
|
|
|
|
|
<option value="0">全部影院</option>
|
|
|
|
|
<?php foreach ($cinemas as $c): ?>
|
|
|
|
|
<option value="<?= (int)$c['id'] ?>" <?= (int)$p['cinema_id'] === (int)$c['id'] ? 'selected' : '' ?>>
|
|
|
|
|
<?= e(trim(((string)($c['place'] ?? '') !== '' ? $c['place'] . ' · ' : '') . $c['name'])) ?>
|
|
|
|
|
</option>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
2026-10-03 08:18:05 +08:00
|
|
|
<label>观影人</label>
|
|
|
|
|
<?php /* 筛选用的单选:要留一个「不选」= 全部,所以开 $ppAllowEmpty */ ?>
|
|
|
|
|
<?php
|
|
|
|
|
$ppName = 'person_id';
|
|
|
|
|
$ppPeople = $persons;
|
|
|
|
|
$ppSelected = [(int)$p['person_id']];
|
|
|
|
|
$ppMode = 'single';
|
|
|
|
|
$ppAllowEmpty = true;
|
|
|
|
|
$ppOpenBtn = '选择观影人';
|
|
|
|
|
$ppTitle = '按观影人筛选';
|
|
|
|
|
$ppEmptyText = '全部观影人';
|
|
|
|
|
require __DIR__ . '/../_person_picker.php';
|
|
|
|
|
?>
|
2026-10-01 12:11:43 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label>日期范围</label>
|
|
|
|
|
<div class="date-range">
|
|
|
|
|
<input class="input" type="date" name="date_from" value="<?= e($p['date_from']) ?>">
|
|
|
|
|
<span class="to">至</span>
|
|
|
|
|
<input class="input" type="date" name="date_to" value="<?= e($p['date_to']) ?>">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn-row">
|
|
|
|
|
<button type="submit" class="btn">搜索</button>
|
|
|
|
|
<a class="btn btn-ghost" href="<?= e(url('movies/search')) ?>">清空条件</a>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<?php if (!$hasCond): ?>
|
|
|
|
|
<div class="card card-pad empty">
|
|
|
|
|
<b>先设置一个条件</b>
|
|
|
|
|
填上片名、挑一家影院、指定某个人,或者框一段日期,再点「搜索」。
|
|
|
|
|
</div>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<div class="results-head">
|
|
|
|
|
<h3>搜索结果</h3>
|
|
|
|
|
<span class="sub">共 <?= count($rows) ?> 部</span>
|
|
|
|
|
</div>
|
|
|
|
|
<?php if (!$rows): ?>
|
|
|
|
|
<div class="card card-pad empty">
|
|
|
|
|
<b>没有找到符合条件的电影</b>
|
|
|
|
|
放宽一点条件再试。
|
|
|
|
|
</div>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<div class="waterfall">
|
|
|
|
|
<?php foreach ($rows as $mv): ?>
|
|
|
|
|
<a class="movie-card" href="<?= e(url('movies/show', ['id' => (int)$mv['id']])) ?>">
|
|
|
|
|
<span class="card-image">
|
|
|
|
|
<?php if (!empty($mv['poster_key'])): ?>
|
|
|
|
|
<img src="<?= e(media_url($mv['poster_key'])) ?>" alt="<?= e($mv['title']) ?>" loading="lazy">
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<span class="placeholder-poster">
|
|
|
|
|
<span class="ph-icon" aria-hidden="true">影</span>
|
|
|
|
|
<span class="placeholder-title"><?= e($mv['title']) ?></span>
|
|
|
|
|
</span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="card-body">
|
|
|
|
|
<span class="card-title"><?= e($mv['title']) ?></span>
|
|
|
|
|
<span class="card-meta">
|
|
|
|
|
<span>📅 <?= e(\App\Movie::formatWatch($mv['starts_at'], $mv['ends_at'] ?? null)) ?></span>
|
|
|
|
|
<?php if (!empty($mv['cinema_name'])): ?>
|
|
|
|
|
<span style="color: <?= e((string)($mv['cinema_color'] ?: '#888888')) ?>">🏛️ <?= e($mv['cinema_name']) ?></span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
2026-10-02 09:28:07 +08:00
|
|
|
<?php if (!empty($mv['attendees'])): ?>
|
|
|
|
|
<span class="card-viewers">
|
|
|
|
|
<?php foreach ($mv['attendees'] as $a): ?><?= person_chip($a) ?><?php endforeach; ?>
|
|
|
|
|
</span>
|
2026-10-01 12:11:43 +08:00
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
<?php endif; ?>
|