<?php
$translate = $this->plugin('translate');
// Prepare the user queries
$ids = isset($query['user_id']) ? $query['user_id'] : [];
if (!is_array($ids)) {
    $ids = [$ids];
}
$ids = array_filter($ids);
if (!$ids) {
    $ids = [null];
}
$role = isset($query['role']) ? $query['role'] : null;
$sitePermissionSiteId = isset($query['site_permission_site_id']) ? $query['site_permission_site_id'] : null;
?>
<div class="field">
    <div class="field-meta">
        <label for="email"><?php echo $translate('Search by email'); ?></label>
    </div>
    <div class="inputs">
        <input name="email" value="" type="text">
    </div>
</div>
<div class="field">
    <div class="field-meta">
        <label for="name"><?php echo $translate('Search by name'); ?></label>
    </div>
    <div class="inputs">
        <input name="name" value="" type="text">
    </div>
</div>
<div class="field">
    <div class="field-meta">
        <label for="role"><?php echo $translate('Search by role'); ?></label>
    </div>
    <div class="inputs">
        <?php echo $this->roleSelect([
            'name' => 'role',
            'attributes' => ['id' => 'role', 'value' => $role]
        ]); ?>
    </div>
</div>
<div class="field">
    <div class="field-meta">
        <label for="is_active"><?php echo $translate('Search by activity'); ?></label>
    </div>
    <div class="inputs">
        <label><input name="is_active" value="1" type="radio"><?php echo $translate('Active'); ?></label>
        <label><input name="is_active" value="0" type="radio"><?php echo $translate('Not active'); ?></label>
    </div>
</div>
<div class="field">
    <div class="field-meta">
        <label for="site_permission_site_id"><?php echo $translate('Has permission in site'); ?></label>
    </div>
    <div class="inputs">
        <?php echo $this->siteSelect([
            'name' => 'site_permission_site_id',
            'attributes' => ['id' => 'site_permission_site_id', 'value' => $sitePermissionSiteId]
        ]); ?>
    </div>
</div>
